0

What I have to do is to pass values fron wickets java code to javascript function using target.
For which I have use method to call javascript function from wickets java class using target.

My java code is:

target.addJavascript("show();");  

Html code. Scipt function

But it not calling javascript function - what shall i do?

2
  • 3
    First, you can check in the Wicket-Ajax-Debug window what's happening. If you still don't find the problem, don't hesitate to provide more details here. Jun 10, 2012 at 14:55
  • addJavascript() has been deprecated. Have you tried using appendJavascript() instead? Jun 11, 2012 at 14:30

1 Answer 1

0

If you wish to call some JS in a update event, you have to implements a boolean method called: "wantOnSelectionChangedNotifications()"

For example:

new DropDownChoice("drop"){

  @Override
        protected boolean wantOnSelectionChangedNotifications() {
            return true;
        }

  @Override
        protected void onUpdate(AjaxRequestTarget target) {
         target.appendJavaScript("put your JavaScript here");
   }

} 

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.