Hi,
I'd like to do something slightly unusual and wrap the 
wicketSubmitFormById call in another javascript function -- I'm able to 
do this with no problem by overriding 
AjaxFormSubmitBehavor.onRenderHeadInitContribution and calling 
JavascriptUtils.writeJavascript on a wrapped getEventHandler. I can stop 
the normal attribute for 'onclick' or whatever from appearing inside the 
component tag by overriding onComponentTag. And by using text input 
boxes, I can pass 'arguments' to my method on the server inside using 
FormComponent.getConvertedInput. So far so good.

The problem I have is that I'd like to actually 'return' a value back 
from the server in that Javascript function... so my function ends up 
looking just like a normal function call inside of my Javascript and 
returns the value that the server provides.

I can see inside of wicket-ajax.js that there are three special tags: 
"component", "evaluate" and "header-contribution", each with their 
appropriate purpose -- I tried messing around with 
AjaxRequestTarget.prependJavascript so I could pass something through 
the 'evaluate' tag, but my javascript isn't sufficient to the task. Then 
I tried using AjaxRequestTarget.addComponent to modify another TextField 
and return the value through the DOM tree -- that works fine except for 
the fact that the order is wrong, so my method returns _before_ the 
component is updated.

Then I noticed this interesting Wicket.Ajax.invokePostCallHandlers() 
call, which makes me wonder if there is already some nice clean 
mechanism in place for updating javascript variables thru wicket's java 
code.

Apologies if this all makes no sense, but any advice or suggestions 
would be much appreciated. The basic requirement is just that I make a 
call in Javascript and get data back from the server as a 'returned' 
variable on the client.

Thanks,
James

--
James Renfro
Programmer
IET Mediaworks, UC Davis
[EMAIL PROTECTED]
W: 530-754-5097


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to