on 09-07-2018 2:10 PM
Hi, I have a form container with a lot of different controls, like ComboBoxes, RadioButtons, CheckBoxes and TextAreas. I want to have a button for reseting all the controls in the form. I am able to reset each control separately like this:
resetPanel: function(){
this.byId("Text").setValue();
this.byId("ComboBox").setSelectedKey(); }
But there are too many controls for doing it to each one separately. Is there any way to do it in the whole form?
I tried this:
var panel = sap.ui.getCore().byId("Form1");
but I get the error that panel is Undefined.
Does anyone have any idea?
Thanks
Something that you can do (this is the first thing that came to my mind) is this:
And all the magic is done!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, thank you very much for your answer. I am trying to follow this procedure, but I wasn't able to find a way to run through all the controls of the form.Could you give me an example with that?
And also, you suggest to create a case depending on each type of control. But in my form I have for example more than one comboboxes. So, the only way is to give the selectedKey to each combobox by hand? Thank you very much!
A good way to do that (sorry but I'm not able to build a live example at the moment) is to put a breakpoint on your JS code and find a way to get all those controls.
If you're using a SimpleForm just look at the documentation. You should be able to loop through it's content doing oForm.getContent()
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.