Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2806

Javascript looking for related radio in group is not working if css class is already assigned to radio

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.7
    • 1.4.8, 1.5-M1
    • wicket
    • None
    • Windows XP

    Description

      We added a RadioGroup and two Radios. We often use multiple css classes for a component. Everything is working, until we add the class attribute to the radios. Then the click on radio is ignored.

      The sad thing is that the tests for behavior with WicketTester are working. This problem is only related to the browsers. So we can't provide a testcase.
      Sorry you have to check it manually.

      We traced it to the line 73 in AjaxFormChoiceComponentUpdatingBehavior

      <code>
      asb.append(" if (!(inputNode.className.indexOf('wicket-'markupId)===0)&&!(inputNode.id.indexOf(markupId'-')===0)) continue;\n");
      </code>

      That means that the className has to start with the appropriate "wicket-markupId" value. But it will be added to the end of the class attribute value in
      line 226 of Radio. So we get "abc wicket-markupId".

      It is working with
      asb.append(" if (!(inputNode.className.indexOf('wicket-'markupId)>=0 || inputNode.id.indexOf(markupId'-')>=0)) continue;\n");

      Alternatively the class for identifying in script has to be added at beginning
      Radio line 226:
      clazz = marker + " " + clazz;

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            newgro Per Newgro
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: