Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Couldn't able to supply a value to an xml field using local model

$
0
0

Hi ,

     I am trying to dynamically validate my form fields from the model values as shown in the below lines of code.

 

 

<Label text="Name1" />

         <Input class="sapUiSmallMarginBottom"

        id="name1" placeholder="Enter Name ..."

        type="Text" liveChange="addressValidation"

        value="{ path : 'mainModel>/Address/Name1',

                     type : 'sap.ui.model.type.String',

                     constraints : { minLength: 3, maxLength: 'metaAddress>/AddressValidation/0/maxLength' }}" 

         valueStateText="Name must not be empty. Maximum 10 characters."/>

 

 

here validation is successful if i use the direct numbers for the propertie "minLength : 3". but i want to provide that value form my model.I have tried several ways but unsuccessful. Can any one hlep me out.

 

Below are the ways i tried.

 

1. maxLength: 'metaAddress>/AddressValidation/0/maxLength'

2. maxLength: {metaAddress>/AddressValidation/0/maxLength}

3. maxLength: '{metaAddress>/AddressValidation/0/maxLength}'

4. maxLength: "{metaAddress>/AddressValidation/0/maxLength}"

5. maxLength: "metaAddress>/AddressValidation/0/maxLength"

 

 

And there is no problem in  getting the values form model.


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>