I have a variable number of checkbox components in my UI. 
I want each of them to call the same expression to set/get the checked state
of the component.
I have bound a static variable to each checkbox to enable me to 

How do I access the componentID of the "current" component being processed
when the get/set is being called ?
I have tried getId() in the get/set but it returns null. 
I can successfully access each of the components and bindings by directly
referencing them 
but I don't know which component cause the set to be called.

HTML snippet

<input jwcid="layer1" type="checkbox" />
<input jwcid="layer2" type="checkbox" />
<input jwcid="layer3" type="checkbox" />


Page snippet

        <component id="layer1" type="Checkbox" >
                <binding name="selected" expression="layerVisibility" />
                <static-binding name="layerName" value="AERIAL_IMAGE" />
        </component>    

        <component id="layer2" type="Checkbox" >
                <binding name="selected" expression="layerVisibility" />
                <static-binding name="layerName" value="ROADS" />
        </component>    


Java snippet
        
        public void setLayerVisibility(boolean visible) {
                IComponent con = getContainer(); // This returns null;
                String componentId = this.getId(); // This returns null;
                String path = getIdPath(); // This returns null;;

                //
                // The following all works. I just need to find out which of
the layer1....layer<n> components called setLayerVisibility..
                //
                Icomponent c = getComponent("layer1");  
                if (c != null) {
                        IBinding b = c.getBinding("layerName");
                        if ( b != null) {
                                System.out.println("Layer
1="+b.getString());
                        }
                }
        }

Thanks in advance for any help you can provide

Mal McEwan      



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to