myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rolf Kulemann <>
Subject Re: [Myfaces-develop] New feature suggestion : Edit mode
Date Wed, 04 May 2005 16:09:01 GMT
On Wed, 2005-05-04 at 17:31, Sean Schofield wrote:
> The editable attribute might be a little bit of overkill.  Yes for
> text it would be nice to alternate between HTML text or inputText but
> that could also be achieved using the rendered attribute.
> <h:inputText value="#{foo.value}" rendered="#{foo.isEditable}"/>
> <h:outputText value="#{foo.value}" rendered="#{!foo.isEditable}">
> So yes you type two lines of code but I would argue that the above is
> more obvious "at a glance."
> Is there an argument against my approach besides the extra line of code?

IMHO, you are right. The proposal to dynamically switch the semantics of
an inputText to an outputText is a bit non-straightforward, if I may say
that. Myfaces should try to go along with the JSF spec semantics where
possible, well, most of the extensions are very useful, so do not get me

But I understand the need for such kind of dynamics. The idea of Sean
sounds a bit more "straight forward" to me.

Another alternative could be to collapse the semantics of input- and
outputField into a new component lets say a x:dataField, which is a more
generic component to display data:

<x:dataField renderType="input|output" ..../>

or for more programming convenience

<x:dataField isInput="true|false" ..../> so someone could bind a boolean
bean property to @isInput.

My two Euro cents.

Ah, beside this, I'm from Cocoon land and we solve such problems by just
adding an xslt to the content pipeline to in order to dynamically
transform fields etc. CForms ist just great with that. However, that is
not the point here :)
Rolf Kulemann

View raw message