Answer the question
In order to leave comments, you need to log in
How to write value to hidden field in jsf?
On the page, you need to create a hidden field where you want to write data, but when you try to create such a field
<h:inputHidden value="#{informationController.token}" id="hide"/>
private String token;
public String getToken(){
this.token = OAuth.getToken();
return token;
}
<h:inputHidden value="#{informationController.getToken}" id="hide"/>
Answer the question
In order to leave comments, you need to log in
to write the value, jsf looks for the set Token method and doesn't find it. create a setter. and in value pass the field itself, not its getter, so the first option is correct
<h:inputHidden value="#{informationController.token}" id="hide"/>
This is a bug, it seems. Maybe in PrimeFaces. Googling your error gives this link with a suggestion to bypass it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question