CommandButton – Replace URL with Parameters

Splash Forums Rewrite Users CommandButton – Replace URL with Parameters

This topic contains 0 replies, has 1 voice, and was last updated by  SciLor 8 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #27299

    SciLor
    Participant

    I am migration from a simple JSF commandButton (BootsFaces).
    I have already added a rule for searching via /Search/a-b-c

    but what I need to change to update my URL when I press Check/Search
    from /Search to /Search/a-b-c

    It should also work when there was a search (and the URL is /Search/a-b-c) to do another search and land on /Search/1-2-3

    I have following rule:

    .addRule().when(Path.matches("/Search/{a}-{b}-{c}"))
        .perform(PhaseAction.retrieveFrom(El.retrievalMethod("searchBean.search"))
        .after(PhaseId.RESTORE_VIEW).and(Forward.to("/pages/search.xhtml")))
            .where("a").bindsTo(PhaseBinding.to(El.property("searchBean.x.a")).after(PhaseId.RESTORE_VIEW))
            .where("b").bindsTo(PhaseBinding.to(El.property("searchBean.x.b")).after(PhaseId.RESTORE_VIEW))
            .where("c").bindsTo(PhaseBinding.to(El.property("searchBean.x.c")).after(PhaseId.RESTORE_VIEW));
    

    search Method:

    public String search() {
    /*Bunch of cide*/
         return "";
    }
    

    html:

    							
    <b:commandButton value="Check" look="primary" ajax="false"
    	iconAwesome="search" update="ajaxPanel"
    	action="#{searchBean.search}">
    </b:commandButton>
    
    • This topic was modified 8 months ago by  SciLor.
    • This topic was modified 8 months ago by  Christian Kaltepoth. Reason: formatting
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Comments are closed.