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

UIF Framework - Introduce the concept of data element attributes

    Details

    • Type: Task Task
    • Status: Closed Closed
    • Priority: Critical Critical
    • 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-4718Generalize data dictionary section structure and introduce Group concept
      KULRICE-7488Uif-DropdownControl style not propagated to <select> element
      KULRICE-5437UIF Framework - Add standard markup for table semantics
      KULRICE-8899Introduce LocalCurrency and LocalDecimal data types
      KULRICE-9118Implement better support for a concept similar to ExternalizableBusinessObjects in the new krad-data framework
      KULRICE-5366Uif Framework - Collections: Support for duplicate key check in collections and highlighting attributes
      KULRICE-11301UIF-related annotations should not be in krad data module
      KULRICE-5282Uif Framework - Binding needs to look at forceUppercase
      KULRICE-828Unify the Node Settings concept into the Configuration framework
      KULRICE-8939Move non-UIF dependent components out of KRAD app-framework module
    • Rice Module:
      KRAD
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      In order to better support some of the upcoming features we need the facility to add additional HTML custom attributes (part of the HMTL5) spec. Here is a rough outline:

      I think this would be a good time to introduce the concept for future work (we can decide if we want to rewrite existing code later).

      Should be easy to implement:

      • Add Map<String, String> data to ComponentBase (and Component interface)
      • In attributeBuilding.tag, build up a new data variable. This would read the map entries and for each entry add the attribute with 'data- {entry.key}

        ="

        {entry.value}

        "' to the variable string.

      • Pick up the new variables from span, div tag builders and other templates after call to attributeBuilder

      Then in the script tag pass the component and call attributeBuilder, then adding the data variable would result in:

      <input type="hidden" data-role="script" data-for="u99"/>

      Then when doing refresh on the component we can find its script with:

      jq('hidden[data-role="script"][data-for="' + componentId + '"])

        Issue Links

          Activity

          Hide
          Brian Smith (Inactive) added a comment -

          Implementation in code is sligtly different, same concepts

          Show
          Brian Smith (Inactive) added a comment - Implementation in code is sligtly different, same concepts
          Hide
          Jerry Neal (Inactive) added a comment -

          Brian,

          The one thing I didn't see is where we are picked up the dataAttributes map and building the attributes for the component element tag. I see we are using it for script, but not others.

          For example I was thinking the attributeBuilder.tag would pick up any entries in the map and then build the tag attributes and values (as described in the Jira description), then the caller (for example the for the group div or other components) would pick up the $

          {data}

          variable and add it to the tag.

          If you didn't get to this I can assign it to someone else. You have plenty of other things to work on.

          thanks,
          Jerry

          Show
          Jerry Neal (Inactive) added a comment - Brian, The one thing I didn't see is where we are picked up the dataAttributes map and building the attributes for the component element tag. I see we are using it for script, but not others. For example I was thinking the attributeBuilder.tag would pick up any entries in the map and then build the tag attributes and values (as described in the Jira description), then the caller (for example the for the group div or other components) would pick up the $ {data} variable and add it to the tag. If you didn't get to this I can assign it to someone else. You have plenty of other things to work on. thanks, Jerry
          Hide
          Brian Smith (Inactive) added a comment -

          I didnt add it to attributeBuilder but the property is used by div and span tags

          Show
          Brian Smith (Inactive) added a comment - I didnt add it to attributeBuilder but the property is used by div and span tags
          Hide
          Jerry Neal (Inactive) added a comment -

          Thanks Brian,
          I think might be good to add to attribute builder and then we can use it from all our elements.

          I'll open back up and have another dev do the work so you can continue with validation messages.

          Jerry

          Show
          Jerry Neal (Inactive) added a comment - Thanks Brian, I think might be good to add to attribute builder and then we can use it from all our elements. I'll open back up and have another dev do the work so you can continue with validation messages. Jerry
          Hide
          Brian Smith (Inactive) added a comment - - edited

          Sorry I wasnt exactly clear, it is available on all components already without AttributeBuilder, there is a getter that has the string already setup you just need to add it to the tags where necessary, right now they are only on span and div, see those tag files. We do need to add it to every control and ContentElement in addition though

          Show
          Brian Smith (Inactive) added a comment - - edited Sorry I wasnt exactly clear, it is available on all components already without AttributeBuilder, there is a getter that has the string already setup you just need to add it to the tags where necessary, right now they are only on span and div, see those tag files. We do need to add it to every control and ContentElement in addition though
          Hide
          Jerry Neal (Inactive) added a comment -

          Eric,

          Please see Brian's last comment. Basically just look at the div tag where it includes the data attributes from component, and include that for the other templates (all controls, image, link, label, iframe, action buttons/links/images, message field, and so on)

          thanks,
          Jerry

          Show
          Jerry Neal (Inactive) added a comment - Eric, Please see Brian's last comment. Basically just look at the div tag where it includes the data attributes from component, and include that for the other templates (all controls, image, link, label, iframe, action buttons/links/images, message field, and so on) thanks, Jerry
          Hide
          Eric Njogu (Inactive) added a comment -

          Most of the controls support data element attributes except the radio button - which is rendered as a multiple input elements, each with a different id. Should the data attributes be placed on the wrapping div in this case?

          Show
          Eric Njogu (Inactive) added a comment - Most of the controls support data element attributes except the radio button - which is rendered as a multiple input elements, each with a different id. Should the data attributes be placed on the wrapping div in this case?

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Structure Helper Panel