[jboss-user] [JBoss Seam] - Re: Scriptaculous Sortable List Integration with Seam Remoti
nathandennis
do-not-reply at jboss.com
Wed Jan 9 19:45:17 EST 2008
it took me a bit, but after i stopped trying to make theirs serialization work,, and used my head,,, i came up with a workaround.
what i was trying to do was get the graphically ordered list to the server so i could sort it in an array and persist any changes.
created session bean with a string field and use seam remote.
| Sortable.create('list',{onUpdate:function(){
| var orderLayerList = '';
| var orderedNodes = document.getElementById('list').getElementsByTagName('li');
| for (var i = 0; i < orderedNodes.length; i++) {
| orderLayerList += orderedNodes
| .getAttribute('id') + ', ';
| }
| Seam.Component.getInstance('someAction').parseLayerList(orderLayerList);
| var ef = new Effect.Highlight('list',{});}});
|
parse the string with a tokenizer.
| StringTokenizer line = new StringTokenizer(list,", ", false);
| int tokencount = line.countTokens();
| log.info("token count" + tokencount);
| List<String> layerarray = new ArrayList<String>();
| for (int dem=0; dem < tokencount ; dem++){
| layerarray.add(line.nextToken());
| log.info(layerarray.get(dem).toString());
| }
|
then i got distracted and i havent finished the rest. but now it is in an array and should be no problem.
was that a good approach? seemed to work.
thanks for the response though.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118489#4118489
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118489
More information about the jboss-user
mailing list