3.2.0

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
December 2,
Alex, could you please look into this issue.

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

Ankur
Ankur Motreja
December 6,
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)
December 6,
Hi Alex,

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

Thanks,
Ankur
Ankur Motreja
December 7,

This topic is archived.

See also:


Back to support forum