:: Forum >>
Controlling Keying Text in Combo
I created a Active Widget Combo, i wanna control the keying text.
For Eg : setting combo text length =2 or something
Suresh
Monday, April 3, 2006
You can limit the input text length with the maxlength attribute, which should be set on the actual input box (content name - "box/text").
You can also monitor the text changes (as the user types) with onControlTextChanged event -
var obj = new AW.UI.Combo;
obj.setItemText("text");
obj.setItemCount(5);
obj.getContent("box/text").setAttribute("maxlength", 2);
obj.onControlTextChanged = function(text){
window.status = text;
}
document.write(obj);
Alex (ActiveWidgets)
Monday, April 3, 2006
Hi,
I am new to ActiveWidget, i had the following issue of how to disable an combo box. Please help me to solve it.
I am using Struts Framework, in Action Class i got some values from database and i have converted into an StringBuffer Array like
StringBuffer lstDept[]=['a','b','c'];
request.setAttribute("UsrDepartment",lstDept);
and i set that on request scope.
In JSP i have collected that value as
<script>
myDataDept = <%=request.getAttribute("UsrDepartment")%>
</script>
In JavaScript,
var myDataDept;
var cboUsrDpt = new AW.UI.Combo;
cboUsrDpt.setSize(55,22);
cboUsrDpt.setId("hidcboDept");
cboUsrDpt.setItemText(myDataDept);
cboUsrDpt.getContent("box/text").setAttribute("maxlength",5);
cboUsrDpt.setItemCount(myDataDept==null ? 0 : myDataDept.length);
cboUsrDpt.onControlTextChanged = function(text){
document.forms[0].hidcboDept.value=text;//used to get the value
}
Next What i have to do in order make it the combo box when i clicked one of my radio button presented in my JSP page.
Ponnudurai
Tuesday, April 11, 2006
This topic is archived.
Back to support forum
Forum search