Hi Erik,

I used your solution and it works great for ff, while ie seem to have
problems with it. Have you run it also in ie?

Thanks,
  Itay



Erik van Oosten wrote:
> 
> I just finished an experiment with something like that. Its still ugly
> and very static, but here is my code.
> 
> In the HTML header the function you can call from Flash:
> function(someValue) {
>     var inputEl = document.getElementById('anchor8');
>     inputEl.value = someValue;
>     eval(inputEl.getAttribute('onclick'));
> }
> 
> Somewhere in the page:
> <form wicket:id="ajaxForm" style="display: none;"><input
> wicket:id="myField" type="hidden" value=""/></form>
> 
> Note that 'anchor8', the Wicket generated id of the input element, still
> needs te be made dynamic. Not sure how yet.
> 
> 
> The code:
>         Form form = new Form("ajaxForm");
>         add(form);
>         final HiddenField myField = new HiddenField("myField", new
> Model(), String.class);
>         form.add(myField);
>         myField.add(new AjaxFormSubmitBehavior("onclick") {
>             @Override
>             protected void onError(AjaxRequestTarget target) {
>                 throw new RuntimeException("foutje");  // not sure what
> to do here
>             }
> 
>             @Override
>             protected void onSubmit(AjaxRequestTarget target) {
>                 String myValue = (String) myField.getConvertedInput();
>                 processAjaxRequest(target, myValue);
>             }
>         });
> 
> Improvements are very welcome.
> 
> Regards,
>     Erik.
> 
> 
> 
> Sébastien Piller wrote:
>> Hello guys,
>>
>> I've a little question about the javascript and wicket. I need to
>> update some models on server side using javascript (in fact, I need to
>> update it from a flash object, and that's why I use js).
>>
>> But I have no idea about how to do this... I know how to call a JS
>> function from flash, but I don't know how to update a wicket model
>> using a javascript/ajax call.
>>
>> Has anybody some hint about that?
>>
>> Thanks you
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Javascript-call-to-wicket-tp14685384p21035640.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to