Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Incomplete
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      29

      Description

      I've got a very simple page (and bean):

      <h:form id="form">

      <h1>DynaFaces.fireAjaxTransaction</h1>

      <h:commandButton value="fire"
      actionListener="#

      {bean.fire}

      "
      onclick="DynaFaces.fireAjaxTransaction(this);"/>

      <h:outputText value="Result:"/>
      <h:outputText id="result" value="#

      {bean.result}

      "/>

      </h:form>

      Expectation is that whole view is refreshed via Ajax.
      However, looks like Ajax transaction is not happening - looks like
      form submit is happening.

      Specifying the id of the output component as in:

      fireAjaxTransaction(this),

      {render:result}

      ...

      makes no difference.

        Activity

        Hide
        rogerk added a comment -

        I've discovered that I was missing the return false;

        So, the following works:

        onclick="DynaFaces.fireAjaxTransaction(this);
        return false;"/>

        However, the following still does not appear to work:

        <h:form id="form">

        <h1>DynaFaces.fireAjaxTransaction</h1>

        <h:outputText value="Result:"/>
        <h:outputText id="result" value="#

        {bean.result}

        "/>

        <h:commandButton value="fire"
        actionListener="#

        {bean.fire}

        "
        onclick="DynaFaces.fireAjaxTransaction(this,

        {render:'result'}

        ); return false;"/>

        </h:form>

        I can see the params being sent:

        Content-Type: application/x-www-form-urlencoded
        com.sun.faces.avatar.Partial: true
        com.sun.faces.avatar.Render: result

        But I don;t see the incremented value in the outputText.

        Show
        rogerk added a comment - I've discovered that I was missing the return false; So, the following works: onclick="DynaFaces.fireAjaxTransaction(this); return false;"/> However, the following still does not appear to work: <h:form id="form"> <h1>DynaFaces.fireAjaxTransaction</h1> <h:outputText value="Result:"/> <h:outputText id="result" value="# {bean.result} "/> <h:commandButton value="fire" actionListener="# {bean.fire} " onclick="DynaFaces.fireAjaxTransaction(this, {render:'result'} ); return false;"/> </h:form> I can see the params being sent: Content-Type: application/x-www-form-urlencoded com.sun.faces.avatar.Partial: true com.sun.faces.avatar.Render: result But I don;t see the incremented value in the outputText.
        Hide
        agoria added a comment -

        rogerk, I think you should provide the execute property:

        render:'result', execute:'<button id>'.

        In https://jsf-extensions.dev.java.net/issues/show_bug.cgi?id=23 I have already
        pointed out that the execute property is not so natural and easy to remeber.
        IMHO default execute value should be changed...

        Show
        agoria added a comment - rogerk, I think you should provide the execute property: render:'result', execute:'<button id>'. In https://jsf-extensions.dev.java.net/issues/show_bug.cgi?id=23 I have already pointed out that the execute property is not so natural and easy to remeber. IMHO default execute value should be changed...
        Hide
        rogerk added a comment -

        I was under the assumption that not specifying "execute" (just specifying
        "render" in fireAjaxTransaction) would also do the "execute" portion of the
        lifecycle.
        So, the event hander was not getting called.
        I'll get better clarification on this.

        Show
        rogerk added a comment - I was under the assumption that not specifying "execute" (just specifying "render" in fireAjaxTransaction) would also do the "execute" portion of the lifecycle. So, the event hander was not getting called. I'll get better clarification on this.
        Hide
        rogerk added a comment -

        Actually, I'm finding that:

        render:'result', execute:'<button id>' does not work.

        However, qualifying with the parent (form id) works:

        render:'form:result', execute:'<button id>'

        Why do I have to qualify with the parent form id?

        Show
        rogerk added a comment - Actually, I'm finding that: render:'result', execute:'<button id>' does not work. However, qualifying with the parent (form id) works: render:'form:result', execute:'<button id>' Why do I have to qualify with the parent form id?
        Hide
        agoria added a comment -

        Are you sure you was passing the right client id?

        Usually I set prependId="false" on the form to avoid the long client id.

        Show
        agoria added a comment - Are you sure you was passing the right client id? Usually I set prependId="false" on the form to avoid the long client id.

          People

          • Assignee:
            Ed Burns
            Reporter:
            rogerk
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: