[JBoss Seam] - Value won't change
by ector7280
First let me explain what I trying to do.
I'm using Seam 1.2 with Ajax4JSF and I'm trying to change the value of a selectOneMenu by using ajax on a selectOneRadio.
The problem is that the value sent back never changes even as the value on the page is changed. Do you have to submit the page to get the value to change?
Here's the relevant code:
| <f:view xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:tr="http://myfaces.apache.org/trinidad"
| xmlns:rich="http://richfaces.ajax4jsf.org/rich"
| xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
|
| <html>
| <body>
|
| <h:messages globalOnly="true" styleClass="message" id="globalMessages" />
| <h:form id="vessel" styleClass="edit">
|
| <rich:panel>
| <f:facet name="header">Vessel Details</f:facet>
|
| <s:decorate id="vesselIdDecoration">
| <h:inputHidden id="vesselId" disabled="#{vesselHome.managed}"
| value="#{vesselHome.instance.vesselId}">
| <a4j:support event="onblur" reRender="vesselIdDecoration" />
| </h:inputHidden>
| </s:decorate>
| <h:outputText>
| <fieldset title="shipyard"><legend>Shipyard</legend> <a4j:outputPanel
| ajaxRendered="true">
| <h:panelGrid columns="2" rowClasses="prop"
| columnClasses="name,value" title="Shipyard Info">
| <h:outputLabel for="statusDecoration">
| <p align="right"><span class="required">*</span> Shipyard
| Status:</p>
| </h:outputLabel>
| <s:decorate id="statusDecoration">
| <h:selectOneRadio id="status" value="#{shipyardFilter.statusId}"
| styleClass="radio">
| <a4j:support event="onclick" reRender="status,shipyard, location1" />
| <f:selectItem itemLabel="Open" itemValue="1" />
| <f:selectItem itemLabel="Closed" itemValue="2" />
| <f:selectItem itemLabel="Renamed" itemValue="3" />
|
| </h:selectOneRadio>
| </s:decorate>
| <a4j:region>
| <s:decorate id="shipyardDecoration">
| <h:selectOneMenu id="shipyard"
| value="#{vesselHome.instance.shipyard}" required="true">
| <s:selectItems value="#{shipyardFilter.shipyards}" var="shipyard"
| label="#{shipyard.name}" noSelectionLabel="Please Select..."
| hideNoSelectionLabel="true" />
| <a4j:support event="onchange" reRender="shipyardDecoration" />
| <s:convertEntity />
| </h:selectOneMenu>
| </s:decorate>
| </a4j:region>
| <f:subview id="location1">
| <ui:include src="VesselLocation.xhtml" />
| </f:subview>
|
| </h:panelGrid>
|
| </a4j:outputPanel></fieldset>
| </h:outputText>
|
|
|
|
| </rich:panel>
|
| <div class="actionButtons"><h:commandButton id="save"
| value="Save" action="#{vesselHome.persist}"
| disabled="#{!vesselHome.wired}" rendered="#{!vesselHome.managed}" />
|
| <h:commandButton id="update" value="Save"
| action="#{vesselHome.update}" rendered="#{vesselHome.managed}" /> <h:commandButton
| id="delete" value="Delete" action="#{vesselHome.remove}"
| rendered="#{vesselHome.managed}" /> <s:button id="done" value="Done"
| propagation="end" view="/Vessel.xhtml"
| rendered="#{vesselHome.managed}" /> <s:button id="cancel"
| value="Cancel" propagation="end"
| view="/#{empty vesselFrom ? 'VesselList' : vesselFrom}.xhtml"
| rendered="#{!vesselHome.managed}" /></div>
| </h:form>
|
| </body>
|
| </html>
|
| </f:view>
|
| package gov.dot.marad.business.ejb;
|
| import gov.dot.marad.persistence.ejb.model.Shipyard;
| import gov.dot.marad.persistence.ejb.model.VesselHome;
|
| import java.util.List;
|
| import javax.ejb.Stateless;
| import javax.persistence.EntityManager;
|
| import org.jboss.seam.annotations.Factory;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.datamodel.DataModel;
|
| @Stateless
| @Name("shipyardFilter")
| public class ShipyardFilterAction implements ShipyardFilter
| {
| @Out
| private int statusId = 1;
|
| private List<Shipyard> shipyards;
|
| @In(create = true)
| EntityManager entityManager;
|
| @In
| VesselHome vesselHome;
|
|
| public EntityManager getEntityManager()
| {
| return entityManager;
| }
|
| public int getStatusId()
| {
| return this.statusId;
| }
|
| @SuppressWarnings("unchecked")
| @DataModel
| public List <Shipyard> getShipyards()
| {
|
| shipyards = getEntityManager().createQuery(
| " select shipyard from Shipyard shipyard " +
| " where shipyard.shipyardStatus.statusId=:status")
| .setParameter("status", getStatusId()).getResultList();
|
| return shipyards;
| }
|
| }
|
I've tried various ways of using the @In annotation to no avail.
Any help would be appreciated.
JR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045893#4045893
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045893
19 years, 1 month
[JBoss jBPM] - Re: jbpm-jpdl-designer-3.1.0.alpha3 questions
by myarrow
Hello Keon
So I followed your suggestion, and am using
the jpdl-3.1.0.alpha4. I am using this with
the 3.1.4 runtime but everything seems to be
working.
I have an actionHandler question, for which I have
not found a documentation answer:
Question: In the actionHanderl Properties
dialog, is there a Config Type Field setter
dialog for setting "Fields" (which then are
represented in the processdefinition.xml with
something like the following:
| <action class="org.test.MyAction">
| <city>Atlanta</city>
| <rounds>5</rounds>
| </action>
|
Note: this is from jBPM Userguide 16.2.3.1
config-type field)
When I set an actionHandler Config Type to
"Field", I do not subsequently see a mechanism
for entering field names and values in the
action Properties dialog. Is this correct or am
I missing something that allows me to set
the field-name / value pairs for an actionHandler?
I might rephrase my question to the following:
When a user is designing a workflow, how can
this user set actionHandler config-type Field
values (other than having to write XML into
the processdefinition.xml source) ?
Maurice Yarrow
SplashNote Systems
Santa Clara, California
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045883#4045883
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045883
19 years, 1 month
[JBoss jBPM] - Re: deploy from code problem
by simonbaker
Thanks Ed for the reference, each little piece sheds some light (and more questions as well).
For the heck of it, I blindly threw in a "JbpmConfiguration.createSchema()" statement in my code because, hey, it sounds promising...
Guess what, my errors went away and my logging shows a lot of insert statements into what appear to be tables with names like JBPM_NODE, JBPM_EVENT, etc.
Did I do good?
Now, when I look at the (outdated?) jBPM 2.0 Deployment Doc, under Configuration it describes 4 configuration mechanisms and some properties. One of the properties is "jbpm.create.tables" and a possible value is "only-if-not-present". The description is anonymous wrote : If applicable, jbpm will create the the JBPM_ tables at startup if they are not present. The generated ddl starts with dropping the tables and contraints, then creates the tables, then adds the constraints.
Q: If I had had this property in my "jbpm.cfg.xml" file, would the schema have been created automatically at first access?
To continue the discussion:
For my bare-bones test, my "jbpm.cfg.xml" file is empty, and the comment in it says anonymous wrote : The default configurations can be found in org/jbpm/default.jbpm.cfg.xml
| Those configurations can be overwritten by putting this file called
| jbpm.cfg.xml on the root of the classpath and put in the customized values.
|
Q: Does that mean that jBPM first reads the default file, then reads the "jbpm.cfg.xml" file and overrides any repeated settings, or does it mean that if the "jbpm.cfg.xml" file is present, the default file is ignored?
Also, when I look in that default file, there is a comment in it that says anonymous wrote : This configuration is used when there is no jbpm.cfg.xml file found in the root of the classpath. It is a very basic configuration without persistence and message services. Only the authorization service installed.
| You can parse and create processes, but when you try to use one of the unavailable services, you'll get an exception.
|
Two issues: 1) The first sentence seems to imply that the default file is completely ignored when the "jbpm.cfg.xml" file is present -- implying you need to copy any settings from the default file to the "jbpm.cfg.xml" if you want to use them, and 2) the comment says "without persistence", but the file has entries for persistence service and hibernate (see below).
Q: Is the comment correct that there is no persistence set up?
| <jbpm-configuration>
|
| <!--
| This configuration is used when there is no jbpm.cfg.xml file found in the
| root of the classpath. It is a very basic configuration without persistence
| and message services. Only the authorization service installed.
| You can parse and create processes, but when you try to use one of the
| unavailable services, you'll get an exception.
| -->
|
| <jbpm-context>
| <service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory" />
| <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
| <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
| <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
| <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
| </jbpm-context>
|
| <!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar -->
| <string name="resource.hibernate.cfg.xml" value="hibernate.cfg.xml" />
| <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" />
| <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" />
| <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" />
| <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" />
| <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" />
| <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
| <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />
|
| <long name="jbpm.msg.wait.timout" value="5000" singleton="true" />
| <int name="jbpm.byte.block.size" value="1024" singleton="true" />
| <string name="mail.smtp.host" value="localhost" />
| <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
| <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
| <bean name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" />
|
| </jbpm-configuration>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045876#4045876
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045876
19 years, 1 month