need help: jsf problem of inputText in a dataTable

J

joneepenk

i put inputText in a dataTable, it works normal for display bean
property.
but i cannot get the modified value of inputText,that is,the change of
inputText was disappeared after submit.
i want know why this happend. any help will be appreciated.
ps: jsf is so wierd in my use of it, i am considering substitute jsf
with struts2.
jsf code as follow, in whitch "name" is a simple pojo, and
"tableData.names" simple return the array of "name" pojos:
<h:form>
<h:dataTable value="#{tableData.names}" var="name">
<h:column>
<f:facet name="header">
<h:eek:utputText value="edit"/>
</h:column>
<h:column>
<f:facet name="header">
<h:eek:utputText value="last"/>
</f:facet>
<h:inputText value="#{name.last}" rendered="#{name.editable}"/>
<h:eek:utputText value="#{name.last}" rendered="#{not name.editable}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:eek:utputText value="first"/>
</f:facet>
</h:column>
</h:dataTable>
</h:form>
 
S

SadRed

i put inputText in a dataTable, it works normal for display bean
property.
but i cannot get the modified value of inputText,that is,the change of
inputText was disappeared after submit.
i want know why this happend. any help will be appreciated.
ps: jsf is so wierd in my use of it, i am considering substitute jsf
with struts2.
jsf code as follow, in whitch "name" is a simple pojo, and
"tableData.names" simple return the array of "name" pojos:
<h:form>
<h:dataTable value="#{tableData.names}" var="name">
<h:column>
<f:facet name="header">
<h:eek:utputText value="edit"/>
</f:facet>
<h:selectBooleanCheckbox value="#{name.editable}" onclick="submit()"/

</h:column>
<h:column>
<f:facet name="header">
<h:eek:utputText value="last"/>
</f:facet>
<h:inputText value="#{name.last}" rendered="#{name.editable}"/>
<h:eek:utputText value="#{name.last}" rendered="#{not name.editable}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:eek:utputText value="first"/>
</f:facet>
<h:inputText value="#{name.first}" rendered="#{name.editable}"/>
<h:eek:utputText value="#{name.first}" rendered="#{not name.editable}"/

</h:column>
</h:dataTable>
</h:form>

immediate="true"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top