Reply To: PrettyFaces: outbound rewriting broken on Rewrite

Splash Forums PrettyFaces Users PrettyFaces: outbound rewriting broken on Rewrite Reply To: PrettyFaces: outbound rewriting broken on Rewrite

#24846

hendrik
Participant

Looks like there is still a problem. I can’t really figure out why:

On one page i have a viewParam like these:

<ui:define name="metadata">
        <f:metadata>
            <o:viewParam name="id"
                         value="#{someBean.someId}"
                         required="true" />
            <f:event type="preRenderView"
                     listener="#{someBean.preRenderView}" />
        </f:metadata>
    </ui:define>

But in my preRenderView someId is null. “id” is totally unmapped in the pretty-config, should therefore be appended as query-param (&id=whatever) and be injected into someBean.someId. Is this expected behaviour? Should the value be null?
I’m actually trying to avoid the query-param tag because of problems like the one mentioned in http://ocpsoft.org/support/topic/error-on-ajax-post-required-value-was-null/.

There are also 2 parentIds (in a hierarchy) in the pretty-config for the URL in question, i don’t know if this might be related.

It works if i define a query-param mapping for anotherBean.id, set this value and invoke the navigationhandler:

// anotherBean
public void onRowSelect(SelectEvent selectEvent) {
        setId(whatever);
        this.navigationHandler.handleNavigation(this.facesContext, null, pretty:someBeansId);
    }
<url-mapping id="someBeansId" parentId="parentId">
        <pattern value="/some" />
        <view-id value="/fs/private/parent/Some.xhtml" />
        <query-param name="id">#{anotherBean.id}</query-param>
    </url-mapping>

But then i get problems with AJAX + ViewScope etc(see http://ocpsoft.org/support/topic/error-on-ajax-post-required-value-was-null/), so i actually want to navigate with a link like “/fs/private/parent/Some.xhtml?id=1234&mappedParam=whatever” which is supposed to be rewritten to /whatever/some?id=1234.

PrettyFacesTest project works fine now, but it lacks the viewParam and navigationHandler. Should be easy to add and test though.