Hi,

TextField field1 = new ...
final TextField field2 = ...

field1.add(new AjaxFormComponentUpdatingBehavior("onchange") {
  onUpdate(target) {
    buildingNr = getComponent.getModelObject();
    if (buildingNr == ...) {
       field2.setModelObject(newValue)
       target.add(field2)
    }
  }
})

On Thu, Apr 19, 2012 at 3:02 PM, Tom Eugelink <t...@tbee.org> wrote:
>
> Again a situation where I'm missing the background because of my newbie
> status.
>
> I have two textfields, one for the buildingnr, the second for the roomnr
> within that building. Both have a label to the right with a description.
> All four components (2x TextField, 2x Label) are within a single
> WebMarkupContainer and the two textfields each have a
> AjaxFormComponentUpdatingBehavior associated.
> This basic setup works.
>
> The next step is that once the buildnr number is changed, I may want to
> change the roomnr (clear it if it doesn't exist) or the room label as well.
> So the ajax event on the buildingnr textfield also influences the roomnr
> fields. This does not work as expected: I cannot set the value of the second
> TextField.
>
> What would be the best way to do this?
>
> Tom
>
>
>
>
>
> ---------------------------------------------------------------------
> 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

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

Reply via email to