[jboss-user] [JBoss Seam] - Re: getter problem

skanky78 do-not-reply at jboss.com
Tue Oct 23 17:50:19 EDT 2007


thank you pete, now i'm using the @factory annotation.

for pagination i'm using rich:datascroller and a dataTable component-binding (as recommended in the doc: http://docs.jboss.com/seam/2.0.0.CR1/reference/en/html_single/#d0e5034)

anonymous wrote : 
  | 
  | @In(create = true)
  | // dataTable binding
  | protected Binding binding;
  | 
  | @Factory(scope=ScopeType.EVENT)
  | public DataModel getItems() {
  | 
  | // in this method i'm using the current dataTable index (dataTable.getFirst()) and pagesize (dateTable.getRows) to get the items for the selected page
  | 
  | }
  | 



anonymous wrote : 
  | <rich:dataTable id="dataTable" binding="#{binding.dataTable}" value="#{items}">
  | 
  | ..
  | </rich:dataTable>
  | 

the problem with that is, that i need the current index of the datatable within the factory method to fetch the items for selected page. but at the time the factory method is executed (after restore view phase) the method binding.dataTable.getFirst() returns the old value because it isn't initialized yet.

how can i get the current index of the dataTable (if datascroller is used) so that i'm able to fetch the next page items in the factory method? any ideas?

cheers,
sven

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098062#4098062

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098062



More information about the jboss-user mailing list