[JBoss Portal] - Re: MyFaces Portlet in JBoss Portal Cluster
by pmoller
I was doing some other developing for some time but now found the time to go further with the clustering. I got it working and have some comments:
One has to distinquish between traditional JSF-apps and JBoss SEAM apps clustering is different depending on the platform used. JBoss SEAM keeps the stateful managed beans in the EJB3 layer which must be some thing the JSF will consider later since it makes good sense: it is a better strategy to keep stateful session data in a stateful ejb since then the app server can do what it is best at at the appropriate "level".
BUT since my app is a traditional JSF app I could figure (from the JBoss Portal docs) that I would have to "touch" my managed beans in the session whenever I changed their state. This has some implications since this is against what was intended in JSF.
If one bean has relations with another this relationship would normally be managed in the faces-config.xml (by injection) but this would never call set attribute on the portlet session when one changes the state on the
other.
And if a page needs info from a managed bean in the session the JSF-framwork will generate a new empty bean and place it in the session for the page to use. This first bean creation will call setAttribute a cause session replication whereas other state changes only will appear as mutator calls on the bean in mention.
I know that JBoss tomcat replication now has the POJO replication but don't really know how this relates to the JBoss Portal session listener.
My solution is to have a bean handler that will fetch beans from the session and that will release these again by calling set attribute on the portlet session for the bean that had a state change. Much like the session interceptor used by JBoss Portal. And this worked. So know I have portlet implemented using traditional MyFaces that really is clustered.
I still use my custom MyFaces generic portlet but the other issue I mentioned above (http://jira.jboss.com/jira/browse/JBPORTAL-1094) wasn't really an error in the JBoss Portal (sorry about that Julien Viet) merely code that at first sight looked a bit suspecious.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983412#3983412
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983412
19Â years, 6Â months
[JBoss Seam] - Re: t:dataTable & ScrollerActionEvent problem
by sherkan777
Sorry for that, I had problem with keyboard:
Its conclusion of my post:
anonymous wrote :
| Hi guys,
|
| I just start using tomahawk components and have some questions about dataScroller.
|
| Situation:
| I have a page that contain a t:dataTable and the corresponding t:dataScroller that do the navigation of the table.
| Problem is with my actionListener...here is source code:
|
|
| | <t:dataTable id="questionsTable"
| | styleClass="scrollerTable"
| | headerClass="standardTable_Header"
| | footerClass="standardTable_Header"
| | rowClasses="standardTable_Row1,standardTable_Row2"
| | columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
| | rows="#{questionsAction.maxRows}"
| | var="question"
| | value="#{questionList}"
| | preserveDataModel="true"
| | preserveSort="false"
| | style="border: none; width: 100%;"
| | cellpadding="0"
| | cellspacing="0">
| |
| | <h:column>
| | <f:facet name="header">
| | <h:outputText value="#{messages['questionsAction.questionList.header.name']}"/>
| | </f:facet>
| | <s:link value="#{question.topic}" action="#{questionsAction.question}"/>
| | </h:column>
| |
| | </t:dataTable>
| |
| |
| | <h:panelGrid columns="1" styleClass="scrollerTable" columnClasses="standardTable_ColumnCentered">
| | <t:dataScroller id="questionsScroller"
| | for="questionsTable"
| | fastStep="10"
| | pageCountVar="pageCount"
| | pageIndexVar="pageIndex"
| | styleClass="scroller"
| | style="border: none;"
| | paginator="true"
| | paginatorTableClass="paginator"
| | paginatorMaxPages="5"
| | immediate="true">
| | <f:actionListener type="pl.fargo.expert.business.QuestionsAction"/>
| |
| | <f:facet name="first">
| | <h:graphicImage value="/images/arrow-first.gif" style="border: none;" />
| | </f:facet>
| |
| | <f:facet name="last">
| | <t:graphicImage url="/images/arrow-last.gif" style="border: none;"/>
| | </f:facet>
| |
| | <f:facet name="previous">
| | t:graphicImage url="/images/arrow-previous.gif" style="border: none;"/>
| | </f:facet>
| |
| | <f:facet name="next">
| | <t:graphicImage url="/images/arrow-next.gif" style="border: none;"/>
| | </f:facet>
| |
| | <f:facet name="fastforward">
| | <t:graphicImage url="/images/arrow-ff.gif" style="border: none;"/>
| | </f:facet>
| |
| | <f:facet name="fastrewind">
| | <t:graphicImage url="/images/arrow-fr.gif" style="border: none;"/>
| | </f:facet>
| | </t:dataScroller>
| | </h:panelGrid>
| |
|
| ActionListener:
|
| | public void processAction(ActionEvent event) throws AbortProcessingException
| | {
| | String current = event.getComponent().getId();
| | FacesContext context = FacesContext.getCurrentInstance();
| |
| | if(event instanceof org.apache.myfaces.custom.datascroller.ScrollerActionEvent) {
| | System.out.println("1: " + ((ScrollerActionEvent)event).getPageIndex());
| | System.out.println("2: " + ((ScrollerActionEvent)event));
| | System.out.println("3: " + ((ScrollerActionEvent)event).getScrollerfacet());
| |
| | }
| |
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983411#3983411
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983411
19Â years, 6Â months