[JBoss Seam] - Re: EntityHome for nested entity CRUD?
by kingcu
Converter is not needed for id, since it's a Long. Now I can pass the id from the page to Home and use getEntityManager().find() to load the parent business entity and wire it up with the child. But we are kind of falling back to the old style, I was hoping that there be a way to inject the parent or its home into the child's Home. It looks to me that Seam's bijection is not general or flexible enough to cover this specific situation.
And now, I am getting into a new problem: the parent's Home object does not get cleaned up when creating the child, so the edit page for creating the child still shows values from the parent and thus the wrong set of buttons. Here is how my page looks like:
<ui:define name="body">
|
| <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
|
| <h:form id="business" styleClass="edit">
|
| <rich:panel>
| <f:facet name="header">Edit Business</f:facet>
|
| <s:decorate id="nameDecoration" template="layout/edit.xhtml">
| <ui:define name="label">name</ui:define>
| <h:inputTextarea id="name"
| cols="80"
| rows="3"
| value="#{businessHome.instance.name}"/>
| </s:decorate>
|
| <s:decorate id="descriptionDecoration" template="layout/edit.xhtml">
| <ui:define name="label">description</ui:define>
| <h:inputTextarea id="description"
| cols="80"
| rows="3"
| value="#{businessHome.instance.description}"/>
| </s:decorate>
|
| <div style="clear:both">
| <span class="required">*</span>
| required fields
| </div>
| </rich:panel>
|
| <div class="actionButtons">
|
| <h:commandButton id="save"
| value="Save"
| action="#{businessHome.persist}"
| disabled="#{!businessHome.wired}"
| rendered="#{!businessHome.managed}"/>
|
| <h:commandButton id="update"
| value="Update"
| action="#{businessHome.update}"
| rendered="#{businessHome.managed}"/>
|
| <h:commandButton id="delete"
| value="Delete"
| action="#{businessHome.remove}"
| rendered="#{businessHome.managed}"/>
|
| <s:button id="done"
| value="Done"
| propagation="end"
| view="/BusinessSearch.xhtml"
| rendered="#{businessHome.managed}"/>
|
| <s:button id="cancel"
| value="Cancel"
| propagation="end"
| view="/BusinessSearch.xhtml"
| rendered="#{!businessHome.managed}"/>
|
| </div>
|
| <s:div styleClass="actionButtons">
| <s:button view="/BusinessEdit.xhtml"
| id="createChild"
| value="Create Child Business">
| <f:param name="parentBusinessId" value="#{businessHome.instance.id}"/>
| </s:button>
| </s:div>
|
| </h:form>
|
| </ui:define>
<page no-conversation-view-id="/BusinessSearch.xhtml">
|
| <begin-conversation nested="true"/>
|
| <action execute="#{businessHome.wire}"/>
|
| <param name="businessId" value="#{businessHome.businessId}"/>
| <param name="parentBusinessId" value="#{businessHome.parentBusinessId}"/>
|
| <navigation from-action="#{businessHome.persist}">
| <end-conversation/>
| <redirect view-id="/BusinessSearch.xhtml"/>
| </navigation>
|
| <navigation from-action="#{businessHome.update}">
| <end-conversation/>
| <redirect view-id="/BusinessSearch.xhtml"/>
| </navigation>
|
| <navigation from-action="#{businessHome.remove}">
| <end-conversation/>
| <redirect view-id="/BusinessSearch.xhtml"/>
| </navigation>
|
| </page>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048475#4048475
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048475
18 years, 11 months
[JNDI/Naming/Network] - Question about IIOP
by HibsMax
Hi, Group.
Apologies if this question is to vague or scant on details, I am very new to this sort of stuff and I've not been able to find out much online. Perhaps I am using the incorrect search terms or something.
I have a servlet that sends various messages to an EJB running on another server. The protocol used is IIOP. When I access the servlet, I get this error message on my stdout:
javax.naming.NamingException: Failed to retrieve Naming interface [Root exception is java.net.MalformedURLException: unknown protocol: iiop]
I am setting the Context.INITIAL_CONTEXT_FACTORY to:
org.jboss.naming.HttpNamingContextFactory
and I also tried:
org.jboss.iiop.naming.ORBInitialContextFactory
I've scanned through the JBoss Admin Guide (4.2 by the way) and I get the impression that this should work without further /much configuration but that's just a guess really. Can anyone shed any light on this or point me in the correct direction? I feel like this should be soo simple and it probably is. :)
My server is based on the all configuration.
Peace, Anders
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048474#4048474
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048474
18 years, 11 months