pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: Bind and include bxml
Date Tue, 12 Oct 2010 14:05:07 GMT
Correct. BXML includes are a way to modularize your UI, and the Bindable root object is how
you implement the "code behind" the markup. BXML binding (whether via bind() or Bindable)
simply maps values from the BXML document's namespace to the code-behind class.


On Oct 12, 2010, at 9:54 AM, Thomas Leclaire wrote:

> Ok, I saw such example, but there's no "recursive" system ?
> 
> We have to create a java class for each bxml file included in root file in order to manage
with binding ?
> 
> 
> 
> 2010/10/12 Greg Brown <gkbrown@mac.com>
> Have the root element of your include implement the Bindable interface and BXMLSerializer
will automatically bind() to it. Here is a simple example:
> 
> http://svn.apache.org/repos/asf/pivot/trunk/examples/src/org/apache/pivot/examples/scripting/JavaWindow.java
> http://svn.apache.org/repos/asf/pivot/trunk/examples/src/org/apache/pivot/examples/scripting/java_window.bxml
> 
> On Oct 12, 2010, at 6:44 AM, Thomas Leclaire wrote:
> 
> > Hello,
> >
> > I use the binding system to get easily objects from my bxml files :
> >
> > @BXML private TableView tbLb;
> >
> >     @Override
> >     public void startup(Display display, Map<String, String> properties)
> >         throws Exception {
> >
> >         BXMLSerializer bxmlSerializer = new BXMLSerializer();
> >         window = (Window)bxmlSerializer.readObject(Main.class, "main.bxml");
> >         bxmlSerializer.bind(this, Main.class);
> > ....
> >
> > If tbLb is defined in main.bxml, no problem.
> >
> > But if I use tag "include" to partition my Pivot App. :
> > <bxml:include bxml:id="LignesBudgetaires" src="Second.bxml"/>
> >
> > Objects in Second.bxml are not binded.
> > Is it correct? And if yes, is there a system to have all objects binded?
> >
> > Thanks for your help
> >
> 
> 


Mime
View raw message