Forwarding this to the Laszlo list on behalf of my colleague.

 

Paul M. Boos, PMP

NIPO Program Manager

SAIC: From Science to Solutions

Office:   703-419-5065

Mobile:  703-307-4322

On-Site: 703-601-9831 (no voicemail)

eMail:    [EMAIL PROTECTED]

Navy eMail: [EMAIL PROTECTED]

 


From: Mastro, James
Sent: Sat 9/30/2006 6:25 PM
To: Henry Minsky
Cc: [email protected]
Subject: setting attributes in JS

We're in DC currently trying to connect Plone to Laszlo.  We'll be here another hour or so.

 

Below is a edit.lzx.  I am brand-spanking-new at Laszlo.  I have several questions about this file.

 

1)  All my layout is vertical only.  The <canvas> layout is the only thing working.  <simplelayout> is ignored.  I was trying to arrange each "case" to be horizontal, and between cases jump vertically.

 

2)  How can I set "password" for edittext through JS - which appears to be my only option.  On the other hand, can I make a "call" out of the <handler> to another <method> (or other tag) that can then have <edittext...> instead of "new edittext()" approach?

 

3)  Most of my "includes" are not working.  Is this simply a path problem?

 

TIA,

Jim Mastro

(352) 428-1442

 

<canvas debug="true"
        layout="axis:y">
    <include href="">     <include href="">     <!--include href="">     <!--include href="">     <!--include href="">     <!--include href="">     <include href="">

    <dataset name="dset"
             type="http"
             request="true"
             src="" />

    <view datapath="dset:/at/widgets/form/div">

        <simplelayout axis="x"/>
        <!--simplelayout/-->

        <handler name="ondata">
            var at_class = this.datapath.getNodeAttribute("class");
            at_class = at_class.substring(6);
            Debug.write("at_class=" + at_class);

            var xpath_result = this.datapath.xpathQuery('label');
            Debug.write("xpath_result=" + xpath_result);

            var label = xpath_result.getFirstChild();
            Debug.write("label=" + label);

            switch(at_class)
            {
                case "ArchetypesStringWidget":
                    var t = new LzText();
                    t.setAttribute("text", label);

                    var input_element = this.datapath.xpathQuery('input');
                    Debug.write("input_element=" + input_element);

                    var value = input_element.getAttr('value');
                    Debug.write("value=" + value);

                    var e = new edittext();
                    e.updateText(value);
                    break;
                case "ArchetypesBooleanWidget":
                    var t = new LzText();
                    t.setAttribute("text", label);

                    var widget = new checkbox();
                    break;
                case "ArchetypesDecimalWidget":
                    var t = new LzText();
                    t.setAttribute("text", label);

                    var input_element = this.datapath.xpathQuery('input');
                    Debug.write("input_element=" + input_element);

                    var value = input_element.getAttr('value');
                    Debug.write("value=" + value);

                    var e = new edittext();
                    e.updateText(value);
                    break;
                case "ArchetypesIntegerWidget":
                    var t = new LzText();
                    t.setAttribute("text", label);

                    var input_element = this.datapath.xpathQuery('input');
                    Debug.write("input_element=" + input_element);

                    var value = input_element.getAttr('value');
                    Debug.write("value=" + value);

                    var e = new edittext();
                    e.updateText(value);
                    break;
                case "ArchetypesLabelWidget":
                    var t = new LzText();
                    t.setAttribute("text", label);
                    break;
                case "ArchetypesPasswordWidget":
                    var t = new LzText();
                    t.setAttribute("text", label);

                    var input_element = this.datapath.xpathQuery('input');
                    Debug.write("input_element=" + input_element);

                    var value = input_element.getAttr('value');
                    Debug.write("value=" + value);

                    var e = new edittext();
                    e.setAttribute('password','true');
                    e.updateText(value);
                    break;
                case "ArchetypesTextAreaWidget":
                    var t = new LzText();
                    t.setX(x);
                    t.setY(y);
                    t.setAttribute("width", width);
                    t.setAttribute("height", width);
                    t.setAttribute("text", this.datapath.getNodeAttribute("label"));

                    var e = new edittext();
                    e.setX(x + 100);
                    e.setY(y);
                    e.setAttribute("width", width);
                    e.setAttribute("height", height);
                    e.setMultilines("True")
                    e.updateText(this.datapath.getNodeText());
                    break;
                case "ArchetypesMultiSelectionWidget":
                    break;
                case "ArchetypesPicklistWidget":
                    break;
                case "ArchetypesSelectionWidget":
                    break;
                case "ArchetypesCalendarWidget":
                    break;
                case "ArchetypesFileWidget":
                    break;
                case "ArchetypesImageWidget":
                    break;
                case "ArchetypesInAndOutWidget":
                    break;
                default:              
                    break;
            }

        </handler>

    </view>
       
</canvas>

_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to