-
1. Re: componentState of ExtendedDataTable
ilya_shaikovsky Feb 4, 2009 6:38 AM (in response to nimo22)use tableState and explore please API docs for ExtendedDataTableState class. You should bind the table state to the object of this class.
-
2. Re: componentState of ExtendedDataTable
nimo22 Feb 4, 2009 7:15 AM (in response to nimo22)I know the ExtendedDataTableState-API and the HtmlExtendedDataTable.
I want to make use of the method .getTableState of HtmlExtendedDataTable or vice versa .getExtendedDataTableState of ExtendedDataTableState.You should bind the table state to the object of this class.
Yes, I know. Have done that and it works.
But my Problem is described as the topic above, I want to have access to my HtmlExtendedDataTable but have a class-cast-ex even I have the right class (I do not want to use binding-property!):// throws class cast ex HtmlExtendedDataTable myDT = (HtmlExtendedDataTable) view.findComponent(":form:myDataTable");
// throws class cast ex ExtendedDataTableState.getExtendedDataTableState((UIExtendedDataTable) view.findComponent(":form:myDataTable"));
I want to have a button which saves the current table state programmatically, so I guess, I need to have access to my datatable instance via code. Or? -
3. Re: componentState of ExtendedDataTable
nimo22 Feb 4, 2009 7:20 AM (in response to nimo22)The table-state changes when the user changes the state of the datatable.
Imagine, I want to make restore-points, the user can click from a list all available table-states and then the table-state switches.
The only problem is, I want to controll, when a table state should be saved.
So I need a button "save State"..hence I need access to my datatable via code and get the class cast ex. (I do not want to use binding!) -
4. Re: componentState of ExtendedDataTable
ilya_shaikovsky Feb 4, 2009 7:41 AM (in response to nimo22)Which project packaging you use? EAR, war? If EAR seems you just placed RF jars in wrong places. the exception could be appeared because of different class loaders problem.
-
5. Re: componentState of ExtendedDataTable
nimo22 Feb 4, 2009 7:52 AM (in response to nimo22)I use a EAR:
in my EAR:
richfaces-api-*.jar
richfaces-impl-*.jar
richfaces-ui-*.jar
in my WAR:
richfaces-impl-*.jar
richfaces-ui-*.jar
I use richfaces 3.3.0. -
6. Re: componentState of ExtendedDataTable
ilya_shaikovsky Feb 4, 2009 8:35 AM (in response to nimo22)should be
in my EAR:
richfaces-api-*.jar
only. -
7. Re: componentState of ExtendedDataTable
nimo22 Feb 4, 2009 9:00 AM (in response to nimo22)I changed it but it does not help:
Caused by: javax.faces.el.EvaluationException: java.lang.ClassCastException: org.richfaces.component.html.HtmlExtendedDataTable at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91) ... 54 more Caused by: java.lang.ClassCastException: org.richfaces.component.html.HtmlExtendedDataTable
but it s definitly the same class:10:58:38,435 INFO [MyBean] CLASS FOUND: org.richfaces.component.html.HtmlExtendedDataTable
-
8. Re: componentState of ExtendedDataTable
nbelaevski Feb 4, 2009 11:57 AM (in response to nimo22)"nimo22" wrote:
How about #getClassLoader() call? Will it return the same values?
I changed it but it does not help:Caused by: javax.faces.el.EvaluationException: java.lang.ClassCastException: org.richfaces.component.html.HtmlExtendedDataTable at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91) ... 54 more Caused by: java.lang.ClassCastException: org.richfaces.component.html.HtmlExtendedDataTable
but it s definitly the same class:10:58:38,435 INFO [MyBean] CLASS FOUND: org.richfaces.component.html.HtmlExtendedDataTable
-
9. Re: componentState of ExtendedDataTable
nimo22 Feb 5, 2009 2:44 AM (in response to nimo22)Hey ilya:
should be
Quote:
in my EAR:
richfaces-api-*.jar
only.
When I ommit the from my EAR (!)
then I get this failure:Caused by: java.lang.NoClassDefFoundError: org/richfaces/component/html/HtmlExtendedDataTable at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.privateGetPublicMethods(Unknown Source) at java.lang.Class.getMethods(Unknown Source) at org.jboss.seam.Component.hasAnnotation(Component.java:1119) at org.jboss.seam.Component.<init>(Component.java:232) at org.jboss.seam.Component.<init>(Component.java:219) at org.jboss.seam.init.Initialization.addComponent(Initialization.java:998) ... 93 more
So I put this in my EAR:richfaces-api-*.jar richfaces-impl-*.jar richfaces-ui-*.jar
then no java.lang.NoClassDefFoundError occurs.
In my WAR all three are in, too. (I have definitly a EAR-Project!)
Hello nbelaevski (how are u?:)
well I my classLoader:07:42:05,398 INFO [MyBean] class loader: WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: java.net.FactoryURLClassLoader@42c93e 07:42:05,398 FATAL [application] java.lang.ClassCastException: org.richfaces.component.html.HtmlExtendedDataTable javax.faces.el.EvaluationException: java.lang.ClassCastException: org.richfaces.component.html.HtmlExtendedDataTable
-
10. Re: componentState of ExtendedDataTable
nimo22 Feb 5, 2009 2:46 AM (in response to nimo22)When I only have the richfaces-api-*.jar in my EAR, then I get a java.lang.NoClassDefFoundError.
So I put all three jars in it and then no "NoClassDefFoundError" occurs.
(I use SEAM 2.1 and my EAR was created by SEAM!) -
11. Re: componentState of ExtendedDataTable
ramkumarps Apr 20, 2011 12:11 AM (in response to nimo22)hey Stephan,
this problem is happening bcos of two different Jar files are there in ur EAR, one in EAR/Lib and other in Web-inf/lib
use this below snipet in WAR project
public void resetDataTable(){
UIComponent uiCombo = FacesContext.getCurrentInstance().getViewRoot().findComponent("mediationBeanForm:fileListDiv:fileListTable");
if(uiCombo!=null){
HtmlExtendedDataTable table = (HtmlExtendedDataTable) uiCombo;
Iterator<UIComponent> itr = table.columns();
System.out.println("table.getTableState() : "+table.getTableState());
if(itr!=null)
while(itr.hasNext()){
UIComponent uiCom= itr.next();
System.out.println("Component class "+uiCom.getClass().getName());
Column col =(Column)uiCom;
col.setSortOrder(Ordering.UNSORTED);
col.setFilterValue("");
}
table.restoreOrigValue();
}
}
add the below line in Component.xml
<component class="com.model.seam.ExtendedSupport" name="extendedSupport" precedence="20" scope="APPLICATION"/>
now u can able to access this method in Xhtml