3.0 beta 2

input text and input password don't work on same grid

Hi,

In the grid code below, I have 2 input boxes - one of type text and the other is changed to type password using setAttribute().
However, both are rendered as type text in version 2.0.1.

The strange part is that if you comment out this line, the password box is actually of type password :
obj.setCellTemplate(inp,1,1)


How can I have an input text and input password box in the same grid ? Please help !!

Thanks,
Ankur


var inp = new AW.UI.Input;
    inp.setId("myInput");

    var pas = new AW.UI.Input;
    pas.setId("myInput1");

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

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

    obj.setCellTemplate(inp,1,1);
    obj.setCellTemplate(pas,2,2);
    pas.getContent("box/text").setAttribute("type", "password");

    document.write(obj);
Ankur Motreja
September 22,
Hi,

It just became a bit more strange.
It works if you want to put the password box in a cell before the input box, but not the other way round.

In the above example, just change the line

obj.setCellTemplate(pas,2,2);


to

obj.setCellTemplate(pas,0,0);


This works because the password box is before the input text box !!
But if you want the password box in a cell after the input text box, I haven't found any solution.

Thanks,
Ankur
Ankur Motreja
September 22,
anyone ?
Ankur Motreja
September 23,
bump
Ankur Motreja
September 24,
This is a bug in AW related to the caching of the html fragments. The workaround is to clear html cache manually on the control and intermediary level ('box' content).

var inp = new AW.UI.Input;
inp.setId("myInput");

var pas = new AW.UI.Input;
pas.setId("myInput1");
pas.getContent("box/text").setAttribute("type", "password");
pas.getContent("box")._innerHTML = "";
pas.getContent("box")._outerHTML = "";
pas._innerHTML = "";
pas._outerHTML = "";

...
Alex (ActiveWidgets)
September 25,
Thanks Alex.
That works.

Ankur
Ankur Motreja
September 25,
Hi,

Another workaround seems to be using the toString() method.
It also seems to be doing the same thing.

Here's the code (only addition to my first post is pas.toString() ):

var inp = new AW.UI.Input;
    inp.setId("myInput");

    var pas = new AW.UI.Input;
    pas.setId("myInput1");

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

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

    obj.setCellTemplate(inp,1,1);
    obj.setCellTemplate(pas,2,2);

    pas.getContent("box/text").setAttribute("type", "password");
    pas.toString();

    document.write(obj);
Ankur Motreja
September 26,
ALEX,

Do you have any plans or ideas on how to fix the "bug in AW related to the caching of the html fragments" you mentioned above?

I'm trying to get a few templates for some things like a password box, textarea, etc. etc. and it just doesn't look like I should have to put in the manual cache flushing in my AW.UI.Password.create function.

AW.UI.Password = AW.UI.Input.subclass();
AW.UI.Password.create = function(){
    var obj=this.prototype;
    obj.getContent('box/text').setAttribute('type', 'password');
    obj.getContent("box")._innerHTML = "";
    obj.getContent("box")._outerHTML = "";
    obj._innerHTML = "";
    obj._outerHTML = "";
};

var PasswordField = new AW.UI.Password;
PasswordField.setPosition(800,10);
document.write(PasswordField);
John Mason
December 21,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.