[JBoss Seam] - About outject and context
by Bernix
I have userList session bean with Session scope,and outject an user object
@Stateful
| @Name ("userList")
| @Scope (SESSION)
| public class UserListAction implements UserList {
| @Out private User user;
| ...
| }
And I have an userEdit session bean with Conversation scope,and also outject an user object
@Stateful
| @Name ("userEdit")
| @Scope (CONVERSATION)
| public class UserEditAction implements UserEdit {
| @Out private User user;
| ...
| }
then the userlist and useredit pages will redirect to userView page.
suppose this situation,I enter userlist page,select an user to view,then I go to useredit page,create an user,and after save will jump to view....
since the userlist has also outject an user(in session scope?),and then the useredit will also outject another(in conversation scope?),will there be two user object now?
and as I have end the conversation after edituser saved,I suppose that the conversation scope has been destroyed,where is that outject user object?in which context?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108869#4108869
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108869
18 years, 5 months
[JBoss Seam] - Re: By clicking every row of dataTable, show Popup to edit i
by paradigmza
like this
<a4j:form>
| <rich:dataTable value="#{rowDataModel}" var="row" onRowMouseOver="this.style.backgroundColor='#EAEAEA';this.style.cursor='pointer';"
| onRowMouseOut="this.style.backgroundColor='#{FFFFFF}'">
| <rich:column>
| <f:facet name="header">
| <h:outputText value="Name" />
| </f:facet>
| <h:outputText value="#{row.name}" />
| </rich:column>
| <rich:column>
| <f:facet name="header">
| <h:outputText value="Age" />
| </f:facet>
| <h:outputText value="#{row.age}" />
| </rich:column>
| <a4j:support event="onRowClick" oncomplete="Richfaces.showModalPanel('popUpPanel')" ajaxSingle="true" action="#{test.showPopUp}" reRender="popUpForm" />
| </rich:dataTable>
| </a4j:form>
|
|
| <rich:modalPanel id="popUpPanel" resizeable="false" autosized="true">
| <f:facet name="header">
| <h:outputText value="Some header" />
| </f:facet>
| <f:facet name="controls">
| <h:graphicImage value="/img/popupclose.gif" onclick="Richfaces.hideModalPanel('crudModalPanel')"></h:graphicImage>
| </f:facet>
| <a4j:form id="popUpForm">
| Name : #{test.name}
| Age : #{test.age}
| </a4j:form>
| </rich:modalPanel>
and a seam component called test
|
| @DataModel
| List<User> rowDataModel;
|
| @DataModelSelection
| User selectedRow;
|
| public void showPopup() {
| name = selectedRow.getName();
| age = selectedRow.getAge();
| }
so the action in
anonymous wrote :
| <a4j:support event="onRowClick" oncomplete="Richfaces.showModalPanel('popUpPanel')" ajaxSingle="true" action="#{test.showPopUp}" reRender="popUpForm" />
changes the values of test.name and test.age. The popup is then displayed with the changed values.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108864#4108864
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108864
18 years, 5 months