cancel
Showing results for 
Search instead for 
Did you mean: 

what's the use of cols in textarea?

former_member184238
Participant
0 Kudos

Hi,

In my application I have text area as columns in a table. I want to enter limited characters in a row.

So that I applied cols : 20, with out giving width. But I can entering more than 20 characters in a row.

How to restrict the no of columns in a row when entering data in text area?

For this, i tried with with keyup event also.But it's working fine when I am using normal text area.But in my application I am using text area as column in a table .So that, I am not getting any alert in keyup event.

Here is my code to create table.

var oTable = new sap.ui.table.Table({

    title: "Table Example",

    visibleRowCount: 7,

    firstVisibleRow: 3,

    selectionMode: sap.ui.table.SelectionMode.Single,

    toolbar: new sap.ui.commons.Toolbar({items: [

    new sap.ui.commons.Button({text: "Button in the Toolbar", press: function() { alert("Button pressed!"); }})

    ]}),

    extension: [

    new sap.ui.commons.Button({text: "Button in the Extension Area", press: function() { alert("Button pressed!"); }})

    ]

    });

       oTable

       .addColumn(new sap.ui.table.Column(

           {

             label : new sap.m.Label({

               text : "C. Behaviours"

             })

                 .addStyleClass('noMargin noPadding fontSmall'),

             template : new sap.m.TextArea(

                 {

                   rows : 3,

                  cols : 20,

                  // width : '100%',

                   placeholder : "HOW the employee demonstrated Fortescue\'s Values whilst achieving the role/business objectives.",

                   maxLength : 500,

                   editable : true,

                 }).bindProperty("value",

                 "values"),

             sortProperty : "values",

             filterProperty : "values",

             width : "30%",

             resizable : false,

           }));

Please help me to solve this.

Thanks&Records

Sridevi

Accepted Solutions (0)

Answers (2)

Answers (2)

surendra_pamidi
Contributor
0 Kudos

Hi,

Is it application for mobile or desktop..?

You are using mobile text area...

If it is for desktop, then use text area of desktop ie.e ui.commons..

And try to see max length property also..

Regards,

Surendra.

Former Member
0 Kudos

The <textarea> tag defines a multi-line text input control.

A text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually Courier).