[jboss-user] [JBoss Seam] - Null value sent by s:link in dataTable

chawax do-not-reply at jboss.com
Fri Jul 27 10:20:37 EDT 2007


Hi, 

I have a problem when using dataTable tag, I think it's a newbie error but I can't find it ...

What I want :
- A list of employees
- A link to go to a detailed page of the employee

To do this, I have this JSF page :

<f:view>
  |  <div class="section">
  | 	<h:outputText value="Aucun employé" rendered="#{employes != null and employes.rowCount==0}"/>
  | 	<h:dataTable id="employes" value="#{employes}" var="emp" rendered="#{employes.rowCount>0}">
  | 		<h:column>
  | 			<f:facet name="header">ID</f:facet>
  | 			#{emp.id}
  | 		</h:column>
  | 		<h:column>
  | 			<f:facet name="header">Nom</f:facet>
  | 			#{emp.nom}
  | 		</h:column>
  | 		<h:column>
  | 			<f:facet name="header">Prénom</f:facet>
  | 			#{emp.prenom}
  | 		</h:column>
  | 		<h:column>
  | 			<f:facet name="header">Action</f:facet>
  | 			<s:link id="viewEmploye" value="Voir" action="#{employeCrud.selectEmploye(emp)}"/>
  | 		</h:column>
  | 	</h:dataTable>
  | </div>
  | </f:view>
  | 

Here's the method selectEmploye in component employeCrud (CONVERSATION scope) :

    /**
  |      * 
  |      */
  |     public void selectEmploye(fr.horoquartz.t4.core.employe.VOEmploye selectedEmploye)
  |     {
  |         if (selectedEmploye == null)
  |         {
  |             throw new IllegalArgumentException(
  |                 "fr.horoquartz.t4.gui.employe.EmployeCrudActionBean.selectEmploye(fr.horoquartz.t4.core.employe.VOEmploye selectedEmploye) - 'selectedEmploye' can not be null");
  |         }
  |         try
  |         {
  |             this.handleSelectEmploye(selectedEmploye);
  |         }
  |         catch (Throwable th)
  |         {
  |             throw new fr.horoquartz.t4.gui.employe.EmployeCrudActionException(
  |                 "Error performing 'fr.horoquartz.t4.gui.employe.EmployeCrudAction.selectEmploye(fr.horoquartz.t4.core.employe.VOEmploye selectedEmploye)' --> " + th,
  |                 th);
  |         }
  |     }
  | 

The list of employees works, but when I click on the action link to select an employee, the selectedEmploye parameter is null !

What am I doing wrong ?

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

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




More information about the jboss-user mailing list