-
1. Re: refresh/rerender whole datatable
ilya_shaikovsky Feb 5, 2008 11:17 AM (in response to smilidon)make your new event bean request scoped.
-
2. Re: refresh/rerender whole datatable
smilidon Feb 5, 2008 11:33 AM (in response to smilidon)Thanks, but i have still the same problem. Columns added are not shown, until reloading the page.
-
3. Re: refresh/rerender whole datatable
hedinant Feb 6, 2008 10:36 AM (in response to smilidon)Hi Smilidon trying to do it your way.
There are a function, createValueExpression, may you post how did you implement it.
I did not find a way.
May you describe how it works, or give me a good link to read? -
4. Re: refresh/rerender whole datatable
xorsolutions Feb 6, 2008 11:57 AM (in response to smilidon)Smilidon, maybe you should use something like this?
<a4j:commandButton id="addDetailButton" value="add" image="/images/bt0_6.gif" action="#{newEvent.addDetail}"> <a4j:support event="oncomplete" reRender="detailsTable"/> </a4j:commandButton>
In this case rerendering will occure when request will be completed on server side.
Offtopic. Tell me please, is your application web or enterprise? -
5. Re: refresh/rerender whole datatable
ilya_shaikovsky Feb 7, 2008 5:03 AM (in response to smilidon)XorSolutions, your suggestion is not good. Using your construction - two requests will be fired...
-
6. Re: refresh/rerender whole datatable
smilidon Feb 7, 2008 5:38 AM (in response to smilidon)sure hedinant:
private ValueExpression createValueExpression(String valueExpression, Class<?> valueType) { FacesContext facesContext = FacesContext.getCurrentInstance(); return facesContext.getApplication().getExpressionFactory().createValueExpression( facesContext.getELContext(), valueExpression, valueType); }
you also will find it here, very good blog about datatables:
http://balusc.blogspot.com/2006/06/using-datatables.html
there is also a spelling mistage, it has to be:<rich:dataTable id="detailsTable" binding="#{newEvent.detailsHtmlTable}"> </rich:dataTable>
i will try xorsolution code, if it works, it could be a temporary solution
regards -
7. Re: refresh/rerender whole datatable
hedinant Feb 7, 2008 10:33 AM (in response to smilidon)Thanks alot. It works.
So if you will find solution to reload problem post it please.
Or a more classic way to implement this. -
8. Re: refresh/rerender whole datatable
nepveul Feb 8, 2008 11:34 AM (in response to smilidon)Smilidon, can you tell me which version of jboss AS, Seam, and richfaces you are using.
I'm trying to do something similar, but run into a
Component not instance of org.richfaces.component.UIDataTable
error.
Thanks! -
9. Re: refresh/rerender whole datatable
smilidon Feb 20, 2008 8:19 AM (in response to smilidon)a little bit late, but i use jboss 4.2.1, richfaces 3.1.3 and no seam.
any news about this topic? i'm still looking for a solution to add dynamic columns to a datatable(and it looks like others doing that too).
regards -
10. Re: refresh/rerender whole datatable
stevoffm Feb 25, 2008 6:57 AM (in response to smilidon)Hi,
I think maybe having detailsHtmlTable = new HtmlDataTable(); in your getter causes the problem. You should move the it in the constructor so that it is created during the creation of the bean. By doing so you also have to take care of removing the columns before you add new ones. But this is only necesarry with a session bean I think.
Maybe the binding referes to a specific instance, by alway creating a new one it is lost and yaou have to refresh the whole page to renew the binding...
I don't know if all that is corrrect, but you could experiment with it ;)
Let me know if ot works.
I tried it this way and it works for me, meaning I can add and remove columns dynamically -
11. Re: refresh/rerender whole datatable
sdelvalle Feb 29, 2008 2:08 PM (in response to smilidon)Hi,
I was trying to do the same, and finally could. What I did is bind the datatable to a session scoped bean of class HtmlDataTable, and everytime I need to change the columns I get the bean from the session attributes and do all the operations directly on this bean.
Hope this helps.
Regards
Sergio Del Valle -
12. Re: refresh/rerender whole datatable
smilidon Mar 3, 2008 3:17 AM (in response to smilidon)Hi,
StevoFFM or sdelvalle, could you post some code please?
thanks in advance
S. -
13. Re: refresh/rerender whole datatable
smilidon Mar 4, 2008 4:07 AM (in response to smilidon)having detailsHtmlTable = new HtmlDataTable(); in your getter causes the problem
thanks a lot, that was the reason.