Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

commandButton/commandLink not working inside datatable

 
Ganesh Podaralla
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

My Facelets .xhtml is typically as below.

<h:form>

<h:dataTable value="#{bean.valueList}" var="value" rows="15">
<h:column>
<h:inputText id="text" value="#{value.text}" />
</h:column>
<h:column>
<h:commandButton value="Go" action="#{bean.action}" >
<f:setPropertyActionListener value="#{value}" target="#{bean.value}" />
</h:commandButton>
</h:column>
</h:datatable>
</h:form>

The rows are displayed along with the Go buttons properly. But when I click on "Go" button, the action method on the bean is not invoked. Also, the "value" property in the bean is not set. The commandButtons placed outside the datatable (and inside h:form) are invoked correctly. The bean is in request scope. Please let me know what could be the issue and the resolution using JSF/RichFaces.
 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need <a4j:keepAlive bean="#{bean}" />

my guess is you have the bean in request scope?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic