Skip to main content

Unable to access seam component from JMaki on EditorSaveEvent

4 replies [Last post]
soumyasaha
Offline
Joined: 2008-07-07
Points: 0

Hi,

I am trying to update my yahoo data table by the editor save event.

I have created my own js file(jmaki-seam.js) and added the same to config.json.

I am displaying some data based on the user table as a yahoo data table and on the first coulmn I have the textbox editor.

I am subscribing to the editor save event in yahoo data table and on click
, I try to call the seam component from the js, it does not work and also does not throw any exceptions at all.

Relevant code details :

web.xml
***********************************

Seam Remoting
org.jboss.seam.remoting.SeamRemotingServlet

Seam Remoting
/seam/remoting/*

Components.xml
******************************************************

true

config.json
*************************************
{
'config': {
'version': '1.0',
'glue' : {
'includes': ['/glue.js', '/resources/system-glue.js','/view/jmaki-seam.js']
}
}
}

jmaki-seam.js
***************************************
jmaki.subscribe("/yahoo/dataTable/editorSaveEvent",function(args){

var myJSONText = JSON.stringify(args.data);
alert('String::::'+myJSONText);

// Get the "dataTableSample" Seam component
//var manager = Seam.Component.getInstance("dataTableSample");
// alert('manager ::::'+manager);
Seam.Component.getInstance("dataTableSample").updateCellJSON(myJSONText);
alert(' Called ::::');

});

dataTableSample
********************************
@Stateless
@Scope(SESSION)
@Name("dataTableSample")
public class DataTableSampleBean implements DataTableSampleLocal {

@WebRemote
public void updateCellJSON(String jsonArray){

System.out.println(" INSIDE EJB !!!! ");
System.out.println(jsonArray);

String jsonString = jsonArray.substring(1, jsonArray.length()-1);
System.out.println(jsonString);
//getMapData(jsonString);
//System.out.println(jsonArray.toString());

//return productionsDataJSON;
System.out.println(" CALLED EJB !!!! ");
}

}

DataTableSampleLocal
*************************************
@Local
public interface DataTableSampleLocal {
public void updateCellJSON(String jsonArray);
}

It works fine when I initially load the data with

Any help will be highly appreciated

Thanks
Soumya

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
soumyasaha
Offline
Joined: 2008-07-07
Points: 0

Hello Greg,

Thanks for your reply.
The issue is fixed already, it was a problem from my side. The resolution was to add @WebRemote
to the method defined in EJB Interface.

The data table works just fine and is absolutely amazing.

I had one other problem though using JSON objects in an EJB. It works in an POJO but gives compile time errors in an EJB. Is this the correct forum to place this question ?

Thanks

Soumya

Message was edited by: soumyasaha

soumyasaha
Offline
Joined: 2008-07-07
Points: 0

Hello Greg,

The resolution was to add @WebRemote
to the method defined in EJB Interface. Sorry for the incorrect message in the previous post.

Thanks

Soumya

Message was edited by: soumyasaha

Message was edited by: soumyasaha

soumyasaha
Offline
Joined: 2008-07-07
Points: 0

Hi,

Just wanted to add one more thing. I am developing it on Eclipse adn use JBOSS as the server.

Thanks
Soumya

gmurray71
Offline
Joined: 2003-07-31
Points: 0

HI Soumyasaha,

I'm sorry I didn't pick this up because it looked like there was a reply already.

Are you still looking to fix this issue?

We have been working on the Yahoo DataTable component and this might be fixed.

-Greg