Eh, I'm sorry, here are some more details:
"injected" means 'DataModelSelection'
my 'DataModelSelection' object code (the intersting part)
| @Scope(ScopeType.EVENT)
| @Name("role")
|
| @Table(name="ROLE")
| @Entity
| public class Role implements Serializable {
| private long roleId;
| private String name;
| private String description;
|
| public void setRoleId(long roleId) {
| this.roleId = roleId;
| }
|
| @Id
| @GeneratedValue(strategy = GenerationType.IDENTITY)
| @Column(name="ROLE_ID")
| public long getRoleId() {
| return roleId;
| }
|
| public void setName(String name) {
| this.name = name;
| }
|
| @Length(min=3, max=40) @NotNull //seam
| @Column(name="NAME", nullable=false)
| public String getName() {
| return name;
| }
|
| ....
|
| }
|
|
My ejb3 used for actions:
| @Stateless()
| @Name("roleManager")
| @Interceptors( {org.jboss.seam.ejb.SeamInterceptor.class} )
| public class RoleBean implements RoleManagerLocal,RoleManagerRemote {
|
| //For insertions
| @In(create=true) @Valid
| Role role;
|
| @DataModel
| private List<Role> roleList;
| @DataModelSelection
| @Out(required=false)
| private Role selectedRole;
|
| /**
| * Injected entity manager
| */
| //@PersistenceContext
| @PersistenceContext
| public EntityManager em;
|
| ....
|
|
here's the 'listRoles.xhtml' with the datatable of the DataModel (roleList)
with the actions edit/delete I explained in the first post,
| <t:dataTable id="rolesDataTableList"
| styleClass="scrollerTable"
| headerClass="standardTable_Header"
| footerClass="standardTable_Header"
| rowClasses="standardTable_Row1,standardTable_Row2"
|
columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
| var="role"
| value="#{roleList}"
| preserveDataModel="false"
| rows="10"
| >
| <h:column>
| <f:facet name="header">
| <h:outputText value="#{msgs.id}" />
| </f:facet>
| <h:outputText value="#{role.roleId}" />
| </h:column>
|
| <h:column>
| <f:facet name="header">
| <h:outputText value="#{msgs.name}" />
| </f:facet>
| <h:outputText value="#{role.name}" />
| </h:column>
|
| <h:column>
| <f:facet name="header">
| <h:outputText value="#{msgs.description}" />
| </f:facet>
| <h:outputText value="#{role.description}" />
| </h:column>
| <h:column>
| <f:facet name="header">
| <h:outputText value="#{msgs.actions}" />
| </f:facet>
| <f:facet name="header"><h:outputText
value="#{msgs.actions}" /></f:facet>
| <h:outputLink value="roleEdit.seam">Edit
| <f:param name="roleId"
value="#{role.roleId}"/>
| </h:outputLink>
| </h:column>
| </t:dataTable>
|
clicking on 'edit' link redirects to the page but 'role' seems to be empty.
Thanks a lot.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3954814#3954814
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3954814
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user