[solved] False dispatch on RichFaces AJAX call?

Splash Forums PrettyFaces Users [solved] False dispatch on RichFaces AJAX call?

This topic contains 1 reply, has 2 voices, and was last updated by  Christian Kaltepoth 11 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #17764


    I just ran into something strange here. I’m not sure if this has to do with the fact that I’m running a ragged configuration, changes in the XML for PrettyFaces or an outright bug, but I can’t come up with a rational explanation for this behaviour:

    I’m using the RichRaces SuggestionBox facility and PrettyFaces seems to be intercepting the AJAX requests and misrouting them.

    This is the tag setup:

    <h:inputText id="toVesselId" value="#{item.vesselId}">
    <a4j:support event="onblur"
    ajaxSingle="true" action="#{woRackingBean.doChangeDest}" />
    <rich:toolTip for="toVesselId">
    <span>Click and press the down-arrow key or begin typing
    a vessel ID</span>
    <rich:suggestionbox id="suggestionBox" for="toVesselId"
    tokens=",[]" suggestionAction="#{woRackingBean.autocomplete}"
    var="result" fetchValue="#{result.id}" width="300"
    nothingLabel="No vessels found"

    <h:outputText value="#{result.id}" />
    <h:outputText value="#{result.capacity}">
    <h:outputText rendered="#{not empty result.blendGallon}"
    <h:outputText rendered="#{empty result.blendGallon}" value="0"/>
    <h:outputText value=" Used" />
    <h:outputText rendered="#{result.inGroup}" value="G" />
    <h:outputText rendered="#{not result.inGroup}" value="-" />

    Here’s the pretty-config.xml:

    <pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.0.2"
    <url-mapping id="editRacking">
    <pattern value="/workorder/racking/edit"/>
    <query-param name="wo">#{woRackingBean.wonum}</query-param>
    <view-id>/workorder/racking/WOAddEditRacking.jsf </view-id>

    And the filter in web.xml (NOTE it’s retricted because of some other strange things that were happening when filtering globally):

    <filter-name>Pretty Filter</filter-name>
    <filter-name>Pretty Filter</filter-name>

    As near as I can tell, when a request for a suggestionlist is made, the list is returned and displayed properly, but a call is made to the editRacking url-mapping as well. I have no idea why, since the current page url is /workorder/racking/WOAddEditRacking.jsf.

    Am I doing something wrong here or is this a bug?


    What do you mean by “misrouting AJAX requests”? It sounds like your suggestion box is working well. When you browser shows /workorder/racking/edit and the suggestion box sends AJAX requests, these requests will be postbacks to the same URL. So PrettyFaces will process these requests, inject your query parameter AND call the action #{woRackingBean.doEditWO}. This is expected behavior. If you don’t want that your action is executed on postbacks, you can change this by setting onPostback attribute to false.



Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.