on 01-14-2015 10:00 AM
Hello Friends,
I have a scenario where I have to pass the context of oController into the formatter function as inside the formatter function I want to access function belonging to oController. Below is code sample:
new sap.m.Input('payOut', {
value: '',
fomratter: oController.formatPayOutAmount
})
Now inside fomatPayOutAmount() I want "this" to refer to oController.
Obvioulsy [fomratter: oController.formatPayOutAmount , oController] is not working.
Regards,
Chidan
Hi Murthy,
Have you tried this.
new sap.m.Input('payOut', {
value: "",
formatter: [oController.formatPayOutAmount ,oController]
});
Thank you.
Regards,
Pruthvi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pruthvi,
This doesnt work, please read my quesion fully.
You can play around in the example I have created below.
Hi Chida,
Found a fix,
This works fine.
Regards,
Pruthvi.
Hi Pruthvi,
Althoug the question is answered, could you please extend your answer to cover below point.
How to make sure formatter is called when the data is changed in the binded field. For now formatter is only called once during instantiation.
I tried to use model.refresh() and model.checkUpdate(), but model.refresh sets it to initail binded value and checkUpdate() is private method and if you see internally checkUpdate() also calls refresh()
Regards,
Chidan
User | Count |
---|---|
76 | |
11 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.