[JBoss Seam] - Re: Value injection not always working with Seam 1.1
by andrew.rw.robinson
A little more information. I found a work-around, but not sure why it works. The method:
changeCurrentViewSelection(currentDimensionName, oldValue, newValue.getKey());
Causes a seam event to be thrown and some other things. When that method returns my injected member variables are set to null despite the fact that I haven't left the method yet.
I wonder if the following is happening:
1) A fires event that B observes
2) B calls method on A to get some information
3) this method is finished, Seam sets A's member variables to null
4) call context returns to A (after the event) and the members are null!
If this is true, I believe the fix, would be that the member variables should never be set to null until the bean is no longer in "scope", meaning that no method is currently being invoked on that thread in that method.
Could this be the issue?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995711#3995711
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995711
19 years, 4 months
[JBoss Seam] - Using the pages.xml to pass a parameter
by fmi2
Hi, I'm trying to understand how the pages.xml file is used to pass a parameter.
I have the following in my pages.xml file
| <pages>
| <page view-id="/centerdetail.xhtml" action="#{centerSearch.performSearch(center.centerID)}">
| <param name="selectedCenter" value="#{center.centerID}"/>
| </page>
| </pages>
|
the code in the page that request the centerdetail.xhtml page is
| <h:panelGroup id="centerResultsPanel" rendered="#{basicSearch.researchCenterSearch}">
| <h:dataTable id="researchcenterResults" var="center" value="#{searchResultList}" rendered="#{searchResultList.rowCount >0}">
| <h:column>
| <h:outputLink>
| <h:graphicImage url="images/logotype.gif"/>
| <h:outputText value="#{center.centerID}"/>
| <h:outputText value="#{obj.centerID}"/>
| </h:outputLink>
| </h:column>
| <h:column>
| <h:panelGrid id="holder" >
| <s:link id="centerName" view="/centerdetail.seam" action="#{centerSearch.performSearch(center)}" value="#{center.displayName}"/>
| <h:outputFormat value="#{center.description}"/>
| </h:panelGrid>
| </h:column>
| </h:dataTable>
| <h:outputText value="#{messages.zeroresults}" rendered="#{searchResultList.rowCount==0 and basicSearch.researchCenterSearch}" />
| </h:panelGroup>
|
and this performSearch method in my centerSearch bean is as follows
| @SuppressWarnings("unchecked")
| public String performSearch(ResearchCenter id) {
| Query query;
| log.debug(" Searching for center by ID ");
| log.debug("Center ID: #0", id);
|
| return "success";
| }
|
The center id is being appended to the url but is showing up as null in the server.log file
2006-12-21 14:29:16,468 DEBUG [gov.nih.nci.cagrid.portal.command.CenterSearchBean] Center ID:null
Does anyone know how to pass an object from a selected row in a datatable to a separate bean , ie my searchBean holds the following
| @DataModel("searchResultList")
| protected List<? extends DomainObject> results;
|
| @DataModelSelection()
| protected DomainObject domainObj;
|
and I want to pass the object of the selected row to a centerBean.
Any suggestions would be greatly appreciated.
Thank you
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995708#3995708
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995708
19 years, 4 months
[Management, JMX/JBoss] - Re: Listing all EJBs through JMX
by danieldestro
Good news!
Ok, this works:
String name = "jboss.management.local:*,j2eeType=StatelessSessionBean";
| server = (MBeanServer) MBeanServerLocator.locateJBoss();
| Set matches = server.queryMBeans(new ObjectName(name), null);
| ServerObjectInstance[] names = (ServerObjectInstance[]) matches.toArray( new ServerObjectInstance[matches.size()] );
| for( int i=0; i< names.length; i++ ) {
| out.println(names.getObjectName()+" <br>");
| }
And outputs:
anonymous wrote : jboss.management.local:name=ejb/MyCoolEjb,J2EEServer=Local,EJBModule=cool.jar,J2EEApplication=null,j2eeType=StatelessSessionBean
| jboss.management.local:name=ejb/AnotherCoolEjb,J2EEServer=Local,EJBModule=still-cool.jar,J2EEApplication=null,j2eeType=StatelessSessionBean
| jboss.management.local:name=ejb/EjbOrNotEjb,J2EEServer=Local,EJBModule=myapp.jar,J2EEApplication=myapp.ear,j2eeType=StatelessSessionBean
Very close now.
Here I have the JNDI names for lookup. But what I really need is the Bean, and if possible Local and Remote classes/interfaces names.
I know it is possible throgh jmx-console. Just need to get things clear. Any help?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995698#3995698
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995698
19 years, 4 months
[JBoss Seam] - Re: Question on using @DataModelSelection & open a page in a
by lle
Here are some relevant code snippet:
main.xhtml (page with datatable and show details link):
| <ui:define name="secondNav">
| <div class="actionButtons clearfix">
| <div class="button separator"><s:link target="account" view="/account/details.xhtml" action="#{detailsearch.findSessions}" value="Account Detail" onclick="openDetailWindow();return false;" /></div
| </div>
| <div class="decorativeElement"/>
| </ui:define>
| <ui:define name="listing">
| <t:dataTable id="sessionTable" forceId="true" var="sess" value="#{alertsList}" border="0" cellpadding="0" cellspacing="0" styleClass="listView" width="100%" renderedIfEmpty="true" forceIdIndexFormula="#{sess.id}" org.apache.myfaces.dataTable.ROW_ID="#{sess.id}" rowIndexVar="rowIndex" rowOnClick="selectRow(this.id, #{rowIndex});" >
| <t:column width="20px">
| <f:facet name="header"></f:facet>
| <t:htmlTag value="span" styleClass="icon-viewed">V</t:htmlTag>
| </t:column>
| <t:column width="72px">
| <f:facet name="header">
| <a4j:commandLink action="#{alertssearch.sortRisk}" value="Risk"/>
| </f:facet>
| <t:div styleClass="#{sess.styleClass}">
| <t:htmlTag value="p">
| <h:outputText value="#{sess.risk}">
| <f:convertNumber maxFractionDigits="3"/>
| </h:outputText>
| </t:htmlTag>
| </t:div>
| </t:column>
| <t:column width="80px">
| <f:facet name="header">Account</f:facet>#{sess.account}</t:column>
| <t:column width="80px" styleClass="rightDoubleBorder">
| <f:facet name="header">Session</f:facet>#{sess.kvalue}</t:column>
| <t:columns value="#{alertssearch.sessionDisplayProperties}" var="prop" style="#{alertssearch.colStyle}">
| <f:facet name="header">#{prop.propDef.displayName}</f:facet>
| <h:outputText value="#{prop.firstParam.value}" styleClass="#{prop.styleClassForAlert}" rendered="#{not empty prop.firstParam}"/></t:columns>
| <t:column styleClass="doubleBorder">
| <f:facet name="header">Date</f:facet>
| <h:outputText value="#{sess.timestamp}">
| <f:convertDateTime pattern="MM/dd/yyyy"/>
| </h:outputText>
| </t:column>
| </t:dataTable>
| </ui:define>
alertsearch action class:
@Name("alertssearch")
| @Scope(ScopeType.SESSION)
| @GALoggedIn
| public class GASessionSearchAction {
|
| @In
| private Session gadb;
| @In(create=true) @Out
| private GAFilter sessionfilter;
| @In
| private GAHostAppInfo hostApp;
| @In
| private FacesMessages facesMessages;
| @Logger
| private Log log;
| @DataModel
| private List<GASession> alertsList;
| @DataModelSelection
| @Out(required=false)
| private GASession selectedSession;
| ...
| }
detailsearch action class:
| @Name("detailsearch")
| @Scope(ScopeType.CONVERSATION)
| public class GAAccountDetailsAction {
|
| @In
| private Session gadb;
| @In
| private GAHostAppInfo hostApp;
| @In
| private FacesMessages facesMessages;
| @Logger
| private Log log;
| @DataModel
| private List<GASession> sessionList;
| @DataModelSelection
| @In @Out
| private GASession selectedSession;
| ...
| }
Thanks a lot.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995696#3995696
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995696
19 years, 4 months