3.2.0

setid("id") creates bug?!

Hi all,
I want to know can I setId("id") for my object?!

For the following code, there is a bug which displays the 'ppg0 = AW.UI.Label' object wrongly. But that was caused by the code 'inp3.setId('id');'. If I change the inp3.setId('id'); to inp3.setId("pid"), then the AW.UI.Label object displays correctly. But I must do inp3.setId('id'); for some reason.
Any comments? I'm using v2.0.2

Thanks guys.

<html>
    <head>
        <meta http-equiv="Content-Type" 
              content="text/html; charset=UTF-8">
        <title>Test</title>
    <script src="../../runtime/lib/aw.js"></script>
    <link href="../../runtime/styles/xp/aw.css" rel="stylesheet"></link>
    </head>
    <body>
<script>
var gridData = [["Jacky","Choy","Z1234567","2"],["test","123","235","3"],["TT","Chan","A234567","4"]];
</script>

<script>
var obj = new AW.Grid.Extended;
obj.setHeaderCount(2);
obj.setHeaderText(["First Name","lastName","Comments","id"]);
var srhBoxes = new Array();
var srhStr = "Enter search...";
var inp0= new AW.HTML.INPUT;
inp0.setAttribute('type', 'text');
inp0.setAttribute('value', 'Enter search...');
inp0.setId('firstName');
inp0.setAttribute('tabindex', 1);
inp0.setClass('srh', 'nothing');
var inp1= new AW.HTML.INPUT;
inp1.setAttribute('type', 'text');
inp1.setAttribute('value', 'Enter search...');
inp1.setId('lastName');
inp1.setAttribute('tabindex', 2);
inp1.setClass('srh', 'nothing');
var inp2= new AW.HTML.INPUT;
inp2.setAttribute('type', 'text');
inp2.setAttribute('value', 'Enter search...');
inp2.setId('hkId');
inp2.setAttribute('tabindex', 3);
inp2.setClass('srh', 'nothing');
var inp3= new AW.HTML.INPUT;
inp3.setAttribute('value', 'Enter search...');
inp3.setId('id');
inp3.setAttribute('tabindex', 4);
inp3.setClass('srh', 'nothing');
obj.setHeaderText([inp0, inp1, inp2, inp3], 1);
var str = new AW.Formats.String;
var num = new AW.Formats.Number;
obj.setCellFormat([str,str,str,str]);
obj.setCellText(gridData);
obj.setRowCount(3);
obj.setColumnCount(4);
obj.setColumnIndices([0,1,2]);
obj.setSelectorVisible(true);
obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
obj.setSelectorWidth(15);
obj.setSelectionMode("single-row");
document.write(obj);
</script>
<p></p>
<script>

var ppg0 = new AW.UI.Label;
ppg0.setControlText("1");
document.write(ppg0); 

var ppg1 = new AW.UI.Link;
ppg1.setControlText("2");
ppg1.setControlLink("_s=4&_c=3");
document.write(ppg1); 

var ppg2 = new AW.UI.Link;
ppg2.setControlText("3");
ppg2.setControlLink("_s=8&_c=3");
document.write(ppg2);
</script>
    </body>
</html>
Jarlau
March 16,

This topic is archived.

See also:


Back to support forum