Usually, you want the disable attribute to not show up at when the tag
is /not/ disabled. You can do this by not putting the attribute in
your markup (<input type="text" wicket:id="foo" value="bar" />),
provide the second AttributeModifier argument 'true' (so attributes
will be added when they do not exist yet), and - important - let your
replacement model return null when the component is not enabled. If
the replacement model returns null, the attribute modifier will do
nothing, which is what you want in this case.
Eelco
On 9/13/05, Ingram Chen <[EMAIL PROTECTED]> wrote:
> It works, Thank your help !
>
> It is great if API provides a convenient method like setDisabled(boolean)
> for all form components
> instead of creating 3 object likes new AttributeModifier("disable", true,
> new Model("disable")))
>
>
>
>
> On 9/13/05, Phil Kulak <[EMAIL PROTECTED]> wrote:
> > add(new TextField("tf")
> > .add(new AttributeModifier("disable", true, new Model("disable"))));
> >
> > Is that what you're looking for? I don't have to API by me, but that
> > should be close.
> >
> > On 9/12/05, Ingram Chen <[EMAIL PROTECTED]> wrote:
> > > Is there any way to disable form component in java code ?
> > >
> > > <input type="text" disable="disable" />
> > >
> > > --
> > > Ingram Chen
> > > Java [EMAIL PROTECTED]
> > > Institue of BioMedical Sciences Academia Sinica Taiwan
> > > blog:
> http://www.javaworld.com.tw/roller/page/ingramchen
> >
> >
> > -------------------------------------------------------
> > SF.Net email is Sponsored by the Better Software Conference & EXPO
> > September 19-22, 2005 * San Francisco, CA * Development Lifecycle
> Practices
> > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
>
> --
> Ingram Chen
> Java [EMAIL PROTECTED]
> Institue of BioMedical Sciences Academia Sinica Taiwan
> blog: http://www.javaworld.com.tw/roller/page/ingramchen
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user