search.lzx

<!-- Copyright 2001-2011 Laszlo Systems, Inc.  All Rights Reserved. -->
<library>
    <class name="search" extends="inputtext" bgcolor="white" text="interesting" y="-5" visible="false">
    
        <attribute name="opened" value="false"/>
        <animator name="open" attribute="y" to="25" duration="200" start="false"/>
        <animator name="close" attribute="y" to="-5" duration="200" start="false"/>

        <handler name="onfocus">
            //if (this.opened) navmanager.focus(this);
        </handler>

        <handler name="onfocused" reference="navmanager" args="f">
            if (f != this) {
                this.onblur.sendEvent();
                if (this.opened) this.toggle()
            } else {
                this.onfocus.sendEvent();
                this.setSelection(0, this.text.length);
            }
        </handler>
            
        <method name="handlekeydown" args="k">
            if ( k == 13 ) { //return key
                this.load(null);
                this.toggle();
            }
        </method>

        <handler name="onstop" reference="this.close">
            this.setAttribute('visible', false );
        </handler>

        <handler name="onstart" reference="this.open">
            this.setAttribute('visible', true );
        </handler>
        
        <handler name="onstop" reference="this.open">
            navmanager.focus( this, false );
        </handler>

        <handler name="oninit" method="load"/>
        <method name="load" args="v">
            gDataMan.loadPhotosByTag(this.text);
            container.hideDetails(true);
            gContent.setAttribute('firstrun', true);
        </method>
        
        <method name="toggle">
            if ( this.opened ) {
                this.close.doStart()
            } else {
                this.open.doStart();
            }
            this.opened = !this.opened;
        </method>
        
        
        <method name="findnext">
            
            if(this['next'] && this['next'].visible){
                return this.next;
            }
            
        </method>
        <method name="findprev">
            if(this['prev']){
                return this.prev;
            }
        </method>
        <method name="handlekeyup" args="k">
            if(k == 13){
                this.onmouseup.sendEvent();
                this.onclick.sendEvent();
            }
        </method>
        <method name="construct" args="parent, args">
            this.focusable = true;
            super.construct(parent, args);
            if(navmanager) navmanager.add(this);
        </method>

    </class>
</library>
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
* Copyright 2006 Laszlo Systems, Inc.  All Rights Reserved.          *
* Use is subject to license terms.                                        *
* X_LZ_COPYRIGHT_END ******************************************************-->

Cross References

Classes