on 11-11-2015 12:43 PM
Hi,
Im using a UI5 extend and I need that when I click on the button it will add new entry of the text and dropDownBox,
The button should be one only and in button click the text and DDB should be added as new controls to the UI,how I can do that currently?
Thanks
Miley
Will this help?
http://jsbin.com/limenu/edit?js,output
It is a sample example for you.
Thanks,
Karthik A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Dennis,
Thank you!
1. Just to clarify what is the reason that you create two controls?
2.is it possible to put the add and remove inside the control itself and not to call it from outside
when using the new...?
3.what is the reason for the following, this is just for the first init versions before clicking on add?
list.setModel(new sap.ui.model.json.JSONModel([]));
Best regards,
Miley
HI Miley
1. I do not see that we can have a clean implementation with only one control.
2. I will not advocate this. Controls are built so that they have no business logic.
3. this is to initialize the default model of the list to an empty array. You can try initialize it with
list.setModel(new sap.ui.model.json.JSONModel([{
{text: 'Example', value: 'A'}
}]));
Thanks
-D
Miley, are you thinking of a data driven UI ? it is possible, you need to know the control type, and its properties. in your db you would need to have tables that contain those properties. when you get that data in the ui, you will have constructors that will perform the creation of those controls and somehow you will need to know how to place those controls in the UI (placement on the screen - possibly a predefined form) I did a similar example for a form that contained: Label InputField/DropDown (this would repeat X times depending on the data I retrieved from the DB) and at the bottom of my form I had a submit button ( that post to the DB ) and a cancel button (to close my form) It is achievable but you need to think of a data driven design here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Would something like this help: JS Bin - Collaborative JavaScript Debugging ?
It's not like your example custom control. But it won't be to difficult to change it so that it can work in a custom control.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.