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

BindingInfo.bindToForm doesn't apply when in a collection

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Rice Module:
      KRAD
    • Application Requirement:
      KC
    • Sprint:
      UXI 2.5.0-m6 Sprint 1
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes

      Description

      Attempting to use bindToForm on an input field in a collection does not have the desired affect of actually binding to the form. In the example below the finalBudgetId will still be bound to the collection object despite having bindToForm set to true.

      <bean id="PropDev-BudgetPage-Collection" parent="PropDev-BudgetPage-Collection-parentBean" />
      	<bean id="PropDev-BudgetPage-Collection-parentBean"
      		parent="Uif-TableCollectionSection" p:title="Budget" p:propertyName="document.developmentProposal.budgets"
      		p:headerText="Budgets" 
      		p:collectionObjectClass="org.kuali.coeus.propdev.impl.budget.ProposalDevelopmentBudgetExt"
      		p:renderAddLine="false" p:renderLineActions="false">
      		<property name="items">
      			<list>
      				<bean parent="Uif-InputField" p:propertyName="document.developmentProposal.finalBudgetId" p:bindingInfo.bindToForm="true"
      					p:label="" p:readOnly="false" p:order="10" p:cssClasses="one_required">
      					<property name="control">
      						<bean parent="Uif-VerticalRadioControl">
      							<property name="options">
      								<list>
      									<bean parent="Uif-KeyLabelPair" p:key="@{#line.budgetId}" p:value="" />
      								</list>
      							</property>
      						</bean>
      					</property>
      					<property name="onClickScript"
      						value="Kc.PropDev.Personnel.unselectCollectionRadioButtons(this, &quot;input[name$='selected']&quot;);" />
      				</bean>
      				<bean parent="Uif-LinkField" p:fieldLabel.labelText="Name"
      					p:href="proposalBudget?methodToCall=start&amp;budgetId=@{#line.budgetId}"
      					p:linkText="@{#line.name}" p:order="20" />
      				<bean parent="Uif-DataField" p:propertyName="totalDirectCost" p:order="30" />
      				<bean parent="Uif-DataField" p:propertyName="totalIndirectCost" p:order="40" />
      				<bean parent="Uif-DataField" p:propertyName="totalCost" p:order="50" />
      				<bean parent="Uif-DataField" p:propertyName="comments" p:order="60" />
      			</list>
      		</property>
      </bean>
      

      This appears to occur due to code in ViewModelUtils.getParentObjectPath still returning the parent object despite the property.

        Attachments

          Activity

          Hide
          kbtaylor Kristina Taylor (Inactive) added a comment -

          So what you're trying to do here is that you have a form with getDocument().getDevelopmentProposal().getFinalBudgetId() that also has a collection getDocument().getDevelopmentProposal().getBudgets() and you want to set which one is the final budget with a radio button? I know that the setup is entirely different (and a lot easier) when doing checkboxes, so I don't know if there's also a functional gap here. In light of that, I'm not sure if the way you are using the feature is intended. Jerry Neal, do you know if this is a bug or can KC do this a different way?

          Show
          kbtaylor Kristina Taylor (Inactive) added a comment - So what you're trying to do here is that you have a form with getDocument().getDevelopmentProposal().getFinalBudgetId() that also has a collection getDocument().getDevelopmentProposal().getBudgets() and you want to set which one is the final budget with a radio button? I know that the setup is entirely different (and a lot easier) when doing checkboxes, so I don't know if there's also a functional gap here. In light of that, I'm not sure if the way you are using the feature is intended. Jerry Neal , do you know if this is a bug or can KC do this a different way?
          Hide
          jkneal Jerry Neal (Inactive) added a comment -

          Jeff,

          Can you switch your focus to this issue?

          thanks,
          Jerry

          Show
          jkneal Jerry Neal (Inactive) added a comment - Jeff, Can you switch your focus to this issue? thanks, Jerry

            People

            • Assignee:
              jheckel Jeff Heckel (Inactive)
              Reporter:
              dpace Douglas Pace
            • Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 6 hours
                6h