Skip to Content
avatar image
Former Member

Textfield Value State problem

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 02, 2015 at 11:16 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member 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 .

      resim.PNG (10.4 kB)