1

I have a flow.xml file that's calling a method on a bean. I just want to have a string that I get from a textbox passed in as a parameter to the method. I've added a h:inputText to my xhtml page, but I can't get it to set a String variable in the corresponding flow. What is the simplest possible way I can get a value from a textbox into a flowscope String variable?

2 Answers 2

1
public class SomeBean{
String val;
  //getters & setters
  public String foo(){
    System.out.println(val);
    return "SUCCESS";
  }
}

xhtml

    <h:form>
      <h:inputtext value="#{someBean.val}"/>
      <h:commandButton action="#{someBean.foo}"/>
    </h:form>

as html it will render a html form with a textbox and a submit button on licking button it will call foo() and text from txtbox will get binded to val

Sign up to request clarification or add additional context in comments.

Comments

0
MyBean myBean = (MyBean) facesContext.getApplication().createValueBinding("#{flowScope.myBean}").getValue(facesContext);
String val = myBean.GetBeanProperty();

Here you should more examples.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.