I am new to
JSF. I created a page based on some examples I see from the
JBoss Seam examples but my problem is not Seam related (I think).
It is very simple. Enter a value into an h:inputText field, click a button to call an action method on an SLSB. The problem is the setter for the text field (setTestVal) is not being called. It is my understanding it should be called to load the text typed into the page into the testVal property of the SLSB before the action method is called. I can build the examples I have and they work! I noticed the example used a SFSB. I tried making mine a SFSB but nothing changed. I must have missed something or misunderstand how this works (again, new stuff to me)
Environment: JBoss AS 4.0.5, Seam 1.2.1.GA, JSF?? whatever comes with this JBoss version (I think myfaces 1.1.4).
From Page:
<h:form>
<h:inputText value="#{Tester.testVal}"/>
<s:button title="Submit" action="#{Tester.post}" />
</h:form>
From SLSB:
@Name("Tester") // seam annotation, avoids XML definition
public @Stateless class ActionTestBean implements ActionTest {
private
String testVal;
public String getTestVal() {
return testVal;
}
// SHOULDN'T THIS SETTER BE CALLED BEFORE THE POST METHOD WHEN THE BUTTON IS // CLICKED to load what was entered into the page ??? public void setTestVal(String testVal) {
this.testVal = testVal;
}
public void post()
{
String tmp = testVal;
}
The action method is called as I expect. There are no errors of any kind that I see or can find in the logs.
HELP!