[jboss-user] [JBoss Seam] - Rendering buttons in a datatable fails

hubaer do-not-reply at jboss.com
Mon Mar 12 12:35:04 EDT 2007


Hi all,

I have a problem with the rendered attribute and buttons in a h:dataTable. I have my list of entries (as in the listing). If I click on the "Edit" button all is ok - I get the edit page. 

  | <h:form>
  |     <h:dataTable var="entry" value="#{entryList}" rendered="#{entryList.rowCount>0}">
  |      <h:column>
  |            <f:facet name="header">
  |                 <h:outputText value="Title"/>
  |            </f:facet>
  |            <h:outputText value="#{entry.title}"/>
  |      </h:column>
  |      <h:column>
  |            <f:facet name="header">
  |                  <h:outputText value="Status"/>
  |            </f:facet>
  |            <h:outputText value="#{entry.status}"/>
  |      </h:column>
  |      <h:column>
  |             <h:commandButton value="Edit" action="#{entryAction.edit(entry)}" />
  |       </h:column>
  |       </h:dataTable>
  |    </h:form>
  | 
        
Now I want to extend my table, that the button is only displayed if a status is set to a value allowing the editing of the entry.

I tried to put the rendered attribute to the h:commandButton like


  | <h:commandButton value="Edit" action="#{entryAction.edit(entry)}" rendered="#{entryAction.editable}"/>
  | 

than only the allowed entries get a "Edit" button. But if I clicked on the button the page is rerendered and the corresponding action is not executed.

After that I tried the s:button. Here the method is executed, but the parameter is null in my method.

Has someone any hints or could help me solving this problem?

Regards
Marco



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027246#4027246

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027246



More information about the jboss-user mailing list