Hi,

Which version of Wicket do you use ?
Try with 'change' as event name, instead of 'onChange'.


On Mon, Jan 14, 2013 at 10:01 PM, shimin_q <smq...@hotmail.com> wrote:

> Hi,
>
> I have a DropDownChoice that I  implemented an
> AjxFormComponentUpdatingBehavior onUpdate() method.  I have been battling
> with a problem with its onUpdate() not being triggered/executed every time
> user selects a choice from the DropDownChoice.  In Firefox, it sometimes is
> triggered, sometime not; in IE9/Safari/Chrome, it's not triggered at all.
>
> Now I have another DropDownChoice with onUpdate() behavior implemented, it
> seems to work every time.  The only difference I can see is that this
> DropDownChoice is directly placed in a Form; while the one that does not
> work is placed in a table under a Form.
>
> The one that works:
>
> <form id="createMPForm" wicket:id="createMPForm">
>
>         <div data-role="fieldcontain" data-theme="b"
> wicket:id="profileTypeRow">
>
>                 <label for="profileType" class="select"
> wicket:id="profileTypeLabel">Profile Type:</label>
>                 <select name="profileType" id="profileType"
> wicket:id="type"
> data-theme="b">
>                         <option>default</option>
>                         <option>OXE</option>
>                         <option>OT</option>
>                 </select>
>         </div>
>
> The one that does not work some times:
>
> <form id="createForm" wicket:id="createForm">
> <div id="user">
>
>
>
>
>
>                  <label for="userType" wicket:id="userTypeLabel"
> class="requiredLabel">User Type</label>
>                  <select id="userType" name="userType"
> wicket:id="userType">
>                   <option>default</option>
>                    <option>OXE</option>
>                    <option>OT</option>
>                 </select>
>
>
> The java code for two DropDownChoice is similar, where userTypeBox is a
> DropDownChoice component:
>
>                 userTypeBox.add(new
> AjaxFormComponentUpdatingBehavior("onChange") {
>                         private static final long serialVersionUID = 1L;
>                         protected void onUpdate(AjaxRequestTarget target) {
>                                 resetFieldsPerUserType(target);
>                                 target.add(salutationRow);
>                                 target.add(firstNameRow);
>                                 target.add(lastNameRow);
>                                 target.add(metaProfileRow);
>
> Anyone can tell me if being directly under a Form or not would make the
> difference here?  Thanks!!
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-onUpdate-not-triggered-sometimes-tp4655361.html
> Sent from the Users forum 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
>
>


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

Reply via email to