On Mon, July 02, 2007, Francois Armand wrote:

> I'm not sure I have correctly understood your concern, so excuse me if I 
> answer to something else ;)
> When you have a component with parameter, you have two way to specify it 
> the actual parameter value :
> - in the template, with "paramname=bindingtype:value" ;
> - in the java code, thanks to "@Component(parameters =..." tag.

Yes, this is how I found it in the documentation. However I'd
like to be able to do something like:

| @Component(id="myInput")
| private TextField _myInput;

[...]

| _myInput.setDisabled(true);

Why this? I try to create encapsulate frequently-needed units
from my templates as components. E.g. you may want to use the
same HTML template (plus page class) for creating a user as
well as for modifying a user. Depending on the application
there may be some differences between the two applications of
the component, i.e. when modifying a user some properties are
read-only. 

Of course I can accomplish this with the code you posted, but 
this requires me to add the appropriate "parameters" annotation,
"paramname=bindingtype:value" plus a getter and setter for each
input I want to handle. Since the code already is pretty lengthy
anyway this will make it even messier.  

Doing this by a single setter per input at beginRender() would
be much simpler and readable.

Cheers,

Martin

-- 
----------- / http://herbert.the-little-red-haired-girl.org / -------------
=+= 
Was ist der Unterschied zwischen einer Bratsche und einer Waschmaschine?
Die Waschmaschine vibriert, kommt erst am Ende ins Schleudern, und was 
rauskommt, ist sauber.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to