Data Binding and Accordion Headers

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Data Binding and Accordion Headers

Nick Makes
This may be a simple answer, but I recently tried to use data binding on a Accordion.headerData attribute I'm setting in the markup I have for a TablePane. I get the error that static properties are not supported with data binding?

I feel like I'm just going about trying to associate dynamic text with a component's header within an Accordion pane the wrong way here. However, as I'm getting my feet wet with data binding at the moment I figured this could have been a "two stones" moment.

Any advice?  Basically, I want to associate a ButtonGroup's current selection's ButtonData and have that be displayed in the Accordion's header bar for that particular pane.

Any help here would be greatly appreciated.

Thanks,
Nick

Sent from my iPhone
Reply | Threaded
Open this post in threaded view
|

Re: Data Binding and Accordion Headers

Roger and Beth Whitcomb
Hey Nick,
     I understand what you're trying to do, but I don't see that
Accordion's header data has a binding interface, at least not like
TextInput (for instance) does (see the TextInput#TextBindMapping
interface).  I believe the default renderer for an Accordion is a Label,
which also doesn't have a binding interface, but a potential solution is
to use a custom renderer for the Accordion that incorporates a TextInput
(in read-only or non-active mode) and then use data binding on that
component.  Does that make sense?  There is no restriction on what can
be used as a renderer, so I think this would work, although I'm not sure
how to set it all up in a bxml file -- you would probably have to code
this all in Java.

     Let us know if you need more help -- I'm basically writing off the
top of my head -- haven't tried to make this work.  But, if you need
more help, I can try to code something up to see.

~Roger

On 9/29/14 1:21 PM, Nick Makes wrote:

> This may be a simple answer, but I recently tried to use data binding on a Accordion.headerData attribute I'm setting in the markup I have for a TablePane. I get the error that static properties are not supported with data binding?
>
> I feel like I'm just going about trying to associate dynamic text with a component's header within an Accordion pane the wrong way here. However, as I'm getting my feet wet with data binding at the moment I figured this could have been a "two stones" moment.
>
> Any advice?  Basically, I want to associate a ButtonGroup's current selection's ButtonData and have that be displayed in the Accordion's header bar for that particular pane.
>
> Any help here would be greatly appreciated.
>
> Thanks,
> Nick
>
> Sent from my iPhone
>

Reply | Threaded
Open this post in threaded view
|

RE: Data Binding and Accordion Headers

Roger Whitcomb-2
In reply to this post by Nick Makes
Hi again,
        It just occurred to me that you don't really need to use data binding in order to accomplish this.  Just hook up a ButtonGroupListener, and in the "selectionChanged" method just update the accordion header data accordingly.  I've done this with TabPane, where typing into a text field updates the tab's data.

HTH,
~Roger

-----Original Message-----
From: Nick Makes [mailto:[hidden email]]
Sent: Monday, September 29, 2014 1:21 PM
To: [hidden email]
Subject: Data Binding and Accordion Headers

This may be a simple answer, but I recently tried to use data binding on a Accordion.headerData attribute I'm setting in the markup I have for a TablePane. I get the error that static properties are not supported with data binding?

I feel like I'm just going about trying to associate dynamic text with a component's header within an Accordion pane the wrong way here. However, as I'm getting my feet wet with data binding at the moment I figured this could have been a "two stones" moment.

Any advice?  Basically, I want to associate a ButtonGroup's current selection's ButtonData and have that be displayed in the Accordion's header bar for that particular pane.

Any help here would be greatly appreciated.

Thanks,
Nick

Sent from my iPhone

Reply | Threaded
Open this post in threaded view
|

Re: Data Binding and Accordion Headers

Nick Makes
That was my initial go at it...using Accordion.setHeaderData(...) under the ButtonGroup listener, but the text wouldn't update on screen. I figured it had something to do with it being a static property, but now you're making me second guess myself and think that I had just a dumb error.

For reference, I'm building a three-paned date selector. The out of the box Calendar support is good, but I find the the pop-up cumbersome when wanting to flip through years or very far apart months quickly. Also, my available dates are only those found in a database table so it's not a full calendar.

