Salut à tous.
Dans une appli seam j'ai un comportement que je n'arrive pas à expliquer. J'ai mis mon post dans la partie seam du forum car mon projet est en seam mais je ne suis pas sur que le probleme vienne de la.
Alors j'ai fait une page pour mettre en evidence mon probleme:
la page xhtml:
le home:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition 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:rich="http://richfaces.org/rich" template="layout/template.xhtml" xmlns:a4j="http://richfaces.org/a4j"> <ui:define name="breadcrumb"> <ui:include src="layout/menuBreadcrumb.xhtml"> </ui:include> </ui:define> <ui:define name="body"> <h:form id="testForm"> <rich:panel id="allTable"> <h:outputText value="test page" /> <br /> <h:inputText label="test" value="#{myDebugHome.inputTest}"> <a4j:support event="onchange" reRender="allTable" /> </h:inputText> <br /> <h:inputText label="test2" value="#{myDebugHome.inputTest2}" rendered="#{myDebugHome.inputTest!=null}" /> <br /> <h:commandButton action="#{myDebugHome.myMethode}" value="Submit" /> </rich:panel> </h:form> </ui:define> </ui:composition>
et le resultat quand j'appel ma methode:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 package be.xxxxxx.action; import java.io.Serializable; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Scope; @Name("myDebugHome") @Scope(ScopeType.CONVERSATION) public class MyDebugHome implements Serializable { private static final long serialVersionUID = 4105373009248019961L; public String inputTest; public String inputTest2; public void myMethode() { System.out.println("***************************** in myMethode"); System.out.println("inputTest: " + inputTest); System.out.println("inputTest2: " + inputTest2); } public String getInputTest() { return inputTest; } public void setInputTest(String inputTest) { this.inputTest = inputTest; } public String getInputTest2() { return inputTest2; } public void setInputTest2(String inputTest2) { this.inputTest2 = inputTest2; } }
Ma question est pourquoi mon champs inputTest2 reste vide?17:03:13,039 INFO [STDOUT] ***************************** in myMethode
17:03:13,040 INFO [STDOUT] inputTest: 456456
17:03:13,041 INFO [STDOUT] inputTest2: null
Quand je ne fait pas de reRender et je ne met pas de rendered ca marche mais c'est pas ca m'aide pas.
Si qqun sait m'expliquer ca ou me dire comment faire pour recuperer ma valeur inputTest2 dans mon home je suis serait tres reconnaisant.
merci
Partager