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

Create HTML lists from simple String list property values

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.1
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-8425Problems with UifBeanFactoryPostProcessor expression handling for nested properties and lists prevent bean property overrides (such as fieldInquiry.render) from working
      KULRICE-4478HTML padded with spaces breaking hyperlink
      KULRICE-9735Property editor class is initiated Previously with the list<String or any type> but after 2.2.0 upgrade its not happening.
      KULRICE-3829KNS RoutingTypeDefinition processing is relying on consistent ordering of two separate lists to hook the right qualificationAttributeName with the right value
      KULRICE-7563Easy display of List<String> NEW control(s)
      KULRICE-9060add property "additionalCssClasses" to replace "cssClasses" list-merge
      KULRICE-11279Default StringListConverter to generate mergeable lists
      KULRICE-9883Boolean property value is evaluated as string instead of a boolean
      KULRICE-9240UifBooleanEditor Property Editor formatted string values
      KULRICE-7502ObjectUtils could not create Object from a collection property with null value
    • Rice Module:
      KRAD
    • Application Requirement:
      KS
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      String Lists should be rendered as HTML List when bound to an attribute field

      Skype Conversation around this:

      @Jeremy: You are right I can directly bind a AttributeField to a List<String> but then it renders the value as [value1, value2, value3,....]

      Kamal Muthuswamy: We want the values to be rendered stacked one on top of the other
      That is why I was thinking maybe binding ti to a CollectionGroup with stacked layoutmanager

      Brian Smith: itd be nice to have the ability to output as an actual html list too
      Kamal Muthuswamy: at the very least, yes
      Kamal Muthuswamy: that way we can controll the style
      Kamal Muthuswamy: is that a JIRA?
      Jerry Neal: Ok, I see. Let me think. One thing you can do is apply a formatter class (in the recent beta it was changed to property editor). That can be used to build an html list from the property values and then (if editable) populate back from the html

      Jerry Neal: So you can create a new class that extends Formatter (CollectionFormatter is an example). Then on your AttributeField specify to use that with the formatterClass property. The Formatter gets called when writing out the value and passes in the value from the object, you use that to build a string which is what will be displayed.
      Jerry Neal: Actually CollectionFormatter is probably what is making in come out the way it is now. The formatter you specify will override that

      Brian Smith: so maybe jira should be add list formatter?
      Jerry Neal: We can create one in the Rice project then when someone needs this they can just specify it. We are using PropertyEditors now though instead of Formatter. Yes that would be great Brian

        Issue Links

          Activity

          Hide
          Jerry Neal (Inactive) added a comment -

          More discussion. Using PropertyEditor for this purpose will cause problems:

          [3:11:06 PM] Scott Gibson: im confused, you can use propertyEditor to draw multiple inputs?
          [3:11:56 PM] Jerry Neal: I think this case is readonly, so it building a list for the property with each value in a list item
          [3:12:26 PM] Jerry Neal: For edit, the multi-value control would make the inputs for each value
          [3:12:38 PM] Scott Gibson: so PE return a List<>
          [3:12:57 PM] Jerry Neal: It returns a string of html content
          [3:13:30 PM] Scott Gibson: ah, so faking spring out a bit
          [3:13:50 PM] Jerry Neal: ? not sure what you mean
          [3:14:14 PM] Scott Gibson: PE supposed to return text version of object, not html
          [3:15:18 PM] Jerry Neal: right, but text or string same thing right? We are using them to format for presentation. I think using the spring formatter would have been better but we couldn't get the hooks needed
          [3:17:23 PM] Scott Gibson: well, the text/string version would normally get passed to a spring tag, so that wouldnt work. good solution for now, we need real support though... 2.1
          [3:20:10 PM] Jerry Neal: Oh shoot, I see what you are saying. When the field is editable the PE will still get applied, and we will covert the value to HTML string which it will then try to use with the control. good point. I think we kind of had issues liek this in KNS with formatters, and possibly only applied them when the value was readonly? That has some shortcomings though because you might want to format the value for edit as well.

          Show
          Jerry Neal (Inactive) added a comment - More discussion. Using PropertyEditor for this purpose will cause problems: [3:11:06 PM] Scott Gibson: im confused, you can use propertyEditor to draw multiple inputs? [3:11:56 PM] Jerry Neal: I think this case is readonly, so it building a list for the property with each value in a list item [3:12:26 PM] Jerry Neal: For edit, the multi-value control would make the inputs for each value [3:12:38 PM] Scott Gibson: so PE return a List<> [3:12:57 PM] Jerry Neal: It returns a string of html content [3:13:30 PM] Scott Gibson: ah, so faking spring out a bit [3:13:50 PM] Jerry Neal: ? not sure what you mean [3:14:14 PM] Scott Gibson: PE supposed to return text version of object, not html [3:15:18 PM] Jerry Neal: right, but text or string same thing right? We are using them to format for presentation. I think using the spring formatter would have been better but we couldn't get the hooks needed [3:17:23 PM] Scott Gibson: well, the text/string version would normally get passed to a spring tag, so that wouldnt work. good solution for now, we need real support though... 2.1 [3:20:10 PM] Jerry Neal: Oh shoot, I see what you are saying. When the field is editable the PE will still get applied, and we will covert the value to HTML string which it will then try to use with the control. good point. I think we kind of had issues liek this in KNS with formatters, and possibly only applied them when the value was readonly? That has some shortcomings though because you might want to format the value for edit as well.
          Hide
          Jessica Coltrin (Inactive) added a comment -

          Looks like a Phase 2 item, so setting fixVersion to 2.1. Please comment if it's needed for 2.0.

          Show
          Jessica Coltrin (Inactive) added a comment - Looks like a Phase 2 item, so setting fixVersion to 2.1. Please comment if it's needed for 2.0.
          Hide
          Brian Smith (Inactive) added a comment - - edited

          This is resolved using a different approach, see readOnlyListDisplayType and readOnlyListDelimiter options on DataField in 2.2 rc1. Note this includes automatic readOnly conversion for MultiValueControl types as well and any DataFields that use List<?> where ? is a simple type.

          Show
          Brian Smith (Inactive) added a comment - - edited This is resolved using a different approach, see readOnlyListDisplayType and readOnlyListDelimiter options on DataField in 2.2 rc1. Note this includes automatic readOnly conversion for MultiValueControl types as well and any DataFields that use List<?> where ? is a simple type.
          Hide
          Jessica Coltrin (Inactive) added a comment -

          Since these were fixed on the trunk, they are 2.3.

          Show
          Jessica Coltrin (Inactive) added a comment - Since these were fixed on the trunk, they are 2.3.

            People

            • Assignee:
              Brian Smith (Inactive)
              Reporter:
              Kamal Muthuswamy (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Structure Helper Panel