Anyways, I ended up utilizing a CardPane that had a toolbar up top to control whether the Years, Months, or Days buttons were shown; data binding TextFields in that toolbar to display the respective button group selections. The added bonus was the easy inclusion of animated transitions.

It was your text field comment that spurred me to think of the alternative route. Thanks for the responses, always appreciate the feedback.

-Nick

Sent from my iPhone

On Sep 30, 2014, at 3:39 PM, Roger Whitcomb <[hidden email]> wrote:

Hi again,
   It just occurred to me that you don't really need to use data binding in order to accomplish this.  Just hook up a ButtonGroupListener, and in the "selectionChanged" method just update the accordion header data accordingly.  I've done this with TabPane, where typing into a text field updates the tab's data.

HTH,
~Roger

-----Original Message-----
From: Nick Makes [mailto:[hidden email]]
Sent: Monday, September 29, 2014 1:21 PM
To: [hidden email]
Subject: Data Binding and Accordion Headers

This may be a simple answer, but I recently tried to use data binding on a Accordion.headerData attribute I'm setting in the markup I have for a TablePane. I get the error that static properties are not supported with data binding?

I feel like I'm just going about trying to associate dynamic text with a component's header within an Accordion pane the wrong way here. However, as I'm getting my feet wet with data binding at the moment I figured this could have been a "two stones" moment.

Any advice?  Basically, I want to associate a ButtonGroup's current selection's ButtonData and have that be displayed in the Accordion's header bar for that particular pane.

Any help here would be greatly appreciated.

Thanks,
Nick

Sent from my iPhone

Reply | Threaded
Open this post in threaded view
|

RE: Data Binding and Accordion Headers

Roger Whitcomb-2
I think the reason the text didn't get updated is that the update is triggered by the header data *component* changing.  So, if you still have the same component (just with different text) then no update happens.  So, I would create a new component ("new Label('updated text')") and set that as the header data using "setHeaderData(accordion, <new label>)".

HTH,
~Roger

-----Original Message-----
From: Nick Makes [mailto:[hidden email]]
Sent: Tuesday, September 30, 2014 12:53 PM
To: [hidden email]
Subject: Re: Data Binding and Accordion Headers

That was my initial go at it...using Accordion.setHeaderData(...) under the ButtonGroup listener, but the text wouldn't update on screen. I figured it had something to do with it being a static property, but now you're making me second guess myself and think that I had just a dumb error.

For reference, I'm building a three-paned date selector. The out of the box Calendar support is good, but I find the the pop-up cumbersome when wanting to flip through years or very far apart months quickly. Also, my available dates are only those found in a database table so it's not a full calendar.

Anyways, I ended up utilizing a CardPane that had a toolbar up top to control whether the Years, Months, or Days buttons were shown; data binding TextFields in that toolbar to display the respective button group selections. The added bonus was the easy inclusion of animated transitions.

It was your text field comment that spurred me to think of the alternative route. Thanks for the responses, always appreciate the feedback.

-Nick

Sent from my iPhone

On Sep 30, 2014, at 3:39 PM, Roger Whitcomb <[hidden email]> wrote:

Hi again,
   It just occurred to me that you don't really need to use data binding in order to accomplish this.  Just hook up a ButtonGroupListener, and in the "selectionChanged" method just update the accordion header data accordingly.  I've done this with TabPane, where typing into a text field updates the tab's data.

HTH,
~Roger

-----Original Message-----
From: Nick Makes [mailto:[hidden email]]
Sent: Monday, September 29, 2014 1:21 PM
To: [hidden email]
Subject: Data Binding and Accordion Headers

This may be a simple answer, but I recently tried to use data binding on a Accordion.headerData attribute I'm setting in the markup I have for a TablePane. I get the error that static properties are not supported with data binding?

I feel like I'm just going about trying to associate dynamic text with a component's header within an Accordion pane the wrong way here. However, as I'm getting my feet wet with data binding at the moment I figured this could have been a "two stones" moment.

Any advice?  Basically, I want to associate a ButtonGroup's current selection's ButtonData and have that be displayed in the Accordion's header bar for that particular pane.

Any help here would be greatly appreciated.

Thanks,
Nick

Sent from my iPhone