on 11-26-2018 7:07 AM
Hi All,
i am working on custom SAPUI5 application development. As per my application scenario i need to use sapui5 table and row creation at run time. Whenever user press the add button at the top of the table header, i need to bind the row with table.In each row it contains 3 input fields , one value help and one combo box.
i have a separate OData service for both value help and combo box to load the items.I am facing difficulties with id and while try to set the selected value on the input field after chose from value help.
How to do this, please share any link or samples.
Thank you,
Regards,
JK.
Its very difficult to understand the issue from the limited information that you have provided..
From what i understnad, you can persist the id in this.valueHelpId = 'ID of the element that you are showing f4 help' and then once the value is selected in the help, use that id and set the value to the binding or to the control, then clear that id.
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok.. Have you tried the approach that I've mentioned where you can set the input control id to this.valueHelpId
in the f4 help event handler, this.valueHelpId = oEvent.getSource().getId();
Now after the value is selected, use this.getView().byId(this.valueHelpId).setValue();
and then clear the this.valueHelpId.
BR,
Mahesh
Hi Mahesh,
Thanks for your reply. Please see the below image for more understanding.
and i added the handleValueHelp function like below on the table row .
then i added the handleclose event and handlesearch event separately. But when i debugging it on the browser, those search and close event is not getting called.
Thank you,
Regards,
JK.
Ideally it should work, just check if you have done similar to what was done in the below link:
*****EDIT*****
Oh I get it, it is due to using 'this' inside the valuehelprequest function, this will not have the view instance inside the function..
you need to pass var that = this; before the input box and use that instead of this inside the valuehelprquest function or bind this like below
valuehelprequest: function() {
...
}.bind(this)
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then you have to model your structure differently in this case, lets say, your item structure is like below;
{
id: 1,
name: test
}
Now add another dummy property to it:
{
id: 1,
name: test,
dropdown:[]
}
This can be done when you add the data, pass the dropdown property as well with data specific to it or set the dropdown data to the model when he changes any other value in that record.
Else you can also do one thing, there is combo box lazy loading, once the user clicks on the dropdown, you can load:
https://ui5.sap.com/#/sample/sap.m.sample.ComboBoxLazyLoading/code
BR,
Mahesh
Hi Jayakrishnan,
I would suggest you to do this using XML view for consistency.. I think you are using js code for this, better put all that code in xml view.. it will be easier to understand where the issue is coming from
And btw for load items function, use bind(this) at end of function
BR,
Mahesh
Hey got it, I also did the same,
sap.ui.getCore().byId(that.inputId).setValue(oSelectedItem.getTitle());
it is working. Thank you for your help.
regards,
JK.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.