on 11-02-2015 11:00 AM
Hi All,
I am using TextFields as cells of Table . I am setting ValueState properties of Texfields with sap.ui.core.ValueState.Error as dynamically .
My problem is If I resize the browser window , valuStates of Textfields are being None automatically .
If do you have any solution please let me know .
Thanks.
Hi Onur,
Did you use formatter to set the value state dynamic for text field? Then there should not be any problem, even if you resize the browser window.
Check this sample for testing: 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.
Onur,
OK, how are you setting the value state of text field in onChange event? Can you share the code?
Here is a sample: JS Bin - Collaborative JavaScript Debugging that I have created, try to enter a value > 10 in Address column, you can see the text field state changed to "Error".
Regards,
Sai Vellanki.
Sai,
Yes , I am setting it on Change event . Problem occurs , when I set visibleRowCountMode property of table as "Auto" . And I have to set this property as "Auto". I think there is a bug . I just made some changes on your code , please review .
JS Bin - Collaborative JavaScript Debugging
Thanks .
Hi Onur,
I got your problem now. You are using "Auto" for visibleRowCountMode. In result, what happens in the background is when you re-size the browser window the table rows get adjusted with respect to screen height. Since, the property value is set to "Auto".
To overcome the above issue, what you can do is use addEventDelegate method of table. So, when you re-size or maximize the screen it will hit the onAfterRendering event. Also, if you want to store the value that you are providing in text field, use model concept there.
I edited the JSBin, check now: JS Bin - Collaborative JavaScript Debugging
Regards,
Sai Vellanki.
Hi Sai ,
Yeah I got the idea , your solution is working very well
I just added some flag columns in my model for each Textfields which I need to set Valuestates .
After I have set this flags value on change event for this TextFields.
Finally checked value of flags onAfterRendering function like below code .
oTable.addEventDelegate({
onAfterRendering : function(){
var oModel = this.getModel();
var tabledata = oModel.getData();
var oRows = this.getRows();
for(var i=0 ; i< tabledata.length ; i++)
{
if(tabledata[i].errmatnr == "X")
oRows[i].getCells()[2].setValueState("Error");
if(tabledata[i].errnetwr == "X")
oRows[i].getCells()[8].setValueState("Error");
if(tabledata[i].errmeins == "X")
oRows[i].getCells()[10].setValueState("Error");
if(tabledata[i].errwaers == "X")
oRows[i].getCells()[11].setValueState("Error");
}
}
},oTable);
Thanks a lot for your interest
Best regards .
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
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.