on 10-03-2015 7:19 PM
Hi Guys,
I am facing some issue with sap.ui.commons.TextField Control value.
I am using Tab Strip layout, In that first Tab having Text Field.
Here I am changing Text Field value (Cursor remains in Text Field while selecting tab) and selecting second Tab of Tab Strip.
Again coming back to first Tab. There Text Field Showing old value not new one which I have entered before tab selection.
Please help me to resolve this issue. How can retain new value in Text Field?
You can refer following Tab Strip Example also
Hi Sumit,
I used your code, will this help? JS Bin - Collaborative JavaScript Debugging
Regards,
Sai Vellanki.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes Sai,
I need to call some other function on "change" event. When i try to navigate using some button its working properly, but when I navigate directly using the tabs the change event of textfield is not called.
With the help of your code i was able to retain the value, but still I'm not able to call the function on change event.
Regards,
Sumit
Hi Sai,
Here I have PGC as ValueHelpField on change event of that I need to add PGC Description value. Req Discount % is normal input field.
Now I can do navigation directly from Tab Strip selection or On click of Next Button.
If I changed PGC value and click Next button the onChange event of PGC is getting called. But while navigating from tab strip its not getting called.
PS:On click of Next button I am just navigating to next tab.
Regards,
Sumit.
Hi Sumit,
Will this help? JS Bin - Collaborative JavaScript Debugging
Let me know if this is not what you're expecting. There are two change events, one is basic change event which triggers when you hit enter and there is liveChange event which hits when any one character changes in the textfield value.
Check the API - JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.commons.ValueHelpField
Regards,
Sai Vellanki.
Sumit,
Change event will not be fired, when you change the selection of tab strip. It will be fired, only when you leave the focus from textfield and press somewhere else in the screen or press the enter key in your keyboard.
In the API it says the same thing -
change(oControlEvent)Event is fired when the text in the field has changed AND the focus leaves the TextField or the Enter key is pressed.
Why don't you use liveChange event? It will get fired when ever there is a change in value. Otherwise, one more alternative I am not sure about this we can try using the select event of tab strip.
Regards,
Sai Vellanki.
Thanks Sergio.
In my one of the requirement I have implemented sap ui5 table inside Tab Strip with text field as input filed. There I am binding table using json model.
Here If I changed the Req Discount % value and clicking on Top Icon Bar or Next button that time its taking new value.
But if I clicking on Tab Strip that time its taking old value (Initially Blank).
How its showing Old Value on Tab Strip Selection only?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthik,
Please add following code of Table in tab strip and please check
var oTable2 = new sap.ui.table.Table("idTable",{ | ||||||
visibleRowCount: 10, | ||||||
firstVisibleRow: 3, | ||||||
selectionMode: sap.ui.table.SelectionMode.None | ||||||
}); | ||||||
oTable2.addColumn(new sap.ui.table.Column({ | ||||||
label: new sap.ui.commons.Label({text: "Request #"}), | ||||||
template: new sap.ui.commons.Link({ | ||||||
press:function(oEvent) | ||||||
{ | ||||||
} | ||||||
}).bindProperty("text", "Arnum"), | ||||||
sortProperty: "Arnum", | ||||||
filterProperty: "Arnum", | ||||||
autoResizable: true |
})); | |||||
oTable2.addColumn(new sap.ui.table.Column({ | |||||
label: new sap.ui.commons.Label({ | |||||
text: "Sales Organization" | |||||
}), | |||||
template: new sap.ui.commons.TextField().bindProperty("text", "Vtext"), | |||||
sortProperty: "Vtext", | |||||
filterProperty: "Vtext", | |||||
autoResizable: true | |||||
})); | |||||
oTable2.addColumn(new sap.ui.table.Column({ | |||||
label: new sap.ui.commons.Label({text: "Agreement Type"}), | |||||
template: new sap.ui.commons.TextView().bindProperty("text", "AgrmntTypeTxt"), | |||||
sortProperty: "AgrmntTypeTxt", | |||||
filterProperty: "AgrmntTypeTxt", | |||||
width: "200px", | |||||
autoResizable: true | |||||
})); | |||||
oTable2.addColumn(new sap.ui.table.Column({ | |||||
label: new sap.ui.commons.Label({text: "Description"}), | |||||
template: new sap.ui.commons.TextView().bindProperty("text", "Botext"), | |||||
sortProperty: "Botext", | |||||
filterProperty: "Botext", | |||||
width: "200px", | |||||
autoResizable: true | |||||
})); | |||||
var aData = [ | |||||
{Arnum: "R10023", Vtext: "RAUS", AgrmntTypeTxt: "ABC"}, | |||||
{Arnum: "R1004567", Vtext: "RAKorea", AgrmntTypeTxt: "VCX"}, | |||||
{Arnum: "R1004567", Vtext: "RAKorea", AgrmntTypeTxt: "VCX"}, | |||||
{Arnum: "R1004567", Vtext: "RAKorea", AgrmntTypeTxt: "VCX"}, | |||||
{Arnum: "R1004567", Vtext: "RAKorea", AgrmntTypeTxt: "VCX"} | |||||
]; | |||||
var oModel2 = new sap.ui.model.json.JSONModel(); | |||||
oModel2.setData(aData); | |||||
oTable2 .setModel(oModel2); | |||||
oTable2.bindRows("/"); |
Hi Sumit,
Use Model property binding concept, it will work. Will this help? JS Bin - Collaborative JavaScript Debugging
Regards,
Sai Vellanki.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sumit,
Please Share your code...
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.
the reason the value is retained as the old value is because the value property of that text field is hardcoded to be "Musterman". if instead of having a hardcoded value you use a model, then the framework will keep whatever value is set in the model. please check out MVC and also the properties of the text field to make sure is editable and then map the value of the control to a property of your model
hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.