I never used onConfigure() but conform it's API is called once per request
on a component before is about to be rendered.

Thus your original code:
@Override
public void onConfigure() {
    setVisible(isOngoingService());
}

Is only called once if I'm not mistaken.

Whereas you want the field to toggle so it must be called more than once.
Thus onUpdate() would do the job you want:
@Override
protected void onUpdate(AjaxRequestTarget target) {
   provisionDefaultPeriod.setVisible(isOngoingService());
   target.add(provisionDefaultPeriod);
}

I might be mistaken, but since Wicket is open source code feel free to poke
around it and understand it better.


On Tue, May 14, 2013 at 5:18 AM, Simon B <[email protected]> wrote:

> Hi Paul,
>
> I was mistaken. I apologise.
>
> Previously I hadn't completely removed the onConfigure method from the form
> component  and simply called the setVisible in the onUpdate method of the
> AjaxFormComponentUpdatingBehavior("onchange") / AFCUB("onchange").
>
> So your suggestion worked!
>
> Thank you very much.
>
> I would still really like to understand why the onConfigure way of setting
> the visibility of the component didn't work, does anybody have any idea
> about this?
>
> Cheers
>
> Simon
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/form-processing-adding-new-inputs-with-an-ajax-onupdate-tp4658758p4658779.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to