-
1. Re: Seam, RichFaces and binding issues... rich:scrollableDataTable
billevans May 22, 2008 4:05 AM (in response to billevans)Here's a bit more info in case you need it:
The html:
<rich:scrollableDataTable binding="#{adminUsers.adminTableRF.table}" value="{#adminUsers.userList}"/>
The bean:
@Name("adminTableRF") @Scope(ScopeType.EVENT) public class AdminTableUsingRichFacesAction { public static final String ROW_VAR_NAME = "usr"; //Used for constructing columns private HtmlScrollableDataTable table = new HtmlScrollableDataTable(); public AdminTableUsingRichFacesAction() { table = new HtmlScrollableDataTable(); table.setVar(ROW_VAR_NAME); // for (UserColumn uc : UserColumn.values()) { UIColumn col = RichHelper.createUIColumn(FacesHelper.createHeader(uc.getColumnTitle(), null), FacesHelper.createUIOutput(ROW_VAR_NAME + "." + uc.binding, String.class, ROW_VAR_NAME + ".styleClass", String.class), uc.width); table.getChildren().add(col); } } public HtmlScrollableDataTable getTable() { return this.table; } }
The exception:
java.lang.IllegalArgumentException: Component mainForm:j_id59 not instance of org.richfaces.component.UIScrollableDataTable at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:94) at org.richfaces.renderkit.html.ScrollableDataTableBaseRenderer.encodeBegin(ScrollableDataTableBaseRenderer.java:870) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788) at javax.faces.component.UIData.encodeBegin(UIData.java:879) at org.ajax4jsf.component.UIDataAdaptor.encodeBegin(UIDataAdaptor.java:1185) at org.richfaces.component.UIScrollableDataTable.encodeBegin(UIScrollableDataTable.java:170) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:884) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892) at javax.faces.render.Renderer.encodeChildren(Renderer.java:137) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592) at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108) at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:189) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
-
2. Re: Seam, RichFaces and binding issues... rich:scrollableDataTable
mozyxl Aug 12, 2008 1:41 PM (in response to billevans)I'm having the same problem when trying to create an richfaces component dynamically.
XHTML:
<rich:panelBar xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:rich="http://richfaces.org/rich" binding="#{categoryPanelBar}" />
COMPONENT:
@Name("itemCategoryAction") public class ItemCategoryAction { @In(create=true) ShopManager shopManager; @In EntityManager entityManager; @Out(required = false) private List<ItemCategory> categories; @Out(required = false) HtmlPanelBar categoryPanelBar; @SuppressWarnings("unchecked") @Factory("categories") public void loadCategories() { categories = shopManager.getItemCategories(); } @Factory("categoryPanelBar") public void loadPanelBar() { if(categories == null) { loadCategories(); } HtmlPanelBar panelBar = new HtmlPanelBar(); for(ItemCategory category : categories) { HtmlPanelBarItem item = new HtmlPanelBarItem(); item.setLabel(category.getName()); panelBar.getChildren().add(item); } categoryPanelBar = panelBar; } }
ERROR:
java.lang.IllegalArgumentException: Component j_id11 not instance of org.richfaces.component.UIPanelBar
-
3. Re: Seam, RichFaces and binding issues... rich:scrollableDataTable
lobz Sep 15, 2008 5:52 PM (in response to billevans)Hi!
Any news about this issue? I get the same error with the PanelMenu component when I build it from java code.
-
4. Re: Seam, RichFaces and binding issues... rich:scrollableDataTable
okami Sep 19, 2008 4:19 PM (in response to billevans)Hi, I had the same issue, however looking into the RichFaces JSF components tag library I found that the binding must evaluate to javax.faces.component.UIComponent
hence, try sth like:
javax.faces.component.UIComponent talbe = new HtmlScrollableDataTable(); -
5. Re: Seam, RichFaces and binding issues... rich:scrollableDataTable
tamerg Sep 19, 2008 7:18 PM (in response to billevans) -
7. Re: Seam, RichFaces and binding issues... rich:scrollableDataTable
mickgiu.mickgiu.gmail.com Feb 20, 2009 3:59 PM (in response to billevans)I have the same problem, trying to create a DropDownMenu dinamically.
I was developing it withJboss developer studio 1
using seam 2 and richfaces 3.2 under jboss 4.2.2 and all works correctly.I migrated it to
Jboss developer studio 2
using seam 2.1.1 and jboss 5.0.0.
and i obtain this errorjava.lang.IllegalArgumentException: Component j_id11 not instance of org.richfaces.component.UI....
I read every post about this problem and tryed everything, but nothing.
Can sameone help me ?
Thanks in advance
Michele -
8. Re: Seam, RichFaces and binding issues... rich:scrollableDataTable
nchan Jul 15, 2009 10:50 PM (in response to billevans)Iam new to Seam and working with Richfaces for a while. Hope you guys got a solution for this. By this time you guys might have got an workaround atleast. Anyway I did tried the same thing and after google, I found out that you need to annotate your UIComponent with @In and @Out. It works !
Here is the code snip :
In your backing bean:
@Name("somename") @Scope(ScopeType.SESSION) public class DevicesAction { @In(required = false) @Out(required = false) private HtmlScrollableDataTable myScrollableDataTable; public HtmlScrollableDataTable getMyScrollableDataTable() { return myScrollableDataTable; } public void setMyScrollableDataTable(HtmlScrollableDataTable myScrollableDataTable) { this.myScrollableDataTable = myScrollableDataTable; } }
In Richfaces JSF:
<rich:scrollableDataTable id="someid" binding="#{myScrollableDataTable}" ..../>
Could any of the seam expert help me in understanding the myth/logic behind this behavior, please ?
-
9. Re: Seam, RichFaces and binding issues... rich:scrollableDataTable
nchan Jul 15, 2009 11:18 PM (in response to billevans)
Chandran Narasimhan wrote on Jul 15, 2009 22:50:
Iam new to Seam and working with Richfaces for a while. This is slightly a different issue.I found out that you need to annotate your UIComponent with @In and @Out to make the richfaces binding work. Why is that i need a injection tags, whereas in a non-seam environment you don't need one?
Here is the code snip :
In your backing bean:@Name("somename") @Scope(ScopeType.SESSION) public class DevicesAction { @In(required = false) @Out(required = false) private HtmlScrollableDataTable myScrollableDataTable; public HtmlScrollableDataTable getMyScrollableDataTable() { return myScrollableDataTable; } public void setMyScrollableDataTable(HtmlScrollableDataTable myScrollableDataTable) { this.myScrollableDataTable = myScrollableDataTable; } }
In Richfaces JSF:<rich:scrollableDataTable id="someid" binding="#{myScrollableDataTable}" ..../>
Could any of the seam expert help me in understanding the myth/logic behind this behavior, please ?Click HELP for text formatting instructions. Then edit this text and check the preview.