pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ben <benjamin.ho...@intel.com>
Subject How to access components (from included bxml files) in java code?
Date Tue, 02 Apr 2013 18:48:58 GMT

Hi,
I have a root bxml file in which I include sub bxml files like so:

Root.bxml
=================
<TablePane styles="{padding:8, horizontalSpacing:6}">
        <columns>
            <TablePane.Column width="1*"/>
            <TablePane.Column/>
        </columns>

        <TablePane.Row height="1*">
            <Border styles="{padding:12}">
                <BoxPane>
                    <TabPane bxml:id="tabPane">
                        <corner>
                            <BoxPane bxml:id="cornerBoxPane"
styles="{horizontalAlignment:'right'}">
                                <Label text="Search"/>
                                <TextInput textSize="15"/>
                            </BoxPane>
                        </corner>

                        <BoxPane styles="{horizontalAlignment:'left',
verticalAlignment:'top'}">
                            <TabPane.tabData>
                                <content:ButtonData icon="@img/dut.jpg"
                                    text="Device"/>
                            </TabPane.tabData>
                            
                            <bxml:include src="device_settings.bxml"/>
                        </BoxPane>

                        <BoxPane styles="{horizontalAlignment:'left',
verticalAlignment:'top'}">
                            <TabPane.tabData>
                                <content:ButtonData icon="@img/tester.jpg"
                                    text="Tester"/>
                            </TabPane.tabData>
                            
                            <bxml:include src="tester_settings.bxml"/>
                        </BoxPane>
                    </TabPane>
                </BoxPane>
            </Border>
        </TablePane.Row>
    </TablePane>
===============================

In the device_settings.bxml and tester_settings.bxml, I have some expanders
and I include other files that have tables,
In that code I attach some bxml:id’s to components so that I can hopefully
access them later on in the java code.

Device_settings.bxml
========================
<Border styles="{padding:6}"
    xmlns:bxml="http://pivot.apache.org/bxml"
    xmlns="org.apache.pivot.wtk">
    <ScrollPane horizontalScrollBarPolicy="fill">
        <BoxPane orientation="vertical" styles="{fill:true, padding:{left:2,
right:2}}">
            <Expander bxml:id="signal_settings_expander" title="Signal
Settings" expanded="false">
                <bxml:include src="signal_settings.bxml"/>
            </Expander>
            <Expander bxml:id="power_settings_expander" title="Power
Settings" expanded="false">
                <bxml:include src="power_settings.bxml"/>
            </Expander> 
            <Expander bxml:id="user_variables_expander" title="User
Variables" expanded="false">
                <bxml:include src="user_variables.bxml"/>
            </Expander> 
        </BoxPane>
    </ScrollPane>
</Border>

When I build and run my code I’m only able to access the id’s in the
root.bxml file.
All the other id’s that I’ve tagged in the bxml files are not showing up in
the namespace. 

If I print my code:
Map<String, Object> namespace = bxmlSerializer.getNamespace();
        Iterator<String> iter = namespace.iterator();
        while(iter.hasNext()) {
            String key = iter.next();
            System.out.println(key + " => " + namespace.get(key));
        }

Output is :
tabPane => org.apache.pivot.wtk.TabPane
cornerBoxPane => org.apache.pivot.wtk.BoxPane
confirmCloseTabPrompt => org.apache.pivot.wtk.Prompt

How do I get the included bxml id’s as well to show up?
I like being able to include other files rather than having a big old master
bxml file 

Thanks,
ben




--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-access-components-from-included-bxml-files-in-java-code-tp4022548.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Mime
View raw message