I have a method in one of my ManagedBeans which will redirect to another page, it is also supposed to append an id to the URL.
Eg.
public String editForm(String formId) {
return "designer?id=" + formId;
}
I call this from my main page like so
<p:menuitem value="View/Edit" icon="ui-icon-search"
action="#{formsView.editForm(formsView.selectedForm.id)}" />
Then I have a @ViewScoped
bean that is used in the designer page, and in it's @PostConstruct
I have something like this
@PostConstruct
public void init() {
Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
String formId = params.get("id");
...
}
However the id key doesn't seem to appear in the params Map
, what am I doing wrong?