IBM Support

PH55398: MISSING SOURCE BUTTON ID:VALUE PAIR FROM REQUEST PARAMETERS IN AJAX REQUESTS

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • When the non-ajax submit button is pressed, its id and value is
    sent as a request parameter.  If the ajax equivalent button is
    pressed, the id-value pair is missing.  However, the id is
    included under the "javax.faces.source" attribute, per the spec.
    
    
    
    This becomes a problem if you do some binding checks to see if
    a particular button is pressed. See the link:
    https://stackoverflow.com/a/14730658/11402059
    
    Here's a sample of the behaviors for ajax and non ajax
    submissions.  The required parts are in red (which should appear
    in both requests):
    
    <h:form id="form1">
    <div> Ajax Checkboxes: </div>
    <h:selectManyCheckbox id="ajaxCheckbox" required="#{not empty
    ajaxbtn.clientId}">
    
      <f:selectItem itemValue = "1" itemLabel = "Item 1" />
    
      <f:selectItem itemValue = "2" itemLabel = "Item 2" />
    </h:selectManyCheckbox>
    Message for ajaxCheckbox -> <h:message for="ajaxCheckbox" />
    <br/>
    <div> Non-Ajax Checkboxes: </div>
    <h:selectManyCheckbox id="nonajaxCheckbox" required="#{not empty
    nonajaxbtn.clientId}">
    
      <f:selectItem itemValue = "3" itemLabel = "Item 3" />
    
      <f:selectItem itemValue = "4" itemLabel = "Item 4" />
    </h:selectManyCheckbox>
    Message for nonajaxCheckbox -> : <h:message
    for="nonajaxCheckbox" />
    <br/>
    <!-- Added this button to see parameters passed when using ajax
    -->
    <h:commandButton id="ajaxbtn" value="Ajax Submit"
    binding="#{ajaxbtn}">
        <f:ajax event="click" execute="@form" render="@form"/>
    </h:commandButton>
    <h:commandButton id="nonajaxbtn" value="Non Ajax Submit"
    binding="#{nonajaxbtn}"/>
    <c:forEach items="#{param}" var="entry">
        <p style="#{entry.key == 'form1:nonajaxbtn' or entry.key ==
    'form1:ajaxbtn'  ? 'color:red;' : 'color:black;'}"><h:outputText
    value="#{entry.key}" /> : <h:outputText value="#{entry.value}"
    /></p>
    </c:forEach>
    </h:form>
    
    It used to work in 2.0, but now fails after refactoring.
    
    
    2.3.x:
    
    https://github.com/apache/myfaces/blob/2.3.x/api/src/main/java
    script/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js#L
    38-L63
    
    
    2.0.5:
    
    https://github.com/apache/myfaces/blob/myfaces-core-project-2.
    0.5/api/src/main/javascript/META-INF/resources/myfaces/_impl/xh
    rCore/_AjaxUtils.js#L57
    

Local fix

  • NA
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  Users of MyFaces 2.2 on WebSphere           *
    *                  Application Server 9.0. Users of jsf-2.2,   *
    *                  2.3, faces-3.0, and 4.0 on WebSphere        *
    *                  Liberty.                                    *
    ****************************************************************
    * PROBLEM DESCRIPTION: Issuing Element Not Found in Request    *
    *                      Parameter Map for Ajax Requests         *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Take the following example, which requires a particular button
    to be pressed for some input.
    <h:inputText required="#{not empty param[someButton.clientId]}
    ... />
    <h:commandButton id="someButton" value="Submit"
    binding="#{someButton}">
    <f:ajax event="click" ... />
    </h:commandButton>
    When someButton is pressed, it should send it's id in the
    request parameter map (due to the binding attribute).
    If the issuing element is not sent as part of the request,
    then it can cause the required check to be evaluated
    improperly.
    This previously worked in MyFaces 2.0 in WAS 8.5.5, but not in
    MyFaces 2.2 in WAS 9.0.5.
    Note that only ajax requests were broken.
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PH55398

  • Reported component name

    WEBS APP SERV N

  • Reported component ID

    5724H8800

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2023-06-26

  • Closed date

    2023-12-12

  • Last modified date

    2023-12-12

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WEBS APP SERV N

  • Fixed component ID

    5724H8800

Applicable component levels

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.0","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
12 December 2023