[jboss-user] [JBoss Seam] - Problem with el parameter in dataTaqble
amitev
do-not-reply at jboss.com
Wed Jun 27 03:02:21 EDT 2007
Hi all! I have the following code:
ejb for populating the dataTable
| @Stateful
| @Name("projectSearch")
| public class ProjectSearchBean implements com.amitev.bts.ejb.ProjectSearchLocal {
|
| @PersistenceContext
| private EntityManager em;
|
| @DataModel
| private List<Project> projects;
|
| @Factory("projects")
| @SuppressWarnings("unchecked")
| public void retrieveProjects() {
| projects = em.createQuery("from Project").getResultList();
| }
| ..........
|
The web page with the dataTable:
| <h:dataTable var="proj" value="#{projects}">
| <h:column>
| <s:link value="#{proj.name}" action="#{projectBrowse.selectProject(proj)}" />
| </h:column>
| </h:dataTable>
|
And the projectBrowse bean
| @Stateful
| @Name("projectBrowse")
| public class ProjectBrowseBean implements com.amitev.bts.ejb.ProjectConversationLocal {
|
| @PersistenceContext(type=PersistenceContextType.EXTENDED)
| private EntityManager em;
|
| @In(required=false) @Out
| private Project project;
|
| private Issue issue;
|
| @Begin
| public void selectProject(Project selectedProject) {
| System.out.println("selectedProject: " + (selectedProject==null));
| }
| ....
|
But when i click on the link in the dataTable, null is passed to the selectProject method. The url looks like this:
.../project/list.jsf?actionMethod=pages%2Fproject%2Flist.xhtml%3AprojectBrowse.selectProject%28proj%29&cid=2&dataModelSelection=proj%3Aprojects%5B0%5D
Idea why null is passed to the action method. I saw this code in seam 1.2.1 booking demo so i suppose it has to work.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057978#4057978
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057978
More information about the jboss-user
mailing list