[JBoss Seam] - Seam Pros, Newbie needs help. DataTable
by indyJones
Seam: 2.0.0BETA1
JBoss: 4.2.0
Facelets
I am having problems with a very simple datatable.
Here is my code....
Bean
|
| @Name("usermanager")
| @Stateful
| @Scope(SESSION)
| @Restrict("#{identity.loggedIn}")
| public class UserManager implements UserManagerInterface {
|
| @In
| private User user;
|
| @In
| private Session inetworkDatabase;
|
| @Logger
| Log log;
|
| @DataModelSelection("users")
| @Out(required = false)
| private User selectedUser;
|
| @DataModel("users")
| private List<User> users;
|
| @Factory("users")
| public List<User> getUsers() {
|
| List<User> retUsers = null;
|
| try{
|
| if(user != null){
|
| Criteria criteria = inetworkDatabase.createCriteria(User.class);
|
| retUsers = criteria.list();
|
| }else{
|
| }
|
| }catch(Exception e){
|
| }
|
| return retUsers;
| }
|
| public void editUser(){
|
| log.info("**************************************** ");
|
| }
|
| @Remove
| public void destroy() { }
| }
|
|
XHTML
|
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:rich="http://richfaces.ajax4jsf.org/rich"
| xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
| template="layout/template.xhtml">
|
| <ui:define name="body">
|
| <a4j:form ajaxSubmit="true">
|
| <rich:dataTable id="users"
| rows="10"
| onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
| onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
| var="usr"
| value="#{users}">
|
| <f:facet name="header">
| <rich:columnGroup>
| <rich:column><h:outputText value="Edit User" /></rich:column>
| <rich:column><h:outputText value="User Name" /></rich:column>
| <rich:column><h:outputText value="First Name" /></rich:column>
| <rich:column><h:outputText value="Middle Name" /></rich:column>
| <rich:column><h:outputText value="Last Name" /></rich:column>
| </rich:columnGroup>
| </f:facet>
|
| <rich:column>
| <s:link action="#{usermanager.editUser}" value="#{usr.id}"/>
| </rich:column>
|
| <rich:column><h:outputText value="#{usr.username}" /></rich:column>
| <rich:column><h:outputText value="#{usr.firstname}" /></rich:column>
| <rich:column><h:outputText value="#{usr.middlename}" /></rich:column>
| <rich:column><h:outputText value="#{usr.lastname}" /></rich:column>
|
| </rich:dataTable>
|
| <rich:spacer height="20" />
|
| <rich:datascroller for="users" maxPages="50" />
|
| <rich:tabPanel switchType="client">
|
| <rich:tab label="Information">
|
| <h:panelGrid columns="2">
|
| <h:outputText value="First Name" />
| <h:inputText value="x" id="fname" />
|
| <h:outputText value="Middle Name" />
| <h:inputText value="b" id="mname" />
|
| <h:outputText value="Last Name" />
| <h:inputText value="c" id="lname" />
|
| </h:panelGrid>
|
| </rich:tab>
|
| <rich:tab label="Roles">
|
| this is where the users roles are listed
|
| </rich:tab>
|
| </rich:tabPanel>
|
| </a4j:form>
|
| </ui:define>
|
| </ui:composition>
|
|
Every thing is ok at startup...
But when i click on the slink, i get this...
|
| 14:56:56,515 ERROR [SeamPhaseListener] uncaught exception
| javax.el.ELException: javax.ejb.EJBException: java.lang.ClassCastException: java.util.ArrayList cannot be cast to javax.faces.model.DataModel
|
|
Why is that?
I know this is a pretty easy question, my apologies, but any help would be really appreciated...
Thanks
indy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078159#4078159
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078159
18Â years, 8Â months
[JBoss Portal] - Re: Installation of jbp 2.6
by chris.laprunï¼ jboss.com
Hi Christophe,
"dd_la_frime" wrote :
| I launched jboss and baamm !
| I got a ClassNotFoundException for org.jboss.varia.scheduler.Scheduler. I started to search and found the package 20 minutes later (scheduler-plugin.jar). It's not written in the documentation !
|
It is not indicated in the documentation because this shouldn't happen! The default AS configuration (as found in server/default) contains scheduler-plugin.jar in the lib directory. However, since you installed the EJB3 module, you must have used the JEMS installer and IIRC, there were some issues with using the installer and Portal. As I am not familiar with the JEMS installer, I'll try to get an answer from someone who knows more about it than I do.
"dd_la_frime" wrote :
| So I decided to login with admin/admin or user/user.
| Everytime I try to submit the form I've got a "null" just above the form. I created a new account just to test it. The creation worked fine as I can see the datas in the DB. Again I try to login with this new account and same thing always this "null" above the form. So my portal is working fine but I can't login ;o). What a joke !!!
This is not normal either... :) Do you see any messages in the console that could help us figure out what's going on?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078157#4078157
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078157
18Â years, 8Â months