on 11-01-2016 3:59 PM
Hi,
I am trying to bind the slect control to two different paths in sapui5 application.
Here is my code:
<Select id="QuotePartnerSelect" forceSelection="false" change="onSelectRole"
items="{= ${/PROCESS_TYPE} === 'ZK01' ? ${path:'HarmonyConfig>/PLACEHOLDERS/QuotationCloudPartner/PARVW'} : ${path:'HarmonyConfig>/PLACEHOLDERS/QuotationERPPartner/ERP_PARVW'} }"
selectedKey="{path:'ROLE'}">
<core:Item key="{path: 'HarmonyConfig>KEY'}"
text="{parts : [{path: 'HarmonyConfig>VALUE'}, {path: 'HarmonyConfig>FIELD_NAME'}], formatter: '.formatter.selectDeafultText' }"/>
</Select>
I looked in the developer guide for complex experession binding but i I get the error of w.push is not a function. any help would be appreciated.
I don't think you can do that with expression binding
the combobox is used in table, i want to bind it dynamically, i put a formatter in tooltip to manipulate the item binding
<comm:ComboBox tooltip="{path:'ViewModel>ATTNAME',formatter:'com.****util.Util.getItems'}" > </comm:ComboBox>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think conditional path you cannot set using expression binding.
you can try this from controller file inside routeMatched or bindingChange function of view, as
if(oModel.getProperty('/PROCESS_TYPE') == 'ZK01')
sPath = 'HarmonyConfig>/PLACEHOLDERS/QuotationCloudPartner/PARVW'
else
sPath = 'HarmonyConfig>/PLACEHOLDERS/QuotationERPPartner/ERP_PARVW'
and then
oSelect.bindItem(sPath,oTemplate) //oTemplate = this.byId(id of core:Item of select control).clone()
hope this helps.
Regards,
Akhilesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
in the error you are getting, What is w in w.push? I mean, have you defined any object with name "w"?do you have any code, which does a Push,in your controllers?
Regards,
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think the error is due to some problem in the binding of items in select control. I am using the same syntax for text controlaand maybe there is a different way to bind items based on condition. I was thinking if someone could correct my syntax for binding in select control. I will try to debug from where this w.push is coming. The issue is these xml views getloaded initially so error comes form data.js files and it is difficult to understand. I will try to find out form where is this w.push getting called.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.