My program need to show a series of comment displayed in a sroll pane somewhere
in my main window.I created a bxml file called CommentPane which take three
variables Date, Author and comment.And the list of comments stored in database.
so my CommentPane code like this:<thumbnail:CommentPane
xmlns:bxml="http://pivot.apache.org/bxml"
xmlns:thumbnail="hk.itags.gui.thumbnail"
xmlns="org.apache.pivot.wtk">
<BoxPane>
<TablePane>
<columns>
<TablePane.Column width="1*"/>
</columns>
<TablePane.Row height="-1">
<Border styles="{color:'#999999'}">
<TablePane>
<columns>
<TablePane.Column width="-1"/>
<TablePane.Column width="1*"/>
<TablePane.Column width="-1"/>
</columns>
<TablePane.Row height="-1">
<Label bxml:id="dateLabel" />
<Label bxml:id="authorLabel" />
<PushButton buttonData=">"
styles="{minimumAspectRatio:1.5}"/>
</TablePane.Row>
</TablePane>
</Border>
</TablePane.Row>
<TablePane.Row height="1*">
<Border styles="{color:'#999999'}">
<BoxPane styles="{padding:6, verticalAlignment:'top'}">
<Label bxml:id="summaryLabel" text="Summary"/>
<TextArea bxml:id="descriptionTextArea"
minimumHeight="2"/>
</BoxPane>
</Border>
</TablePane.Row>
</TablePane>
</BoxPane>
</thumbnail:CommentPane>
if I use BXML serializer, i can load one into my scroll pane with setView. but
when I load a second one, I have an error message "ID dateLabel is already in
use".
I can't use bxml:include in bxml file because I don't know until I read the
database.
Hopefully, that's clear.
Brendan
> Date: Sat, 17 Sep 2011 17:45:04 +0700
> Subject: Re: How to dynamically add component to window
> From: [email protected]
> To: [email protected]
>
> Here is a test that shows how to use the 'inline' flag to include BXML.
> http://svn.apache.org/repos/asf/pivot/trunk/tests/src/org/apache/pivot/tests/include_test.bxml
> http://svn.apache.org/repos/asf/pivot/trunk/tests/src/org/apache/pivot/tests/include_test.content.bxml
>
> On 17 September 2011 17:42, Chris Bartlett <[email protected]> wrote:
> > 2011/9/17 Brendan cheng <[email protected]>:
> >> Actually, I was trying to inject a series of box pane from the bxml files.
> > Are you talking about using BXML's 'include' functionality?
> > http://pivot.apache.org/tutorials/bxml-primer.html
> >
> > If you are, then you can include the same BXML fragments multiple
> > times (or any fragments, including ones where the BXML IDs of
> > Components might clash) by using the inline flag
> > <bxml:include src="foo.bxml" inline="true"/>