[JBoss Seam] - Re: two @datamodel in one sessionbean?
by jacob.orshalick
Let me make sure I understand your question in the context of the previous code...
1. You have specified the following:
| ...
| @DataModel(value="list1")
| private List<String> list1;
|
| @DataModelSelection(value="list1")
| @Out(required=false, value="focusList1")
| private String focusList1;
| ...
|
2. The user selects an @DataModel in your view list which executes some action.
3. The action does not invoke the @DataModelSelection attribute, just logs a statement, say:
| ...
| public void select() {
| log.info("User selected something!");
| }
| ...
|
4. Subsequently, in the RENDER_RESPONSE phase you attempt to access the outjected variable #{focusList1} and the context variable is null.
In other words, if the @DataModelSelection attribute is not invoked (touched) during the INVOKE_APPLICATION phase, the @DataModelSelection is not loaded. Therefore, no value is outjected to the context to be made available in the RENDER_RESPONSE.
Is this correct?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084829#4084829
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084829
18 years, 9 months
[JBoss jBPM] - can't update or delete variables
by dfrenkiel
hello.
i can successfully create process variables but i can't update or delete them.
i have hibernate logging sql queries and it does nothing with new or deleted variables.
here's some code where i'm trying to delete a variable called "phoneNumber"
after running this code the process instance still has the variable.
=======================
ProcessInstance processInstance = jbpmContext.loadProcessInstanceForUpdate(8);
ContextInstance contextInstance = processInstance.getContextInstance();
contextInstance.deleteVariable("phoneNumber");
jbpmContext.save(processInstance);
jbpmContext.close();
=======================
the result is the same if i try to update the variable - it remains unchanged.
is there something else i need to do to enable variable updates and deletes?
thanks very much for any assistance.
david f.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084827#4084827
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084827
18 years, 9 months
[JBoss Seam] - Re: two @datamodel in one sessionbean?
by jacob.orshalick
The value provided for your @DataModelSelection should specify the @DataModel it is related to. Based on your example above,
| ...
| @DataModel(value="list1")
| private List<String> list1;
|
| @DataModelSelection(value="list1")
| private String focusList1;
| ...
|
This should be specified for each @DataModel and @DataModelSelection in order to allow Seam to determine which @DataModelSelection is associated with which @DataModel. Now, if you want to outject the @DataModelSelection, you will have to do so explicitly through:
| ...
| @DataModel(value="list1")
| private List<String> list1;
|
| @DataModelSelection(value="list1")
| @Out(required=false, value="focusList1")
| private String focusList1;
| ...
|
The above will allow you to access #{list1} as your @DataModel and #{focusList1} as your @DataModelSelection.
The getters and setters you specified are not necessary to access these attributes from EL expressions as Seam outjects them directly into the context although you may keep the getters and setters for unit testing (makes sense). Hope that helps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084821#4084821
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084821
18 years, 9 months
[JBoss Seam] - Re: two @datamodel in one sessionbean?
by jdijkmeijer
That doesnot work for me, behavior is a bit strange and I hope I didnt mess up. See code below:
| package nl.jeroen.testdb.persist;
|
| import java.io.Serializable;
| import java.util.List;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
|
| import nl.jeroen.testdb.session.IApplicationSession;
|
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.annotations.datamodel.DataModel;
| import org.jboss.seam.annotations.datamodel.DataModelSelection;
| import org.jboss.seam.log.Log;
|
| @Scope(ScopeType.SESSION)
| @Stateful
| @Name("zzz")
| public class RoleSubjectMgrBean implements Serializable, RoleSubjectMgr {
| private static final long serialVersionUID = -9145745003284315431L;
|
| @Logger
| Log logger;
|
| @DataModel(value="list1")
| private List<String> list1;
|
| @DataModelSelection(value="focusList1")
| private String focusList1;
| public List<String> getList1() {
| return list1;
| }
|
| public void setList1(List<String> list1) {
| this.list1 = list1;
| }
|
| public String getFocusList1() {
| return focusList1;
| }
|
| public void setFocusList1(String focusList1) {
| this.focusList1 = focusList1;
| }
|
| @DataModel(value="list2")
| private List<String> list2;
|
| @DataModelSelection(value="focusList2")
| private String focusList2;
|
| public List<String> getList2() {
| return list2;
| }
| public void setList2(List<String> l2) {
| this.list2 = l2;
| }
| public String getFocusList2() {
| return focusList2;
| }
|
| public void setFocusList2(String focusList2) {
| this.focusList2 = focusList2;
| }
|
| @Destroy @Remove
| public void destroy() {
| }
|
| }
|
This fails the only way for me to get this working (deploy) is removing the second dataModel(Selection) tags and removing value=".." for dataModelSelection tags, the value=".." for the datamodel doesnot seem to do any harm nor good.
the errors are still the same errors on deployment of sessionbean:
| 17:25:47,588 INFO [org.jboss.seam.Component] Component: zzz, scope: SESSION, type: STATEFUL_SESSION_BEAN, class: nl.jeroen.testdb.persist.RoleSubjectMgrBean, JNDI: spuytear/RoleSubjectMgrBean/local
| 17:25:47,671 INFO [com.icesoft.faces.util.event.servlet.ContextEventRepeater] Servlet Context Name: null, Server Info: JBossWeb/2.0.0.GA
| 17:25:47,673 WARN [org.jboss.system.ServiceController] Problem starting service jboss.web.deployment:war=spuytwar.war,id=1280645147
| org.jboss.deployment.DeploymentException: URL file:/Applications/jboss-4.2.0.GA/server/default/tmp/deploy/tmp55177spuytear.ear-contents/spuytwar-exp.war/ deployment failed
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:379)
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
|
thanks for your time,
jeroen.
ps ICEFaces is on version 1.6.0
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084818#4084818
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084818
18 years, 9 months