javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2484

programagtically generated commandButton has only name, but no id.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Works as designed
    • Affects Version/s: 2.2.0-m04
    • Fix Version/s: None
    • Component/s: ajax
    • Labels:
      None
    • Environment:

      glassfish

      Description

      I programatically created a command button. I did not set id and leave framework to assign id to it. This button has ajax behavior attached.

      In client side, it has an generated name, but not id. My client framework(YUI 3) adds an ID to it. When ajax event is triggered, the javax.faces.source is set to client-generated ID. This client-generated ID does not correspond to any component in server. So action associated with button is not invoked.

      As a workaround, I just explicitly set an ID to the button. By this way, both ID and name are presented in the client side.

      I think the javax.faces.source should point to name attribute instead of ID attribute. Or you can generate both ID and name at server all the time.

        Activity

        Hide
        Manfred Riem added a comment -

        Using the ID is specified by the documentation, see http://javaserverfaces.java.net/nonav/docs/2.1/jsdocs/symbols/jsf.ajax.html#.request. Note that if you think this is incorrect you should file a spec issue.

        Show
        Manfred Riem added a comment - Using the ID is specified by the documentation, see http://javaserverfaces.java.net/nonav/docs/2.1/jsdocs/symbols/jsf.ajax.html#.request . Note that if you think this is incorrect you should file a spec issue.
        Hide
        jasonzhang2002gmailcom added a comment -

        This is not a spec issue.
        JSF at client side can defifinitely use ID. But server should make sure ID is generated besides the name.

        Show
        jasonzhang2002gmailcom added a comment - This is not a spec issue. JSF at client side can defifinitely use ID. But server should make sure ID is generated besides the name.

          People

          • Assignee:
            Unassigned
            Reporter:
            jasonzhang2002gmailcom
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: