You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Elam Daly <el...@gmail.com> on 2005/12/02 06:51:40 UTC
h:dataTable: Editable Options
Howdy all,
Using a 2 week old Subversion build.
I have a Result object that is stored in a bean and is bound to a
h:dataTable component.
My JSP code looks like this:
<h:dataTable value="#{AdminBean.results }" var="emp"
headerClass="dataHeader"
footerClass="footer"
styleClass="punches"
rowClasses="one,two"
cellpadding="5">
<h:column>
<f:facet name="header">
<h:outputText value="Date In" />
</f:facet>
<h:outputText value="#{emp.PINDATE}" rendered="#{not
emp.editable}"/>
<t:inputText rendered="#{emp.editable}" />
</h:column>
.
.
.
<h:column>
<f:facet name="header">
<h:outputText value="Edit" />
</f:facet>
<h:selectBooleanCheckbox value="#{ emp.editable}"
onclick="submit();"/>
</h:column>
</h:dataTable>
Now, when this page is first displayed both the outputText and inputText
tags are rendered, when only one or the other should be. If I select the
booleanCheckBox, then the page is submitted and everything looks normal.
Is there someway to set the editable property of a dataTable to a default
value? Shouldn't it be non editable by default?
Thanks,
Elam Daly
Re: h:dataTable: Editable Options
Posted by Mike Kienenberger <mk...@gmail.com>.
Elam,
That's really odd. I can't think of any reason why both would be
rendered unless #{emp.PINDATE}" or "#{not emp.editable} are somehow
changing the editable value!
On 12/2/05, Elam Daly <el...@gmail.com> wrote:
> Howdy all,
>
> Using a 2 week old Subversion build.
>
> I have a Result object that is stored in a bean and is bound to a
> h:dataTable component.
>
> My JSP code looks like this:
>
> <h:dataTable value="#{AdminBean.results }" var="emp"
> headerClass="dataHeader"
> footerClass="footer"
> styleClass="punches"
> rowClasses="one,two"
> cellpadding="5">
> <h:column>
> <f:facet name="header">
> <h:outputText value="Date In" />
> </f:facet>
> <h:outputText value="#{emp.PINDATE}" rendered="#{not
> emp.editable}"/>
> <t:inputText rendered="#{emp.editable}" />
> </h:column>
> .
> .
> .
> <h:column>
> <f:facet name="header">
> <h:outputText value="Edit" />
> </f:facet>
> <h:selectBooleanCheckbox value="#{ emp.editable}"
> onclick="submit();"/>
> </h:column>
> </h:dataTable>
>
>
> Now, when this page is first displayed both the outputText and inputText
> tags are rendered, when only one or the other should be. If I select the
> booleanCheckBox, then the page is submitted and everything looks normal.
>
> Is there someway to set the editable property of a dataTable to a default
> value? Shouldn't it be non editable by default?
>
> Thanks,
> Elam Daly
>