-
1. Re: Factory, Datamodel and back Button
lvdberg Jun 11, 2009 2:16 PM (in response to wachtda.scsi.gmx.ch)Have you tried to put Bean 1 in another scopetype ? Default behaviour is to Outject the datamodel to the same scopetype as the owning component, so basically myAlerts is in Session scope.
Leo
-
2. Re: Factory, Datamodel and back Button
lvdberg Jun 11, 2009 2:26 PM (in response to wachtda.scsi.gmx.ch)Additional,
I also think that your Factory is not called, because the Datamodel (in session scope) already contains a value.
Leo
-
3. Re: Factory, Datamodel and back Button
wachtda.scsi.gmx.ch Jun 11, 2009 2:43 PM (in response to wachtda.scsi.gmx.ch)hy,
yes the myAlerts is in session scope!
but if i come back to my alertOverview, why it doesn't display the datatable with the datamodel?
needs the factory to get called, in order to the datatable can display the datamodel? -
4. Re: Factory, Datamodel and back Button
lvdberg Jun 11, 2009 3:21 PM (in response to wachtda.scsi.gmx.ch)The factory annotation is used for methods which should be called when the associated value (in your case myAlerts) has no value.
And I think that because it possibly already has a value (because of being in the session scope) , the method will not be called.
Leo
-
5. Re: Factory, Datamodel and back Button
rccs Jul 2, 2009 3:29 AM (in response to wachtda.scsi.gmx.ch)Hi Leo.
I have a datamodel that is loaded with a select to a table (category), and shown on a page (listarCategoria.xhtml), on the same page I do a search on the table (category), the datamodel is updated but only for view in the page (listarCategoria.xhtml), my problem is that when I choose one of the categories of result of the search, the datamodelseleccion is loaded with the object of the datamodel initial.
How can I update the datamodel?Help me please.
¡¡¡¡¡¡Excuse my English is not very good.!!!!!
-
6. Re: Factory, Datamodel and back Button
wachtda.scsi.gmx.ch Jul 8, 2009 10:25 AM (in response to wachtda.scsi.gmx.ch)Hi Leo, sorry for my late answer!
(Since I was abroad I couldn't answer to your posting)Perhaps I don't understand the @Datamodel the right way.
If I define a Collection with @Datamodel in a SFSB, does it not preserve its value trough the session?
I tried it, with some logs on the size of my datamodel and it appears NULL if I come back with the back button.What do I have to do, that if the user comes back with the backbutton that the datamodel keep it's value?
Thanks for helping -
7. Re: Factory, Datamodel and back Button
wachtda.scsi.gmx.ch Jul 8, 2009 5:07 PM (in response to wachtda.scsi.gmx.ch)Found the problem/solution!
The problems caused by the rich:datascroller which i use for my table.
The solution (maybe someone can tell me if this is a proper solution..?):- Added var to bean which stores the datascrollers page index
- Bound the datascroller to this var:
page="#{alertOverviewAction.pageIndex}"
- Added action to the bean to listen to (from pages.xml)
- Bound the datascroller to this action:
action="#{alertOverviewAction.dsAction}"
- Added pages.xml entry for handling this (ajax) action:
...<navigation from-action="#{alertOverviewAction.dsAction}"><redirect view-id="/MY_PAGE.XHTML" /></navigation>...
Now the back button works very well, and displays the latest position before link redirection.
Further informations available here and here.
Thanks for helping out
Cheers Daniel -
8. Re: Factory, Datamodel and back Button
wachtda.scsi.gmx.ch Jul 9, 2009 5:17 PM (in response to wachtda.scsi.gmx.ch)One thing I forgot to mention.
The solution which I used (and is posted in different threads and FAQ) results in a page request.
Will say the ajax request will be discarded for this solution.If you have a page on which you must have an ajax request the only solution i found is to rerender the component upon page
load:<a:jsFunction name="reloadAjaxComponents reRender="componentsToReload" />
and then call the jsFunction with for example a
<body onload="reloadAjaxComponents()">
(More information about this solution here)
Im not very happy with this solution, but sadly I found not any better one.
Perhaps someone else has a better solution for this scenario!??
Thanks for any hints...