on 04-15-2014 2:34 PM
Hi there,
my question is simple :
How can i pass some parameters into a function attached to a button in an XML View.
Here is my code :
<m:Button text="Delete" press="deleteThisData"></m:Button>
I wanted something like :
<m:Button text="Delete" press="[{0:'Data1',1:'Data2'}, deleteThisData"></m:Button>
I know how it works with an JS View but i do not know how to translate it
Can somebody explain how it works?
Regards,
Hi Marc,
this notation is currently not supported, but thanks for the suggestion!
You can use custom data to attach information to the control and then read it in the event handler.
E.g.:
<Button text="{/actionName}" app:mydata="abc" press="doSomething"></Button>
(define the namespace "app" as well!)
and then:
doSomething: function(evt) {
alert("data was: " + evt.getSource().data("mydata"));
}
See
http://jsbin.com/openui5-customdata-xmlview/1/edit
Regards
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i'm not sure what you want to do, but here is an example - you can select multiple items and delete them using "delete" button.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.