On 11/16/2011 10:38 PM, Andrea Del Bene wrote:
> Are you referring to the example from book "Apache-Wicket-Cookbook",
> page n°34? If so, how do you populate the list of C? Maybe you should
> not set to null B model when you change value in A.
> If you can try to give an example of values from A,B and C.

I solved using Ajax.
In onUpdate() of AjaxFormComponentUpdatingBehavior of A, I add both
components (B and C) to the target.

thanks for the help

A

>
>
> On 11/16/2011 07:33 PM, Alberto wrote:
>> On 11/16/2011 06:06 PM, Andrea Del Bene wrote:
>>> Hi,
>>>
>>> can you elaborate a little bit more what behavior you want to achieve?
>>> I mean, C becomes empty because  A#onSelectionChanged sets its model
>>> to null. This should not be strange.
>> Yes, sounds obvious to me too. But I found an examples with 2
>> dropdownchoice where in onSelectionChanged() of the first one is set to
>> null the model of the second one.
>> For two choices works well.
>> Maybe is a wrong pattern, but I not found anything useful.
>> Do you have other solutions?
>>
>> A
>>
>>>> I have a form with with 3 choice components:
>>>>
>>>> A) DropDownChoice
>>>> B) DropDownChoice
>>>> C) ListMultipleChoice
>>>>
>>>> The values of B depend on selected value of A.
>>>> The values of C depend on selected values of A and B
>>>>
>>>> I override the wantOnSelectionChangedNotifications() and
>>>> onSelectionChanged() methods of A and B.
>>>>
>>>> A#onSelectionChanged
>>>> @Override
>>>> protected void onSelectionChanged(IntegerSelectChoice newSelection) {
>>>>         super.onSelectionChanged(newSelection);
>>>>         SearchForm.this.getModelObject().setInstrument(null);
>>>>         SearchForm.this.getModelObject().setParams(null);
>>>> }
>>>>
>>>> B#onSelectionChanged
>>>> @Override
>>>> protected void onSelectionChanged(IntegerSelectChoice newSelection) {
>>>>         super.onSelectionChanged(newSelection);
>>>>         SearchForm.this.getModelObject().setParams(null);
>>>> }
>>>>
>>>> In A I set to null the model value of both B and C.
>>>> In B I set to null the model value only of B.
>>>>
>>>> This code works only on the startup of the form. When I change the
>>>> value in A the list of C become empty. I have to change the value of
>>>> B to fill C.
>>>> http://www.corriere.it/index.shtml?refresh_ce
>>>> How can I manage this?
>>>>
>>>> A
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org


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

Reply via email to