Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-9846

defaultValue not applied before disabled expression evaluation on initialization

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.2
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Rice Module:
      KRAD
    • Application Requirement:
      KS My Plan
    • Sprint:
      2.3.2 Sprint 1
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes

      Description

      Using the client side disable, I have two controls set to be disabled until a radio group value equals 'course'. I have set the radio group default value to be 'course', so the option is selected on load, but the two controls are disabled initially. I can change the radio group and switch it back to 'course' and then the controls are enabled. It seems like the disabled condition is not happening initially. It appears the disabled expressions are evaluated before the default value is being applied.

      Current workaround was to set the value when defining the property in the form.

      Here are some code snippets:

      Radio group input:

      <bean parent="Uif-InputField" p:propertyName="type" p:defaultValue="course">
      <property name="control">
      <bean parent="Uif-VerticalRadioControl">
      <property name="options">
      <list>
      <bean parent="Uif-KeyLabelPair" p:key="course" p:value="Course or a course placeholder"/>
      <bean parent="Uif-KeyLabelPair" p:key="general" p:value="General placeholder"/>
      </list>
      </property>
      </bean>
      </property>
      </bean>

      Two controls that should be disabled if 'type' does not equal 'course':

      <bean parent="Uif-InputField" p:propertyName="courseCd">
      <property name="control">
      <bean parent="Uif-TextControl">
      <property name="watermarkText" value="e.g. BIOL 180"/>
      <property name="maxLength" value="11"/>
      <property name="disabled" value="@

      {#form.type NE 'course'}"/>
      </bean>
      </property>
      </bean>
      <bean parent="Uif-InputField" p:propertyName="credit">
      <property name="control">
      <bean parent="dropdownPlaceholderCredits" p:disabled="@{#form.type NE 'course'}

      "/>
      </property>
      </bean>

        Attachments

          Activity

          Hide
          garettg Garett Gowens added a comment -

          We have noticed this problem happening on progressiveRender expressions as well, where the expression is evaluated before the defaultValue is set.

          Show
          garettg Garett Gowens added a comment - We have noticed this problem happening on progressiveRender expressions as well, where the expression is evaluated before the defaultValue is set.

            People

            • Assignee:
              bsmith Brian Smith (Inactive)
              Reporter:
              garettg Garett Gowens
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day
                1d