Re: Ajax DropDownChoice and null values

2009-10-09 Thread niaouli

Finally, I don't know why it didn't work. I had some problems with the
defaultFormProcessing. Now I only set this parameter to false if I don't
want to retrieve any form data on the server, and I do not get null values
in my models anymore.

-- 
View this message in context: 
http://www.nabble.com/Ajax-DropDownChoice-and-null-values-tp16473687p25816039.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Ajax DropDownChoice and null values

2009-09-01 Thread niaouli

Hello,

I have a problem with Ajax DropDownChoices and null values. I tried to make
this pseudo-code, as simple as possible :

select id=choice wicket:id=choice /
select id=subChoice wicket:id=subChoice /
OK 


final DropDownChoiceString choiceView = new
DropDownChoiceString(choice, new PropertyModelString(model, choice),
new ArrayListString(CHOICES.keySet()));

final DropDownChoiceInteger subChoiceView = new
DropDownChoiceInteger(subChoice, new PropertyModelInteger(model,
subChoice), CHOICES.get(choice));
subChoiceView.setOutputMarkupId(true);

choiceView.add(new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(AjaxRequestTarget target) {
subChoiceView.setChoices(CHOICES.get(choice));
target.addComponent(subChoiceView);
}
});

LinkVoid ok = new AjaxFallbackLinkVoid(ok) {
public void onClick(AjaxRequestTarget target) {
System.out.println(choice:  + model.choice);
System.out.println(subChoice:  + model.subChoice);
}
};


When I select values in the drop down choices and click OK, the choice value
is the right one, and the subChoice value is always 'null'. I really don't
know if it is a bug or my mistake.

Thanks for your advices.
-- 
View this message in context: 
http://www.nabble.com/Ajax-DropDownChoice-and-null-values-tp16473687p25235882.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Ajax DropDownChoice and null values

2008-04-03 Thread Java Programmer
I added onError when Required failed, now works - closed:
@Override
protected void onError(AjaxRequestTarget target, 
RuntimeException e) {
carPartsModel.setCarModel(null);
carPartsModel.setCarModelType(null);
carModelDDC.setChoices(Collections.EMPTY_LIST);
carModelDDC.setEnabled(false);
carModelTypeDDC.setEnabled(false);
target.addComponent(carModelDDC);
target.addComponent(carModelTypeDDC);
}

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