You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by calathus <ca...@gmail.com> on 2011/01/12 10:49:58 UTC

[pivot] ,

Hi,
I think the current Pivot's BXML file does not allow to refer to externally
constructed Pivot object(e.g, PushButton).
for instance, following code embed an object generated by another bxml file.

<TextPane bxml:id="textPane" styles="{margin:10, wrapText:false}">
  <bxml:include src="document.bxml"/>
</TextPane>

It would be useful if BXML file allows to embed object which is created
outside of BXML file:

<TextPane bxml:id="textPane" styles="{margin:10, wrapText:false}">
  <bxml:include value="$abc"/>
</TextPane>

My usage scenario is to create some Pivot object in Java, and use BXML file
for flexible layout engine.
This idea is related to CRUD library where Java Bean fields will be mapped
to some GUI elements for user interaction (like TextInput, RadioButton) by
annotation, since  they are closely related to the field type.
in this scenario, these leaf level Pivot objects are created in the Generic
library for CRUD, and BXML serializer will combine these objects in a proper
layout.

This will be an interesting combination of Generic class and BXML. They'll
have a clean separation of the roles. Generic class's main role is data
plumbing while that of  BXML is layout.

Are there any reason to restrict bxml:include for another bxml file?

-- 
Cheers,
calathus

Re: [pivot] ,

Posted by Greg Brown <gk...@verizon.net>.
> It would be useful if BXML file allows to embed object which is created outside of BXML file:
> 
> <TextPane bxml:id="textPane" styles="{margin:10, wrapText:false}">
>   <bxml:include value="$abc"/>
> </TextPane>

You can do this with the <bxml:reference> tag:

<bxml:reference id="abc"/>