:: Forum >>

Combo box text properties (colour, max length)

How can I set the colour and max length of the text (not popup list) in a combobox. This sets the background not the colour, and I've no idea how to set the maximum length to say 10 characters typed as you can set MAXLENGTH in a standard html text box:

var obj = new AW.UI.Combo;
obj.setControlText("--- Enter Value ---");
obj.setStyle("color","red");
obj.setStyle("background","red");
obj.setItemText(["Item 1", "Item 2", "Item 3"]);
obj.setItemImage(["favorites", "favorites", "favorites"]);
obj.setItemCount(3);
document.write(obj);
Dave
Thursday, March 16, 2006
Dave,

the combo and textbox controls are <span> tags and contain html <input> inside, accessible as obj.getContent("box/text"). So color and maxlength should be -

obj.getContent("box/text").setStyle("color", "red");
obj.getContent("box/text").setAttribute("maxlength", "10");
Alex (ActiveWidgets)
Thursday, March 16, 2006
Alex,

Thanks for the quick response, this works a treat. I must admit I find your documentation very hard to understand as a non object oriented part time developer. For example nowhere can I find reference to setControlText in the combo documentation, I just have to copy examples and in this case fall over when I can't find what is in fact really simple. Maybe you could add more to your examples.
Dave
Friday, March 17, 2006
obj.getContent("box/text").setAttribute("maxlength", "10");

How do I get this to work for individual cells in a grid? I don't want to limit all my cells to a specific length.
Wallace R
Tuesday, December 12, 2006
Sorry, in the above post I meant columns instead of cells.
Wallace R
Tuesday, December 12, 2006
This is the only way that I've found how to adjust individual columns:

#myGrid .aw-column-0 {width: 110px;}

It's a style property(?) that dictates the width for column 0 (in this case).
If anyone else has a dynamic way to adjust it via the object, please let me know.

Another Dave
Wednesday, December 13, 2006

This topic is archived.


Back to support forum

Forum search