-
1. Re: Scriptaculous Sortable List Integration with Seam Remoti
pmuir Jan 9, 2008 6:58 PM (in response to nathandennis)I don't think this went anywhere, sorry.
-
2. Re: Scriptaculous Sortable List Integration with Seam Remoti
shane.bryzak Jan 9, 2008 7:33 PM (in response to nathandennis)I don't really understand what you are trying to do, but can't you just sort your list server-side?
-
3. Re: Scriptaculous Sortable List Integration with Seam Remoti
nathandennis Jan 9, 2008 7:45 PM (in response to nathandennis)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. -
4. Re: Scriptaculous Sortable List Integration with Seam Remoti
nathandennis Jan 9, 2008 8:07 PM (in response to nathandennis)the one question i do have is.
how can i cause an existing container generated by a4j:outputPanel to reRender from the java script?
i thinking something likeA4J.AJAX.Submit('_viewRoot','form_name',event,{'parameters':{'form_name:refresh':'form_name:refresh'} ,'actionUrl':'/url/topage.seam'} );return false;
got that from creating a refresh button for the panel i wanted to rerender.. and looking at the generated html. the parameters are wrong for executing it from js. im not sure where the link to the div im rerendering is. ive been looking for some documentation on the structure of the A4J.AJAX.Submit( method with no luck.
any pointers? looking back at my own post im not sure that made any sense. maybe nonsense. -
5. Re: Scriptaculous Sortable List Integration with Seam Remoti
shane.bryzak Jan 10, 2008 8:06 PM (in response to nathandennis)It might be best to ask this in the Ajax4JSF forum.
-
6. Re: Scriptaculous Sortable List Integration with Seam Remoti
nathandennis Jan 10, 2008 9:56 PM (in response to nathandennis)looking back... that might have been a stupid question. i promise the read the documentation more closely next time. kudos for a well constructed javascript interface. i guess the concept of a response just seem too complicated yesterday... let alone actually do something with it. what really helped was capturing some packets and seeing what was going over the line.
im learning. it makes more sense now.
thanks for your patience.