This content has been marked as final.
Show 4 replies
-
1. Re: Conversation does not end when doing back, wrong entity edited
digdas.seam.digdas.nl Jul 30, 2008 3:05 PM (in response to digdas.seam.digdas.nl)Update, the previous example did not work completely correct, it sometimes (first time) came up with the old answer.
I changed the thing to do to user find to reset the instance. @RequestParameter public void setMdaIcnMonthsId(Long mdaIcnMonthsId) { if (mdaIcnMonthsId != null) if (this.getConversation().isLongRunning()) if (this.instance != null) if (this.instance.getKey() != null) if (this.instance.getKey().compareTo(mdaIcnMonthsId) != 0 ) this.instance = getEntityManager().find(MdaIcnMonths.class, mdaIcnMonthsId); this.mdaIcnMonthsId = mdaIcnMonthsId; }
Is this a correct thing to do?
-
2. Re: Conversation does not end when doing back, wrong entity edited
gjeudy Jul 30, 2008 3:25 PM (in response to digdas.seam.digdas.nl)Where do you start and stop your conversations in this example ? What is the JSF code for the links you click? Do you propagate the conversation context?
-
3. Re: Conversation does not end when doing back, wrong entity edited
digdas.seam.digdas.nl Jul 30, 2008 3:37 PM (in response to digdas.seam.digdas.nl)The code is created with Seam-Create new entity.
List to select the object:
<h:form id="mdaIcnMonthsForm"> <rich:panel> <f:facet name="header">mdaIcnMonths for month #{mdaIcnMonthsHome.instance.stmPerPeriodsR.month}</f:facet> <s:decorate id="nameDecoration" template="layout/edit.xhtml" for="name"> <ui:define name="label">DollarExchangeRate</ui:define> <h:inputText id="name" required="true" value="#{mdaIcnMonthsHome.instance.dollarExchangeRate}" rendered="#{s:hasRole('MDA_DOLLAR_USER')}"/> <h:outputText value="#{mdaIcnMonthsHome.instance.dollarExchangeRate}" rendered="#{!s:hasRole('MDA_DOLLAR_USER')}"/> </s:decorate> <div style="clear:both"/> </rich:panel> <div class="actionButtons"> <h:commandButton id="update" value="Save" action="#{mdaIcnMonthsHome.update}" rendered="#{mdaIcnMonthsHome.managed and s:hasRole('MDA_DOLLAR_USER')}"/> <s:button propagation="end" id="done" value="Done" view="/mdaIcnMonthsList.xhtml"/> </div> </h:form>
The home object is also standard
@Name("mdaIcnMonthsHome") public class MdaIcnMonthsHome extends EntityHome<MdaIcnMonths> { @RequestParameter Long mdaIcnMonthsId; @Override public Object getId() { if (mdaIcnMonthsId==null) { return super.getId(); } else { return mdaIcnMonthsId; } } @Override @Begin public void create() { super.create(); } @Override @Restrict("#{s:hasRole('MDA_DOLLAR_USER'}") public String persist() { // TODO Auto-generated method stub return super.persist(); } }
-
4. Re: Conversation does not end when doing back, wrong entity edited
digdas.seam.digdas.nl Jul 30, 2008 3:39 PM (in response to digdas.seam.digdas.nl)Sorry, missed the list page:
<h:dataTable id="mdaIcnMonthsList" var="mdaIcnMonths" value="#{mdaIcnMonthsList.resultList}" rendered="#{not empty mdaIcnMonthsList.resultList}"> <h:column> <f:facet name="header">Month</f:facet> <s:link id="name" value="#{mdaIcnMonths.stmPerPeriodsR.month} " view="/mdaIcnMonths.xhtml" > <f:param name="mdaIcnMonthsId" value="#{mdaIcnMonths.key}"/> </s:link> </h:column>