[JBoss jBPM] - Re: Signal a task on a html form submit
by estaub
Ronald,
anonymous wrote : This is generic EL stuff.... ig you have e.g. a class Token with getter/setter like getId/setId, in EL you have to use token.id to have access to it.
|
Yeah, I know... it's just that we all do bonehead things like this once in a while and need a hint about where we screwed up. The log can provide this - maybe. I haven't used it in this area, so I don't know what log output is emitted and whether it is useful. I was hoping you might - I guess not, though!
anonymous wrote : If it is the jboss imp, it uses log4j, so turning on debug at the rootlevel (and reducing it to the correct classes/packages if you see some interesting stuff) is what I normally do.
Yes... I'm getting a sense that a lot of folks don't have the experience base for this to be an reflexive thing to do. I'm starting to wonder if it makes sense to include a log4j.xml in the config, just to steer folks toward taking advantage of it.
I guess JBPM may migrate at some point to use Seam's EL implementation relatively soon, so researching into specifics about log capabilities in the current implementation may not be that useful in the long term.
-Ed Staub
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049313#4049313
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049313
18 years, 10 months
[JBoss Seam] - outputlink order problem
by nicolasb
hello
i really don't get the reason for this strange problem:
first my environment:
the entity a simple foto with a number attribute
| import java.io.Serializable;
|
| import javax.persistence.*;
|
| import org.jboss.seam.annotations.Name;
|
| @Entity
| @Name("photo")
| public class Photo implements Serializable
| {
| private static final long serialVersionUID = 1L;
|
| @Id @GeneratedValue
| private long id;
| private String number;
|
| public long getId() { return id;}
| public void setId(long id) { this.id = id; }
|
| public String getNumber() { return number; }
| public void setNumber(String number) { this.number = number; }
|
| }
|
|
the facelet
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
| <html xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:s="http://jboss.com/products/seam/taglib">
| <head>
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
| </head>
| <body>
|
| <h:form>
| <h:inputText value="#{photo.number}"/>
| <h:commandButton type="submit" value="Add" action="#{formAction.addItem}"/>
| </h:form>
|
| <h:outputLink value="test.html" rendered="#{myservice.value == true}">Is True</h:outputLink>
|
| </body>
| </html>
|
|
with the corrosponding pages def.
| <page view-id="/test.xhtml">
| <action execute="#{myservice.load}"/>
| </page>
|
and the bean from where the page gets the data
|
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.log.Log;
|
|
| @Name("myservice")
| @Scope(ScopeType.EVENT)
|
| public class MyServiceBean
| {
| @Logger
| private Log log;
|
| private boolean value = true;
| public boolean getValue() { return this.value; }
|
| @Out(required=false)
| private Photo photo;
| public Photo getPhoto() { return this.photo; }
|
| public void load()
| {
| log.info("loading");
|
| this.photo = new Photo();
| this.photo.setNumber("testPhoto");
| }
| }
|
|
so when the page is loaded the method load is executed and the photo is being outjected. which i then access in my facelet form
now to the strange part:
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
|
| 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.log.Log;
|
| @Stateful
| @Name("formAction")
|
| public class FormActionBean implements FormAction
| {
| @Logger
| private Log log;
|
| @In
| Photo photo;
|
| public void addItem()
| {
| log.info("adding: "+photo.getNumber());
| }
|
| @Remove @Destroy
| public void Destroy() {}
|
| }
|
| public interface FormAction
| {
| public void addItem();
| public void Destroy();
| }
|
|
when i try to submit the form and access the addItem method it won't work.
an exception is thrown because @In is not non-null
BUT it works when i put the outputlink above the form.
i found out its the rendered attribute which messes it up. if i omit it there won't be an error
i hope someone can help me i tried to post all the necessary files
thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049312#4049312
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049312
18 years, 10 months