You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by V SANTOSH PAVAN RAJU Bs <pa...@gmail.com> on 2014/06/11 09:11:12 UTC
How to iterate over an bxml form to get all the TextInputs added to it?
Hi,
In my application I created one Border component in bxml file and then
added TablePane to it. And then added multiple rows to that TablePane. And
in each Row i have added several textinput components.
Now i want to iterate through the Border component to get all the
TextInputs. Is there any way of doing this?
--
Thanks & Regards
B.S.V.S.Pavan Raju.
Skype: skype_pavan1
Hyderabad.
Re: How to iterate over an bxml form to get all the TextInputs
added to it?
Posted by Santosh <pa...@gmail.com>.
Thank you Roger, its working.
-----
santosh pavan raju
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-iterate-over-an-bxml-form-to-get-all-the-TextInputs-added-to-it-tp4022958p4022961.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: How to iterate over an bxml form to get all the TextInputs added
to it?
Posted by Roger and Beth Whitcomb <Ro...@rbwhitcomb.com>.
Hi,
All the components can be iterated through using the
"Sequence<Component>" interface, something like this:
private void iterateTextInputs(Container container) {
for (Component comp : container) {
if (comp instanceof Container) {
iterateTextInputs((Container)comp);
} else if (comp instanceof TextInput) {
TextInput textInput = (TextInput)comp;
// Do whatever you need to do
}
}
}
Then you would call this method with your Border component:
@BXML Border borderComponent;
iterateTextInputs(borderComponent);
HTH,
~Roger
On 6/11/14 12:11 AM, V SANTOSH PAVAN RAJU Bs wrote:
> Hi,
> In my application I created one Border component in bxml file and then
> added TablePane to it. And then added multiple rows to that TablePane.
> And in each Row i have added several textinput components.
>
> Now i want to iterate through the Border component to get all the
> TextInputs. Is there any way of doing this?
>
> --
> Thanks & Regards
> B.S.V.S.Pavan Raju.
> Skype: skype_pavan1
> Hyderabad.