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

HiddenFields are not submitted when part of progressive rendered section.

    Details

    • Type: Bug Fix Bug Fix
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.2
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
    • Similar issues:
      KULRICE-13175Progressive render and refresh not working in dialog
      KULRICE-5765Styling problem where a component will be progressively rendered
      KULRICE-6462Progressive render of "All or First Action" field in PeopleFlow member add section is broken
      KULRICE-8362Dialog: Progressive Render doesn't work when lightbox is opened for second time
      KULRICE-5835changes to a field populated by fieldAttributeQuery.returnFieldMapping doesn't trigger progressive rendering based on that value
      KULRICE-11064Progressive Render - Required field validation issue on Save button click
      KULRICE-9801non-DialogGroup dialog from hidden section appears on submit
      KULRICE-11399Progressive render and refresh doesn't work due to missing copy
      KULRICE-5499Rice Dev: Opening Saved Create Person eDocs with more than Name in Contact section won't render
      KULRICE-6495When a field is refreshed that triggers a progressive disclosure condition, the check for progressive disclosure is not triggered
    • Rice Module:
      KRAD
    • Application Requirement:
      KS
    • Sprint:
      2.4.0-m4 KRAD Sprint 3, 2.5.0-m3 Sprint 1, Core 2.5.0-m3 Sprint 2, Core 2.5.0-m4 Sprint 1, Core 2.5.0-m4 Sprint 2, Core 2.5.0-m5 Sprint 1, Core 2.5.0-m5 Sprint 2
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes

      Description

      When hidden fields (Uif-HiddenControl), are part of a section that is displayed/hide by progressive rendering, krad is also disabling the field. Because disabled fields are not submitted as part of a form, the data is getting lost.

      This problem occurs at:
      1) Open the "Manage Final Exam Matrix" in Enrollment.
      2) Select "Fall Term" and click "Show".
      3) In the "Common Final Exam" table, click "Edit" on the first line.
      4) Select the proposition/rule statement and click on the "Edit" button.
      5) Select "Course Sets" in the drop down.
      6) Click on "Advanced Search" and search for a course set and select one.
      7) Click on the "Add" button.

      Expected: Course Set should be added to the list.
      Note: This currently works because of workaround added to
      LUCustomComponents.xml implemented on KSENROLL-10055

        <!--TODO KSENROLL-10558: remove this once krad jira is fixed.-->
          <property name="onChangeScript">
            <value>
              jQuery("input[id='cluSetId_add_control']").removeAttr("disabled");
            </value>
          </property>
      

        Issue Links

          Activity

          Hide
          Shannon Hess added a comment -

          Larry,

          I'm hoping to look at the enrollment code for this issue so I can determine exactly how to reproduce on the rice side but I've been unable to find it. I have https://svn.kuali.org/repos/student/enrollment/ks-enroll/trunk checked out and I'm not seeing the hidden field referred to in this JIRA. Could you point me towards the correct branch or tag that I should be using?

          Thanks,
          Shannon

          Show
          Shannon Hess added a comment - Larry, I'm hoping to look at the enrollment code for this issue so I can determine exactly how to reproduce on the rice side but I've been unable to find it. I have https://svn.kuali.org/repos/student/enrollment/ks-enroll/trunk checked out and I'm not seeing the hidden field referred to in this JIRA. Could you point me towards the correct branch or tag that I should be using? Thanks, Shannon
          Show
          Larry Symms added a comment - example is located here: https://svn.kuali.org/repos/student/enrollment/ks-lum/trunk/ks-lum-ui/src/main/resources/org/kuali/student/lum/lu/ui/krms/LUCustomComponents.xml project url (has externals): https://svn.kuali.org/repos/student/enrollment/aggregate/trunk
          Hide
          Shannon Hess added a comment -

          Larry,

          Thanks for giving me the code location, that helped a lot. I've reproduced the problem locally and just committed a fix. If someone could bring in the latest rice code to verify the fix worked for you as well that would be great.

          Thanks,
          Shannon

          Show
          Shannon Hess added a comment - Larry, Thanks for giving me the code location, that helped a lot. I've reproduced the problem locally and just committed a fix. If someone could bring in the latest rice code to verify the fix worked for you as well that would be great. Thanks, Shannon
          Hide
          Shannon Hess added a comment -

          Notes:

          The problem was due to the following code in ComponentBase.Java which set the style of the component to "display: none;" if the field is progressively rendered. I wasn't able to determine exactly why this caused an issue for Uif-HiddenControl fields, but the style is not a factor since these fields are never seen. I made a fix that sets the style back to null for Uif-HiddenControl fields in HiddenControl.java

          in ComponentBase.Java

                  boolean hide = false;
                  if (!this.render && !this.progressiveRenderViaAJAX && !this.progressiveRenderAndRefresh && StringUtils.isNotBlank(progressiveRender)) {
                      hide = true;
                  } else if (this.isHidden()) {
                      hide = true;
                  }
          
                  if (hide) {
                      if (StringUtils.isNotBlank(this.getStyle())) {
                          ...
                      } else {
                          this.setStyle("display: none;");
                      }
                  }
          

          To reproduce and test I added the following to TermBo.xml. When testing, the lookup for specificationId should not be used - Just enter "T1000" in the specificationId field and tab off the field to cause the progressively rendered description to appear. The description can be entered manually by editing the HTML. Before making my coding fix, the manually entered description would not be submitted with the form and the description would be null in the database. After applying my fix, I was successfully able to add and submit a description.

          in TermBo.xml

          <bean parent="Uif-InputField" p:propertyName="description" p:label="Description" p:progressiveRender="@{!#empty(#dp.specificationId)}">
              <property name="control">
                  <bean parent="Uif-HiddenControl"/>
              </property>
          </bean>
          
          Show
          Shannon Hess added a comment - Notes: The problem was due to the following code in ComponentBase.Java which set the style of the component to "display: none;" if the field is progressively rendered. I wasn't able to determine exactly why this caused an issue for Uif-HiddenControl fields, but the style is not a factor since these fields are never seen. I made a fix that sets the style back to null for Uif-HiddenControl fields in HiddenControl.java in ComponentBase.Java boolean hide = false ; if (! this .render && ! this .progressiveRenderViaAJAX && ! this .progressiveRenderAndRefresh && StringUtils.isNotBlank(progressiveRender)) { hide = true ; } else if ( this .isHidden()) { hide = true ; } if (hide) { if (StringUtils.isNotBlank( this .getStyle())) { ... } else { this .setStyle( "display: none;" ); } } To reproduce and test I added the following to TermBo.xml. When testing, the lookup for specificationId should not be used - Just enter "T1000" in the specificationId field and tab off the field to cause the progressively rendered description to appear. The description can be entered manually by editing the HTML. Before making my coding fix, the manually entered description would not be submitted with the form and the description would be null in the database. After applying my fix, I was successfully able to add and submit a description. in TermBo.xml <bean parent= "Uif-InputField" p:propertyName= "description" p:label= "Description" p:progressiveRender= "@{!#empty(#dp.specificationId)}" > <property name= "control" > <bean parent= "Uif-HiddenControl" /> </property> </bean>
          Hide
          Larry Symms added a comment - - edited

          the cloned issue is our local tracking, so once that's closed you will know it's been verified fixed. feel free to close this issue, we will re-open if necessary

          Show
          Larry Symms added a comment - - edited the cloned issue is our local tracking, so once that's closed you will know it's been verified fixed. feel free to close this issue, we will re-open if necessary
          Hide
          SW Genis (Inactive) added a comment - - edited

          I removed the workaround that we implemented in KS with Rice 2.4 but unfortunately we still get the same error as previously. When we search for a courseset the id is returned but when we click add, the id is not part of the request parameters. When we do it a second time the id is part of the request parameters and the model is therefore correctly updated.

          With the workaround code the id is always part of the request parameters when add button is clicked. If i remembers correctly, before the rice upgrade it did not even work on a second add so i am thinking that the solution is only executed once the add button is clicked and should be performed earlier.

          Show
          SW Genis (Inactive) added a comment - - edited I removed the workaround that we implemented in KS with Rice 2.4 but unfortunately we still get the same error as previously. When we search for a courseset the id is returned but when we click add, the id is not part of the request parameters. When we do it a second time the id is part of the request parameters and the model is therefore correctly updated. With the workaround code the id is always part of the request parameters when add button is clicked. If i remembers correctly, before the rice upgrade it did not even work on a second add so i am thinking that the solution is only executed once the add button is clicked and should be performed earlier.
          Hide
          Shannon Hess added a comment -

          KS Team,

          Thanks for the extra info. I was able to reproduce the problem by setting up a similar situation on the travel account creation screen. To fix the issue, I made a change so that HiddenControl fields are not disabled when they are part of a progressively rendered section. However, I also wanted to clarify that they will now never be disabled, even when disabled = "true" on the KS-Uif-HiddenControl bean. I did verify that this is the same behavior that currently occurs for any HiddenControl field – they are never disabled and it doesn't matter if they are a part of a progressively rendered section or not. I'm in the process of trying to determine if this is a bug or not, but the javadoc for HiddenControl.java says they are used " to hold a value that the user will not see but will be posted back with the form" so my thought is that it should never be expected that they would be disabled.

          Is this what you would expect? Is there ever a situation where you would NOT want the HiddenControl field to be posted back to the form?

          Thank you,
          Shannon

          For my info:
          Beans used for testing – I changed TravelAccount-MaintenanceView bean in TravelAccountMaintenance.xml and added one new bean

            <bean id="TravelAccount-MaintenanceView" parent="Uif-MaintenanceView">
              <property name="headerText" value="Travel Account Maintenance"/>
              <property name="dataObjectClassName" value="org.kuali.rice.krad.demo.travel.dataobject.TravelAccount"/>
              <property name="items">
                <list merge="true">
                  <bean parent="Uif-MaintenanceGridSection">
                    <property name="headerText" value="Account Information"/>
                    <property name="items">
                      <list>
                        <bean parent="Uif-InputField" p:propertyName="number"/>
                        <bean parent="Uif-InputField" p:propertyName="name"/>
                        <bean parent="Uif-InputField" p:propertyName="accountTypeCode" p:required="true" />
                        <bean parent="Uif-InputField" p:propertyName="foId"/>
                        <bean parent="Uif-InputField" p:propertyName="createDate" p:readOnly="true" p:defaultValue="#{T(org.joda.time.DateTime).now().toDate()}"/>
                        <bean parent="Uif-InputField" p:propertyName="subsidizedPercent"/>
                      </list>
                    </property>
                  </bean>
                  <bean parent="Uif-MaintenanceStackedCollectionSection">
                    <property name="layoutManager">
                      <bean parent="Uif-StackedCollectionLayout-WithBoxItems">
                        <property name="summaryFields" value="subAccount"/>
                        <property name="addLineGroup">
                          <bean parent="Uif-CollectionHorizontalBoxItem" p:progressiveRender="@{!#empty(#dp.name)}"/>
                        </property>
                      </bean>
                    </property>
                    <property name="headerText" value="Sub Accounts"/>
                    <property name="collectionObjectClass" value="org.kuali.rice.krad.demo.travel.dataobject.TravelSubAccount"/>
                    <property name="propertyName" value="subAccounts"/>
                    <property name="items">
                      <list>
                        <bean parent="Uif-InputField" p:propertyName="subAccount" p:uppercaseValue="true" p:readOnly="@{!#isAddLine}">
                        <property name="quickfinder">
                            <bean parent="Uif-QuickFinder">
                              <property name="dataObjectClassName"  value="org.kuali.rice.krad.demo.travel.dataobject.TravelSubAccount"/>
                              <property name="fieldConversions">
                                <map>
                                  <entry key="travelAccountNumber" value="subAccount"/>
                                  <entry key="subAccountName" value="subAccountName"/>
                                </map>
                              </property>
                              <property name="quickfinderAction">
                                <bean parent="Uif-ActionLink" p:actionLabel="Advanced Search" p:style="display:block" p:methodToCall="performLookup"/>
                              </property>
                              <property name="lightBox">
                                <bean parent="Uif-LightBox" p:lookupReturnByScript="false"/>
                              </property>
                            </bean>
                        </property>
                        </bean>
                        <bean parent="Uif-InputField" p:propertyName="subAccountName" p:required="@{!#isAddLine}">
                          <property name="control">
                            <bean parent="KS-Uif-HiddenControl"/>
                          </property>
                        </bean>
                      </list>
                    </property>
                    <property name="duplicateLinePropertyNames">
                      <list>
                        <value>subAccount</value>
                      </list>
                    </property>
                    <property name="lineActions">
                      <list>
                        <bean parent="Uif-DeleteLineAction" p:render="@{isAddedCollectionItem(#line)}"/>
                        <bean parent="Uif-SaveLineAction"/>
                      </list>
                    </property>
                    <property name="layoutManager.summaryTitle" value="Sub Account"/>
                    <property name="layoutManager.summaryFields">
                      <list>
                        <value>subAccount</value>
                      </list>
                    </property>
                  </bean>
                </list>
              </property>
            </bean>
          
            <bean id="KS-Uif-HiddenControl" parent="KS-Uif-HiddenControl-parent"/>
            <bean id="KS-Uif-HiddenControl-parent" parent="Uif-HiddenControl">
              <property name="toolTip">
                <null/>
              </property>
            </bean>
          
          Show
          Shannon Hess added a comment - KS Team, Thanks for the extra info. I was able to reproduce the problem by setting up a similar situation on the travel account creation screen. To fix the issue, I made a change so that HiddenControl fields are not disabled when they are part of a progressively rendered section. However, I also wanted to clarify that they will now never be disabled, even when disabled = "true" on the KS-Uif-HiddenControl bean. I did verify that this is the same behavior that currently occurs for any HiddenControl field – they are never disabled and it doesn't matter if they are a part of a progressively rendered section or not. I'm in the process of trying to determine if this is a bug or not, but the javadoc for HiddenControl.java says they are used " to hold a value that the user will not see but will be posted back with the form" so my thought is that it should never be expected that they would be disabled. Is this what you would expect? Is there ever a situation where you would NOT want the HiddenControl field to be posted back to the form? Thank you, Shannon For my info: Beans used for testing – I changed TravelAccount-MaintenanceView bean in TravelAccountMaintenance.xml and added one new bean <bean id= "TravelAccount-MaintenanceView" parent= "Uif-MaintenanceView" > <property name= "headerText" value= "Travel Account Maintenance" /> <property name= "dataObjectClassName" value= "org.kuali.rice.krad.demo.travel.dataobject.TravelAccount" /> <property name= "items" > <list merge= " true " > <bean parent= "Uif-MaintenanceGridSection" > <property name= "headerText" value= "Account Information" /> <property name= "items" > <list> <bean parent= "Uif-InputField" p:propertyName= "number" /> <bean parent= "Uif-InputField" p:propertyName= "name" /> <bean parent= "Uif-InputField" p:propertyName= "accountTypeCode" p:required= " true " /> <bean parent= "Uif-InputField" p:propertyName= "foId" /> <bean parent= "Uif-InputField" p:propertyName= "createDate" p:readOnly= " true " p:defaultValue= "#{T(org.joda.time.DateTime).now().toDate()}" /> <bean parent= "Uif-InputField" p:propertyName= "subsidizedPercent" /> </list> </property> </bean> <bean parent= "Uif-MaintenanceStackedCollectionSection" > <property name= "layoutManager" > <bean parent= "Uif-StackedCollectionLayout-WithBoxItems" > <property name= "summaryFields" value= "subAccount" /> <property name= "addLineGroup" > <bean parent= "Uif-CollectionHorizontalBoxItem" p:progressiveRender= "@{!#empty(#dp.name)}" /> </property> </bean> </property> <property name= "headerText" value= "Sub Accounts" /> <property name= "collectionObjectClass" value= "org.kuali.rice.krad.demo.travel.dataobject.TravelSubAccount" /> <property name= "propertyName" value= "subAccounts" /> <property name= "items" > <list> <bean parent= "Uif-InputField" p:propertyName= "subAccount" p:uppercaseValue= " true " p:readOnly= "@{!#isAddLine}" > <property name= "quickfinder" > <bean parent= "Uif-QuickFinder" > <property name= "dataObjectClassName" value= "org.kuali.rice.krad.demo.travel.dataobject.TravelSubAccount" /> <property name= "fieldConversions" > <map> <entry key= "travelAccountNumber" value= "subAccount" /> <entry key= "subAccountName" value= "subAccountName" /> </map> </property> <property name= "quickfinderAction" > <bean parent= "Uif-ActionLink" p:actionLabel= "Advanced Search" p:style= "display:block" p:methodToCall= "performLookup" /> </property> <property name= "lightBox" > <bean parent= "Uif-LightBox" p:lookupReturnByScript= " false " /> </property> </bean> </property> </bean> <bean parent= "Uif-InputField" p:propertyName= "subAccountName" p:required= "@{!#isAddLine}" > <property name= "control" > <bean parent= "KS-Uif-HiddenControl" /> </property> </bean> </list> </property> <property name= "duplicateLinePropertyNames" > <list> <value>subAccount</value> </list> </property> <property name= "lineActions" > <list> <bean parent= "Uif-DeleteLineAction" p:render= "@{isAddedCollectionItem(#line)}" /> <bean parent= "Uif-SaveLineAction" /> </list> </property> <property name= "layoutManager.summaryTitle" value= "Sub Account" /> <property name= "layoutManager.summaryFields" > <list> <value>subAccount</value> </list> </property> </bean> </list> </property> </bean> <bean id= "KS-Uif-HiddenControl" parent= "KS-Uif-HiddenControl-parent" /> <bean id= "KS-Uif-HiddenControl-parent" parent= "Uif-HiddenControl" > <property name= "toolTip" > < null /> </property> </bean>
          Hide
          Shannon Hess added a comment -

          I talked to Jerry and Kristina about this issue - Jerry agreed that hidden fields should never be disabled. I committed the coding changes and now hidden fields will work as expected.

          Thanks,
          Shannon

          Show
          Shannon Hess added a comment - I talked to Jerry and Kristina about this issue - Jerry agreed that hidden fields should never be disabled. I committed the coding changes and now hidden fields will work as expected. Thanks, Shannon
          Hide
          Shannon Hess added a comment -

          Attaching email between Jerry and I to explain in more detail what changes were made.

          Show
          Shannon Hess added a comment - Attaching email between Jerry and I to explain in more detail what changes were made.

            People

            • Assignee:
              Shannon Hess
              Reporter:
              Larry Symms
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2 days Original Estimate - 2 days
                2d
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 2 hours
                2d 2h

                  Agile

                    Structure Helper Panel