:: Forum >>

input box in panel with editable grid

Hi,

I have a panel in an editable grid.
The panel contains an input text box.
Now, if I click on the input box and start typing, instead of the text appearing in the input box, the current grid cell goes into edit mode and the text appears there.
Alex, do you have a solution to this issue ?
Sample code is given below.

Thanks,
Ankur

<html>
<head>
<script src="activewidgets/runtime/lib/aw.js"></script>
<link href="activewidgets/runtime/styles/xp/aw.css" rel="stylesheet"></link>
</head>
<body>
<script>
var obj = new AW.Grid.Extended;
obj.setCellText(function(i, j){return j + "." + i});
obj.setHeaderText("header");

obj.setColumnCount(10);
obj.setRowCount(100);

obj.setCellEditable(true);

var toolbar = new AW.HTML.DIV;
toolbar.setId("toolbar");

var inp = new AW.UI.Input;
inp.setControlText("a");

toolbar.setContent("input", inp);

obj.defineTemplate("bottomLine", toolbar);

obj.setLayoutTemplate(new AW.Panels.Horizontal);
obj.setPanelTemplate(function(i){
switch(i){
case 1: return this.getScrollTemplate();
case 2: return this.getBottomLineTemplate();
}
});

obj.setPanelHeight(23, 2); //bottom line

document.write(obj);
</script>
</body>
</html>
Ankur Motreja
Saturday, December 2, 2006
Alex, could you please look into this issue.

Thanks,
Ankur
Ankur Motreja
Monday, December 4, 2006
Alex, this is becoming an urgent issue.
Please help.

Ankur
Ankur Motreja
Wednesday, December 6, 2006
Here is the only thing I can suggest for now -

var obj = new AW.Grid.Extended;
obj.setCellText(function(i, j){return j + "." + i});
obj.setHeaderText("header");

obj.setColumnCount(10);
obj.setRowCount(100);

obj.setCellEditable(true);

var toolbar = new AW.HTML.DIV;
toolbar.setId("toolbar");

var inp = new AW.UI.Input;
inp.setControlText("a");

inp.onControlActivated = function(){
    obj.setCellEditable(false);
}
inp.onControlDeactivated = function(){
    obj.setCellEditable(true);
}

toolbar.setContent("input", function(){return inp});
//toolbar.setContent("input", inp);

obj.defineTemplate("bottomLine", toolbar);

obj.setLayoutTemplate(new AW.Panels.Horizontal);
obj.setPanelTemplate(function(i){
switch(i){
case 1: return this.getScrollTemplate();
case 2: return this.getBottomLineTemplate();
}
});

obj.setPanelHeight(23, 2); //bottom line

document.write(obj);


The proper fix requires some changes in the focus manager, which I am doing now (to allow nested controls).
Alex (ActiveWidgets)
Wednesday, December 6, 2006
Hi Alex,

ok, this is an acceptable workaround till the version with the proper fix is released.

Thanks,
Ankur
Ankur Motreja
Thursday, December 7, 2006

This topic is archived.


Back to support forum

Forum search