Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

value binding inputText  RSS feed

 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Isn't it possible to set the value of the component in BackingBean using binding ?

If I set the value of inputText directly in the jsp to the managed bean it works fine


but if i use binding, the value is not seeting to the managed bean, this is what i tried

jsp
---
<h:inputText id="textFirstName" styleClass="inputText" binding="#{pc_Borrower.firstName}" />

backing bean
---------
public HtmlInputText getFirstName() {
if (textFirstName == null)
textFirstName = new HtmlInputText();

BorrowerManagedBean mb_borrower = (BorrowerManagedBean)
getFacesContext().getApplication().getVariableResolver
().resolveVariable(getFacesContext(), "mb_Borrower");

textFirstName.setValue(mb_borrower.borrowers[0].firstName);
return textFirstName;
}

public void setFirstName(HtmlInputText input) {
this.textFirstName = input;
}

We need to dynamically add new Tabs in our application and its working fine, but when we tried to map the component to the managedbean it seems to be not setting the values. I think the concept of setting value is binding is similar to what we are trying to acheive.

Could anyone help me out in resolving this issue ?

Thanks,
Rajeev
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!