OnChangeAjaxBehavior applies only to AbstractTextComponent. Such
components are: TextField and TextArea.
HiddenField is not!

You may try with a AjaxFormComponentUpdatingBehavior instead.

changed.add(new AjaxFormComponentUpdatingBehavior("myevent") {...});

and in JavaScript:
function change(){
        var change = document.forms[0].changed.value;
                if(change != true) {
                        document.forms[0].changed.value = true;
                        document.forms[0].changed.myevent();
                }
        }
}



On Fri, 2008-09-05 at 09:59 -0700, liza6218 wrote:
> Hi,
> 
> I'm trying to trigger OnChangeAjaxBehavior on an HiddenField (or TextField)
> change from client side javascript.
> 
> Here is the code in html:
> 
>       function change(){
>               var change = document.forms[0].changed.value;
>               if(change != true) {
>                       document.forms[0].changed.value = true;
>               }
>       }
>  
>          <input type="hiden" wicket:id="changed"/>
> 
> in wicket:
> 
>         Form form = new Form("form");
>         add(form);
> 
>         final HidenField changed= new HidenField ("changed");
>         form.add(HidenField);
> 
>         final Label label = new Label("selectedValue");
>         label.setOutputMarkupId(true);
>         form.add(label);
> 
>         OnChangeAjaxBehavior onChangeAjaxBehavior = new
> OnChangeAjaxBehavior() {
>             @Override
>             protected void onUpdate(AjaxRequestTarget target) {
>                 target.addComponent(label);
>                 ....
>             }
>         };
>         changed.add(onChangeAjaxBehavior);
> 
> 
> Any help will be very much appreciated. 
> 
> - Lisa


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to