Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Query regarding use of Component XML

    Hi,

    Using SmartGWT version /builds/SmartGWT/3.1p/PowerEdition/2013-02-27.

    I am trying to use Component XML for drawing layout of my Screen. For this I using below code.
    Code:
    public void onModuleLoad() {
      
    		try 
            {
            	RPCManager.loadScreen("estore_template1_main", new LoadScreenCallback() {
    				@Override
    				public void execute() {
    					Canvas.getById("ToolStrip_MainMenu");
    				}
    			});
                   
            } catch (Exception e) {
                   e.printStackTrace(System.out);
            }
    }
    I am having "ToolStrip_MainMenu" as section stack in my estore_template1_main.ui.xml. But I am getting null while doing Canvas.getById("ToolStrip_MainMenu");

    Code:
    <SectionStack ID="SectionStackBodyLeft" width="20%" height="100%" autoDraw="false">
         <sections>         
    	 <SectionStackSection>            
    	 <ID>SectionStackSection_Catalog</ID>  
    	 <title>Catalog</title>
    	 <autoShow>true</autoShow> 
    	 <resizeable>true</resizeable> 
    	 <items><Canvas ref="TreeGrid_Catalog"/> 
    	 </items>    
         </SectionStackSection> 
    	 <SectionStackSection>   
    	 <ID>SectionStackSection_Catalog_FavoriteItems</ID>  
    	 <title>Favorite Items</title>  
    	 <autoShow>true</autoShow>  
    	 <resizeable>true</resizeable> 
    	 <items><Canvas ref="TreeGrid_Catalog_FavoriteItems"/>
    	 </items>
    	 <visibilityMode>multiple</visibilityMode>
         <animateSections>true</animateSections>  
    	 <reverseOrder>false</reverseOrder> 
    	 <showHover>false</showHover> 
    	 <showResizeBar>true</showResizeBar> 
    	 <showEdges>false</showEdges> 
    	 <showShadow>false</showShadow>
    </SectionStack>
    Kindly suggest, what is the right way to do this.

    Thanks,
    Deepak Singh

    #2
    See docs for loadScreen() - the default is to not allow any components in the loaded XML to take global IDs; only the components you explicitly specify will actually become global.

    Comment

    Working...
    X