if Condition in dataTable

Hi,

i have a Data Table element, in that i have a textarea, i want to conditionally disable it based on some condition.. How can i do that ?

<t:dataTable rowIndexVar="rowIndex" id="curEmployees" value="#{user.state.commenttypes}" var="comments">

<t:column id="ab">

<h:form id="ta1"><h:inputTextarea id="comment11" value="Sample Data" rows="5" cols="30"></h:inputTextarea>

</h:form>

</t:column>

in the list returned by user.state.commenttypes i have a String datatype field called isEditable (Y / N). i want to decide based on this field.

Thanks in Advance.

[906 byte] By [narayanasgsa] at [2007-11-15]
# 1

You can use the 'rendered' or the 'disabled' attributes of the h:inputTextarea to hide or disable it. It accepts an EL expression with a boolean outcome.

Some examples:<h:inputTextarea disabled="#{myBean.booleanValue}" />

<h:inputTextarea disabled="#{myBean.intValue > 0}" />

<h:inputTextarea disabled="#{myBean.stringValue == 'someValue'}" />

<h:inputTextarea disabled="#{myBean.objectValue != null}" />

<h:inputTextarea disabled="#{!myBean.booleanValue && myBean.intValue != 1}" />

<h:inputTextarea disabled="#{empty myBean.collectionValue || myBean.stringValue != 'anotherValue'}" />

BalusCa at 2007-7-12 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 2
this is really fentastic. Thank You. it is working fine....
narayanasgsa at 2007-7-12 > top of java,Enterprise & Remote Computing,Web Tier APIs...