Tapestry
  1. Tapestry
  2. TAPESTRY-1405

EventListeners on RadioGroups don't fire asynchronously

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.1.6
    • Component/s: Core Components
    • Labels:
      None
    • Environment:
      java 1.5.0_07, osx 10.4.9

      Description

      In the .html:

      <span jwcid="category@RadioGroup" displayName="literal:Category" selected="ognl:category">
      <input type="radio" jwcid="@Radio" value="ognl:@Category@VIDEO"/> Video
      <input type="radio" jwcid="@Radio" value="ognl:@Category@PROJECT"/> Project
      <input type="radio" jwcid="@Radio" value="ognl:@Category@OTHER"/> Other
      </span>

      In the .java:

      @EventListener(events = "onclick", targets = "category", async = true, submitForm = "editTimeEventForm", validateForm = false)
      public void categorySelected(IRequestCycle cycle)

      { log.info("Chose a category: " + getCategory()); }

      Nothing happens if you click on a radio button. It works fine if the RadioGroup component is changed to a PropertySelection:

      <select jwcid="category@PropertySelection" displayName="literal:Category" value="ognl:category" model="ognl:categorySelectionModel">
      <option>Video</option>
      <option>Project</option>
      <option>Other</option>
      </select>

      The latter includes some initialization js (while the former doesn't include any):

      tapestry.cleanConnect(dojo.byId("category"), "onclick", "formEvent193333026");
      tapestry.formEvent193333026=function(e){
      var content=

      {beventname:"onclick"}

      ;
      tapestry.event.buildEventProperties(e, content);
      if (!content["beventtarget.id"])

      { content["beventtarget.id"]="category"; }

      var validateState=tapestry.form.forms["editTimeEventForm"].validateForm;
      var validateForm=false;
      tapestry.form.setFormValidating("editTimeEventForm", validateForm);
      tapestry.form.submitAsync("editTimeEventForm", content);
      tapestry.form.setFormValidating("editTimeEventForm", validateState);
      };
      dojo.event.connect(dojo.byId("category"), "onclick", tapestry, "formEvent193333026");});

        Activity

        Hide
        Marcus Schulte added a comment -

        duplicate of and fixed with TAPESTRY-1039

        Show
        Marcus Schulte added a comment - duplicate of and fixed with TAPESTRY-1039

          People

          • Assignee:
            Marcus Schulte
            Reporter:
            Julian Wood
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development