conversation Scope for next and previous
flo076 May 24, 2011 5:26 AMHello, I am currently developing an app where I must spend more on next page with a button or return with a back button. So I read the doc on the type of scope used and it seems that the talk time would be best. So I try to do something every single page in an inputText and I put a link next to the second page and I post what I entered in the first. Until you follow me? So here I am trying to understand not fiddled with @ Begin all his but I am lost. If anyone has a solution or ways to make me move I'm interested in the meantime I'll see if Google is truly a loyal friend
I enclose my different test file: c info for test 1 and test 2, which calls these 2 files are in one folder and a file called test.page.xml y 'in the same folder:
Test 1 :
<ui:define name="center">
<h:form>
<h:inputText value="#{test.unAttribut}" />
</h:form>
<h:outputLink value="Test2.seam">
<h:outputText value="next" />
</h:outputLink>
</ui:define>
Test 2 :
<ui:define name="center">
<h:outputText value="valeur de l'attribut : #{test.unAttribut}" />
</ui:define>
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
@Name("test")
@Scope(ScopeType.CONVERSATION)
public class Test {
private String unAttribut;
public Test()
{
System.out.println(" \n Passe dans constructeur");
}
/**
* @param unAttribut the unAttribut to set
*/
@Begin
public void setUnAttribut(String unAttribut) {
System.out.println(" \n Passe dans set");
this.unAttribut = unAttribut;
}
/**
* @return the unAttribut
*/
@Begin
public String getUnAttribut() {
System.out.println(" \n Passe dans get");
return unAttribut;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
- <page xmlns="http://jboss.com/products/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd" login-required="false">
<begin-conversation join="true" />
</page>