Thank you so much for your reply. I tried using getCallbackScript on my
dropdown box. But it is never been called and also the fetch value on the
wicket side returns null for the dropdown box.
Not sure where I am doing wrong. Please suggest.
My code is as below..
/****************DropdownChoice**********/
final DropDownChoice<String> typeOption=new DropDownChoice<String>("type",
list){
private static final long serialVersionUID = 1L;
@Override
protected CharSequence getDefaultChoice(Object
selected) {
return "<option value=\"\">--</option>";
}
protected boolean
wantOnSelectionChangedNotifications() {
return true;
}
};
/*********adding to the form and setting outputmarkupid to true
form.add(typeOption.setRequired(true).setOutputMarkupId(true));
/****adding AbstractDefaultAjaxBehavior to the above dropdownchoice ****/
typeOption.add(new AbstractDefaultAjaxBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void respond(AjaxRequestTarget target) {
// TODO Auto-generated method stub
System.out.println("this is not getting
printed");
}
@Override
protected CharSequence getCallbackScript(boolean
onlyTargetActivePage)
{
System.out.println("not getting printed");
return generateCallbackScript("wicketAjaxGet('" +
getCallbackUrl(onlyTargetActivePage) +
"&mawbTypeDataOptionValue='+$Wicket.$("+mawbTypeDataOption.getMarkupId()+").value"
+
");");
}
});
final TextField<String> nameTf = new TextField<String>("name");
form.add(nameTf.setConvertEmptyInputStringToNull(false).setOutputMarkupId(true));
//**************trying to access ddc value from onBlur of the
textfield**********/
nameTf.add(new AjaxEventBehavior("onBlur") {
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(AjaxRequestTarget target) {
nameTf.setModelObject("");
Request request =
RequestCycle.get().getRequest();
String ddcValue = request.getParameter
("mawbTypeDataOptionValue");
System.out.println("this always prints null
"++ddcValue);
nameTf .modelChanged();
target.addComponent(nameTf);
target.addComponent(feedbackPanel);
}
});
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Submitting-a-component-value-on-a-ajax-call-of-a-different-component-tp2264940p2268754.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]