if you add it yourself in the markup then yes wicket will not remove it.
the same goes for enabled/disabled.
readonly only works for text components if i am not mistaken so doing at
component or formcomponent
level is a waste if you ask me.
what is wrong with an attribute modifier doing it? (and nothing in the
markup)
I think you are hitting the stupid boolean of the normal AttributeModifier
that is default false when you use it
with this constructor:new AttributeModifier("readonly", new
Model("readonly"))
then yes if it isnt in the markup it won't be added. use the
SimpleAttributeModifier for this.
in 2.0 you should be able to do:
component.getAttributes().set("readonly","readonly");
or
component.getAttributes().remove("readonly");
johan
On 12/14/06, Carfield Yim <[EMAIL PROTECTED]> wrote:
For Wicket 1.3, look like this is not working, once I add
[readonly=""] at the markup the field is readonly for sure.
Just wonder can I Programmatically set readonly property of form
component at wicket 1.3?
On 11/21/06, Otan <[EMAIL PROTECTED]> wrote:
> I'm using Wicket 2.0
>
> I can make a TextField readonly by doing this.
> tf.add(new AttributeModifier("readonly", new Model("readonly")));
> with this markup
> <input wicket:id="username" name="un" type="text" readonly="" />
>
> Does Wicket provides a method that make me do something like this
> to a form component?
> tf.setReadOnly(false);
>
> just like how it's easy in Wicket to setEnabled() a component.
>
>
>
-------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
your
> opinions on IT & business topics through brief surveys - and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user