Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-7212

Onclick script not getting associated with correct control ids for checkbox

    Details

    • Type: Task Task
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0-m1, 2.2
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-4118Checkbox Controls associated with Kim attributes are not displaying correctly
      KULRICE-7871Checkbox and Radio Group ids are not correct
      KULRICE-9658attributeQuery does not set value correctly for radio/checkbox controls
      KULRICE-11929Radio and checkbox controls do not get their rich messages evaluated
      KULRICE-6833Enable onclick event for Group components
      KULRICE-12702Disabled checkbox loses value when submitting a form
      KULRICE-9614Dialogs not correctly returning to controller method
      KULRICE-7478Keyboard focus order in checkbox groups and radiogroups
      KULRICE-9916Do checkbox conversion in LookupInputField only when specified through attribute definition
      KULRICE-6731Values are not being held when using checkbox group or radio controls
    • Rice Module:
      KRAD
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      When using a checkbox control instead of a text control and configuring onclick script, the id selector doesn't come out correct. Note the specific ids have changed in 2.2.

      Add a sample to configuration test view for verifying this functionality.

      Here's the whole <span> created for the checkbox which fails:

      <span id="u507_line0_attribute_span" class="uif-field uif-inputField">
      <input id="u507_line0_attribute" class="uif-control uif-checkboxControl valid"
      type="checkbox" value="true" tabindex="0" name="holidays[0].instructional"
      aria-invalid="false">
      <input type="hidden" value="on" name="_holidays[0].instructional">
      <input type="hidden" value="jq('#' + 'u507_line0').click(function(e)

      { alert('click'); });" script="first_run">
      <span id="u507_line0_attribute_markers"></span>
      <span id="u507_line0_attribute_info_message"></span>
      </span>

      The jq selector is looking for element id 'u507_line0' which doesn't exist; it should have been looking for the visible element 'u507_line0_attribute'. (why 'attribute'?). Here's what gets generated for a TextControl which works:

      <span id="u324_add_attribute_span" class="uif-field uif-inputField">
      <input id="u324_add" class="uif-control uif-textControl KS-HolidayCalendar-HolidaySection-addField validChar-newCollectionLines['holidays'].startTime0 valid"
      type="text" size="4" value="" tabindex="0"
      name="newCollectionLines['holidays'].startTime"
      placeholder="hh:mm " aria-invalid="false">
      <input class="ignoreValid" type="hidden"
      value="createWatermark('u324_add', "hh:mm ");"
      script="first_run">
      <input class="ignoreValid"
      type="hidden" value="jq('#' + 'u324_add').click(function(e) { alert('click'); }

      );" script="first_run">
      <span id="u324_add_attribute_markers"></span>
      <span id="u324_add_attribute_info_message"></span>
      </span>

      Here the jq selector is 'u324_add' which is the id for the visible input field. I assume the DropdownControl and maybe some others have the same problem as the CheckboxControl.

        Issue Links

          Activity

          Hide
          Jerry Neal (Inactive) added a comment -

          Dan,

          I think this is probably not an issue in 2.2 with the work that has been done with IDs. But we should verify.

          thanks,
          Jerry

          Show
          Jerry Neal (Inactive) added a comment - Dan, I think this is probably not an issue in 2.2 with the work that has been done with IDs. But we should verify. thanks, Jerry
          Hide
          Daniel Seibert (Inactive) added a comment -

          This issue has already been fixed.
          Verified that onClick operates as expected for checkbox controls.

          Show
          Daniel Seibert (Inactive) added a comment - This issue has already been fixed. Verified that onClick operates as expected for checkbox controls.

            People

            • Assignee:
              Daniel Seibert (Inactive)
              Reporter:
              Jerry Neal (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Structure Helper Panel