You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Shahzad Bhatti <sb...@peak6.com> on 2011/08/31 21:10:04 UTC

Binding data with BXMLSerializer

I have an old 1.5 app that I am upgrading to use 2.0. I am replacing WTKXSerializer with BXMLSerializer but I am not getting include behavior correctly. I have a main.bxml file that has tab-pans and includes another bxml file, e.g.



<tabs>

<BoxPane styles="{horizontalAlignment:'center', verticalAlignment:'top'}">

<bxml:include src="tasks_tab.bxml" />

</BoxPane>



However, it looks like it's not adding the included file to the namspace as I the @BXML attributes are null.
In my code I do:

this.bxmlSerializer = new BXMLSerializer();

this.window = (Window) bxmlSerializer.readObject(getClass()

.getResource("main.bxml"), resources);

bxmlSerializer.bind(this, Main.class);


Secondary question is how to use namespace scope with BXML as I didn't see any examples. Thanks.



______________________________________________

See  http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email

Re: Binding data with BXMLSerializer

Posted by Greg Brown <gk...@verizon.net>.
No, includes no longer work this way in BXML. An included object is now treated like any other instantiated object. So "shipping.mycomponent" would refer to the "mycomponent" property of the root type of your included file, rather than the value with ID "mycomponent" in the included file. This helps facilitate modularization by making BXML namespaces effectively private to the document.
G

On Aug 31, 2011, at 3:19 PM, Shahzad Bhatti wrote:

> Thanks Greg. By scope, I mean in old WTKX, I could specify id with include
> such as
> <wtkx:include wtkx:id="shipping"..
> And then in code use @WTKX(id="shipping.mycomponent")
> Is that still supported in BXML. Thanks.
> 
> 
> On 8/31/11 12:15 PM, "Greg Brown" <gk...@verizon.net> wrote:
> 
>>> I have an old 1.5 app that I am upgrading to use 2.0. I am replacing
>>> WTKXSerializer with BXMLSerializer but I am not getting include behavior
>>> correctly. I have a main.bxml file that has tab-pans and includes
>>> another bxml file, e.g.
>> 
>> Try adding inline="true" to your <bxml:include> tag.
>> 
>>> Secondary question is how to use namespace scope with BXML as I didn't
>>> see any examples. Thanks.
>> 
>> Not sure what you mean. Can you elaborate?
>> 
>> G
>> 
> 
> 
> ______________________________________________
> 
> See  http://www.peak6.com/email_disclaimer.php
> for terms and conditions related to this email


Re: Binding data with BXMLSerializer

Posted by Shahzad Bhatti <sb...@peak6.com>.
Thanks Greg. By scope, I mean in old WTKX, I could specify id with include
such as 
<wtkx:include wtkx:id="shipping"..
And then in code use @WTKX(id="shipping.mycomponent")
Is that still supported in BXML. Thanks.


On 8/31/11 12:15 PM, "Greg Brown" <gk...@verizon.net> wrote:

>> I have an old 1.5 app that I am upgrading to use 2.0. I am replacing
>>WTKXSerializer with BXMLSerializer but I am not getting include behavior
>>correctly. I have a main.bxml file that has tab-pans and includes
>>another bxml file, e.g.
>
>Try adding inline="true" to your <bxml:include> tag.
>
>> Secondary question is how to use namespace scope with BXML as I didn't
>>see any examples. Thanks.
>
>Not sure what you mean. Can you elaborate?
>
>G
>


______________________________________________

See  http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email

Re: Binding data with BXMLSerializer

Posted by Greg Brown <gk...@verizon.net>.
> I have an old 1.5 app that I am upgrading to use 2.0. I am replacing WTKXSerializer with BXMLSerializer but I am not getting include behavior correctly. I have a main.bxml file that has tab-pans and includes another bxml file, e.g.

Try adding inline="true" to your <bxml:include> tag.

> Secondary question is how to use namespace scope with BXML as I didn't see any examples. Thanks.

Not sure what you mean. Can you elaborate?

G


Re: Binding data with BXMLSerializer

Posted by Shahzad Bhatti <sb...@peak6.com>.
One more clarification, I am implementing Bindable interface and all
components defined in main.bxml are getting bound correctly. Only,
included files are not being bound.

On 8/31/11 12:10 PM, "Shahzad Bhatti" <sb...@peak6.com> wrote:

>I have an old 1.5 app that I am upgrading to use 2.0. I am replacing
>WTKXSerializer with BXMLSerializer but I am not getting include behavior
>correctly. I have a main.bxml file that has tab-pans and includes another
>bxml file, e.g.
>
>
>
><tabs>
>
><BoxPane styles="{horizontalAlignment:'center', verticalAlignment:'top'}">
>
><bxml:include src="tasks_tab.bxml" />
>
></BoxPane>
>
>
>
>However, it looks like it's not adding the included file to the namspace
>as I the @BXML attributes are null.
>In my code I do:
>
>this.bxmlSerializer = new BXMLSerializer();
>
>this.window = (Window) bxmlSerializer.readObject(getClass()
>
>.getResource("main.bxml"), resources);
>
>bxmlSerializer.bind(this, Main.class);
>
>
>Secondary question is how to use namespace scope with BXML as I didn't
>see any examples. Thanks.
>
>
>
>______________________________________________
>
>See  http://www.peak6.com/email_disclaimer.php
>for terms and conditions related to this email