Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Partial submit , Immediate and JSF Life cycle Issue

user7436563Mar 6 2009 — edited Mar 8 2009
Hi ,
I have a form with a input text field and a submit button. The value attribute of the input field (*private String name*)
is a backing bean property and it is binded to a RichInputText property *(private RichInputText nameField;)*
in the same backing bean.The submit button has an action listener which calls a method in my backing bean*(displayText(ActionEvent ae*)
). The submit button has the partial submit attribute set to "true" and immediate set to "true" .With immediate set to "true" my understanding is that, jsf life cycle sets "apply request values" and then skips the validation ,model updation directly goes to invoke application phase.With this assumption , on invoke application, setNameField(RichInputText nameField) will be called called (apply request values) and i should be able to get the value using the getLocalValue() method on the RichInputText
class.But when i try to display it in my managed bean ,it is null.

How can i access the input value in my backing bean when both the partial submit and immediate attruibtes are set to true on my submit button?

Here is my backing bean class :
public class SampleBean {
private RichInputText nameField;

public SampleBean() {
}



private String name;

public void setName(String name) {
this.name = name;
}

public String getName() {
return name;
}

public void setNameField(RichInputText nameField) {
this.nameField = nameField;
}

public RichInputText getNameField() {
return nameField;
}



public void displayText(ActionEvent ae){
System.out.println(nameField.getLocalValue());
//System.out.println(name);
}
}



jsf page :
<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=windows-1252"/>
<f:view>
<af:document>
<af:form>
<af:inputText label="Label 1" value="#{ sampleBean.name}"
binding="#{sampleBean.nameField}"/>
<af:commandButton text="Submit" id="submit" partialSubmit="true"
immediate="true"
actionListener="#{sampleBean.displayText}"/>
<af:outputText value="#{sampleBean.name}" partialTriggers="submit"/>
</af:form>
</af:document>
</f:view>
</jsp:root>

This post has been answered by 487442 on Mar 8 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2009
Added on Mar 6 2009
4 comments
3,365 views