on 12-05-2013 11:00 PM
Hi
This is the error I get when I try to assign an handler to the button press
fields: [new sap.ui.commons.TextField({value:"A22",editable:false,layoutData:new sap.ui.commons.form.GridElementData({hCells: "2"})}),
new sap.ui.commons.Button({
text:"Change",
press: this.showF4Help,
layoutData:new sap.ui.commons.form.GridElementData({hCells: "2"})})
],
ON press, it should open a dialog box displaying certain items.
The "showF4Help" is defined as a separate method in the view definition which create the layout & UI elements for the dialog.
The function is defined as,
showF4Help: function(oEvent){
<something goes here>
}
wF4HelpForTow is definWhat
What could be wrong here?
Regards
Sandip
Hi Sandip,
This error is beacuse the function is not visible in this context.
Good practice would be to have the event handler in controller.
Below example has both scenarios mentioned above
http://jsbin.com/uxokuc/237/edit
Thanks and Regards, Venkatesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandip,
The creation part could be done either in view or in controller.
Below is example with changes
http://jsbin.com/uxokuc/238/edit
ValueHelp field control might help acheive F4 value help
Thanks and Regards, Venkatesh
It is indeed a common dilemma but recently (1.16) there are Fragments which are pieces of UI that can be defined separately, and ideal for defining dialogs which you'd otherwise have to instantiate, as you say, programatically on demand, rather than in the view directly.
http://localhost:8888/sapui5/latest/docs/#docs/guide/Fragments.html
dj
HI DJ
Thanks a lot for your reply.
The "Fragments" concept look great.
What is the best way to handler such situation where you need to show pops/dialogs/overlay containers multiple times (diff content), lets says on click of each row of a table - you wan to display the details.
1) Do you generate this pop ups on the fly in the event handler?
2) Or, you create the pop up with the UI elements in the view, keep it instantiated and just call it to open in the event handler?
3) Do you assign an ID to the pop -up and re-use the same instance, or have the framework generate a new instance with a id everytime -
Thanks
Sandip
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.