You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by dpmihai <dp...@yahoo.com> on 2012/04/09 14:18:54 UTC

Wicket 1.5 Wizard and AjaxFormComponentUpdatingBehavior for a DropDownChoice

I have an application in wicket 1.4 with a wizard. Inside a WizardStep I have
a simple DropDownChoice with an AjaxFormComponentUpdatingBehavior where
inside onUpdate method i get the model object

     protected void onUpdate(AjaxRequestTarget target) {                  	
                String type = choice.getModelObject();
                 ... 
     }
This works well.

But migrating to 1.5.5 makes this not working. The method is entered but the
model is always null.


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Wizard-and-AjaxFormComponentUpdatingBehavior-for-a-DropDownChoice-tp4542617p4542617.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Wicket 1.5 Wizard and AjaxFormComponentUpdatingBehavior for a DropDownChoice

Posted by dpmihai <dp...@yahoo.com>.
Did anyone see this?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Wizard-and-AjaxFormComponentUpdatingBehavior-for-a-DropDownChoice-tp4542617p4542632.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Wicket 1.5 Wizard and AjaxFormComponentUpdatingBehavior for a DropDownChoice

Posted by Martin Grigorov <mg...@apache.org>.
On Mon, Apr 9, 2012 at 3:07 PM, dpmihai <dp...@yahoo.com> wrote:
> The problem was also the id inside html components. When we have both
> wicket:id and id, in 1.5.5 id is not overwritten and no events are triggered
> for that component.
>
> I wonder why this was not put inside the migration guide to 1.5.

https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-Component.getMarkupId%28%29implementationchanged

>
> Could be possible to get some warning in case we have something like this:
>
> <label wicket:id="type" for="choice">[]</label>
> <select wicket:id="choice" name="choice" id="choice"/>
>
> and tell user that it's choice component in this case would not receive any
> events?

This markup is OK.
I guess you put it in a repeater and that's why you end up with
several <select>s with the same id. And later when submitting just the
first sends its value.

Just remove the 'id' attribute. Wicket will create a unique one for
you automatically.
Provide 'id' only when you want to avoid using
Component.setMarkupId("somethingStable") in .java

>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Wizard-and-AjaxFormComponentUpdatingBehavior-for-a-DropDownChoice-tp4542617p4542703.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: Wicket 1.5 Wizard and AjaxFormComponentUpdatingBehavior for a DropDownChoice

Posted by dpmihai <dp...@yahoo.com>.
The problem was also the id inside html components. When we have both
wicket:id and id, in 1.5.5 id is not overwritten and no events are triggered
for that component.

I wonder why this was not put inside the migration guide to 1.5.

Could be possible to get some warning in case we have something like this:

<label wicket:id="type" for="choice">[]</label>
<select wicket:id="choice" name="choice" id="choice"/>

and tell user that it's choice component in this case would not receive any
events?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Wizard-and-AjaxFormComponentUpdatingBehavior-for-a-DropDownChoice-tp4542617p4542703.html
Sent from the Users forum mailing list archive at Nabble.com.

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