Wicket
  1. Wicket
  2. WICKET-1271

Script in RenderHead method of AjaxFormChoiceComponentUpdatingBehavior needs fixing

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-final
    • Fix Version/s: 1.3.1
    • Component/s: wicket
    • Labels:
      None

      Description

      The script in the renderHead method of AjaxFormChoiceComponentUpdatingBehavior assumes that the Radio Component will be the immediate child of the RadioGroup Component, But in some or in most of the cases that is not correct.

      That is not the case even in the Wicket Examples, in examples the hierarchy is RadioGroup/ListView/Radio.

      I have maodied the rendered script to work for RadioGroup/ListView/Radio hierarchy.

      And the Patch is attached.

      Regards
      Dipu

        Issue Links

          Activity

          Hide
          Dipu C Seminlal added a comment -

          Patch for the rendered Script in AjaxFormChoiceComponentUpdatingBehavior

          Show
          Dipu C Seminlal added a comment - Patch for the rendered Script in AjaxFormChoiceComponentUpdatingBehavior
          Hide
          Rens Verhage added a comment - - edited

          More elegant way of fetching descendant input elements, without cumbersome loop

          /edit:
          Grmbl, nevermind my patch, doesn't seem to work in firefox...

          /edit 2:
          I stand corrected, my patch seems to also work within firefox. However, if I declare my HTML like:

          <table>
          <tr>
          <span wicket:id="radiogroup" id="someid">
          <td><input wicket:id="radio1" /></td>
          <td><input wicket:id="radio1" /></td>
          </span>
          </tr>
          </table>

          won't work as firefox does not accept the span tag between <tr> and <td>, and therefore will return a single node of #text when calling document.getElementById('someid').childNodes. Placing the span outside the table works. IE doesn't seem too picky about this.

          Show
          Rens Verhage added a comment - - edited More elegant way of fetching descendant input elements, without cumbersome loop /edit: Grmbl, nevermind my patch, doesn't seem to work in firefox... /edit 2: I stand corrected, my patch seems to also work within firefox. However, if I declare my HTML like: <table> <tr> <span wicket:id="radiogroup" id="someid"> <td><input wicket:id="radio1" /></td> <td><input wicket:id="radio1" /></td> </span> </tr> </table> won't work as firefox does not accept the span tag between <tr> and <td>, and therefore will return a single node of #text when calling document.getElementById('someid').childNodes. Placing the span outside the table works. IE doesn't seem too picky about this.

            People

            • Assignee:
              Igor Vaynberg
              Reporter:
              Dipu C Seminlal
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development