Skip to Content
0

oData Binding to Simple Form

Feb 21 at 10:30 PM

68

avatar image

I'm creating a read only form that will be used to display a summary of information. I need to send a parameter to the backend first before getting the information but I don't seem to see that parameter is reaching it.

It does reach the entity set but it does not show the parameter. Am I binding correctly?

This is on the controller:

onInit: function() {

    var urlEnding = "1000012233";
        var oFilterDist = new sap.ui.model.Filter("ID", 
          sap.ui.model.FilterOperator.EQ, urlEnding);
        var summaryText = this.getView().byId("summaryForm");
        summaryText.bindElement({
            path: "/SummaryScreenSet",
            filters: [oFilterDist]
        });
    }

View:

<VBox class="sapUiSmallMargin" fitContainer="true" 
height="100%" width="100%" justifyContent="End" 
displayInline="true" id="leftVBox" items="{/SummaryScreenSet}">

<items>
    <f:SimpleForm editable="true" layout="ResponsiveGridLayout" 
id="summaryForm" columnsL="1" columnsXL="1" labelSpanL="5" 
title="Account Summary" labelSpanM="5">
      <f:content>
         <Label text="Status" id="__label6" design="Bold" class="sizeText"/>
        <ObjectStatus text="{CONTRACT_STATUS}" id="__status6" state="Success" class="boldText"/>
        <Label text="Permit Required" id="__label10" design="Bold" class="sizeText"/>
        <Text text="{PERMIT_REQD}" id="__text32" wrapping="false" class="sizeText"/>
        <Label text="Bill Date | Due Date" id="__label11" design="Bold" class="sizeText"/>
        <Text text="{BILL_DATE} | {DUE_DATE}" id="__text33" wrapping="false" class="sizeText"/>
        <Label text="Last Estimated Date | Next MR Date" id="__label17" design="Bold" class="sizeText"/>
        <Text text="{LAST_PAYMENT_DATE} | {nextMRDate}" id="__text39" wrapping="false" class="sizeText"/>
        </f:content>
    </f:SimpleForm>
 </items>
</VBox>

Thank You!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Jun Wu Feb 22 at 02:35 AM
0

if you know the id of the record, it should be

 summaryText.bindElement({
            path:"/SummaryScreenSet('"+urlEnding+"')"});
Show 5 Share
10 |10000 characters needed characters left characters exceeded

Thanks Jun, but I need it to go to the Get Entity Set since there may be multiple accounts with urlEnding number. Right now urlEnding is hardcoded but I will be getting different numbers based on the url. When I apply the filter, it does reach the get Entity Set but I do not see the value (1000012233) being sent or ID.

0

the idea(bind element) is you have to bind to specific record, you cannot bind to a model, which may only have one record.

usually you will display a table first, then you select one record(this is how you locate the specific record), which then can be bound to the form using element binding.

what is your start point? you don't have that table?

0

ok, Thanks! I understand now. I wasn't understanding why it was going to the GET ENTITY instead of the GET ENTITY SET. The start point is a form which will have a dropdown box listing multiple accounts. The view of the form will change if selecting another account from the dropdown box.

0

So are you going to be getting this "id" as part of your route? (ie. in the url and the route will handle it?) or is this all one same page and will change auto-magically as user selects "ids"? Or like a list of items but you will filter to ones where ID is all the same?

0
Christopher Solomon

yes, this form will be in-bedded in another application that will supply the id in the url. The form will changed based on the ID. Thanks

0