Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
12. Jul 2008, 16:18 CET | Link

Hi,

I'm new at Seam and trying to implement my first process.I want to use use a POJO component as model behind the input fields (without any persistence) and conversation action class working working with jBPM.

Model:
`
@Name("contract")
public class Contract implements Serializable
{
        private String firstName;

    // getter and setter method for firstName
}
`

Action:
`
@Name("createContract")
@Scope(CONVERSATION)
public class CreateContractAction implements Serializable
{
         @In(create=true)
    @Out
    private Contract contract;

    @Begin(join=true,pageflow="createContract")
    public void begin(){
        contract.setFirstName("Michael");
    }
}
`

Pageflow:
`
<pageflow-definition name="createContract">

    <start-state name="start">
        <transition to="enterContractData"/>
    </start-state>
         <page name="enterContractData" view-id="/enterContractData.xhtml">
        <redirect/>
        <transition name="next" to="enterBankData" />
    </page>
         <page name="enterBankData" view-id="/enterBankData.xhtml">
        <redirect/>
    </page>
</pageflow-definition>
`

View:
`
...
<h:message for="firstName" errorClass="errorMessage" />
            <div class="inputGroup">
                <div class="inputLabel">${messages.firstName}:</div>
                <div class="inputElement">
                    <h:inputText id="firstName" value="#{contract.firstName}" />
                </div>
            </div>
...
`


The pageflow is started with a seam link calling the begin method of the CreateContractAction.

My problem:

The begin method is called correctly and set the firstName, but after the method is passed the firstName field is null and there is no value shown on the view. Also after a submit of the view the values are not
set on the contract model.

You have any ideas?

Much thanks for your help.

Best regards

Canny Duck

1 Reply:
13. Jul 2008, 22:14 CET | Link

The solution is to give the model a conversation scope.