this question is "extending" the following post
Handling view parameters in JSF after post
Asume that I'm creating an custom URL that I'm opening in a dialog. URL example "test.html?id=123"
I want to insert the "id=123" part into the h:form action so that it returns back to the same view with the extra parameter "id=123" part.
I have followed the above post and worked on the third solution, the custom ViewHandler that extends ViewHandlerWrapper.
I'm modifying the action and the form gets redirected to the same origin (until now it works).
First issue Lets say I have the following xhtml page.
<f:metadata>
<f:event type="preRenderView" listener="#{bean.init}" />
<f:viewParam name="id" value="#{bean.id}"/>
</f:metadata>
<h:form>
...
...
</h:form>
- When i post the above i get the correct id value on the back end.
- If i resubmit the post i get null values, the url however stays the same (test.html?id=xxx)
- Cant figure out why i'm getting null values on the second submit
Second issue is that when I have validated the form and everything is fine, my submit method returns back a new url "test.html?force-redirect=true..." but this does not happen, instead the URL is the same as the one entered in the h:form action, (if i make a custom redirect with the new URL then it works and i get redirected to "test.html?faces-redirect=true...").
My question, I guess is a theoretical one, is this the supposed behavior?
Thanks, Dimman