passing ArrayCollection to a new window...

66 views
Skip to first unread message

mman

unread,
Oct 22, 2009, 6:08:16 AM10/22/09
to Flex India Community
Hi everybody,
the goal os to open a new window after clicking a button in my Flex
Application. Openning the window is not a problem, however, what I
could not do is:
- sending an ArrayCollection object to the window
- receiving this ArrayCollection in the new window

I want to use this ArraCollection as adata provider for an
AdvancedDataGrid that the new window should show.

I need an urgent help!

Amol Pandhare

unread,
Oct 22, 2009, 6:21:34 AM10/22/09
to flex_...@googlegroups.com
Hey,

How are you creating a window in Flex, using PopupManager or actually creating a new browser window. By saying Flex, I assume you are not talking of AIR.

Regards,
Amol

GAGAN anand

unread,
Oct 22, 2009, 7:49:53 AM10/22/09
to flex_...@googlegroups.com
Yes mman
 
Please let us know that are u using PopUp Manager or you want to open a new window.

2009/10/22 Amol Pandhare <genius...@gmail.com>

Hemanth Kumar T.S

unread,
Oct 22, 2009, 8:03:31 PM10/22/09
to flex_...@googlegroups.com
Hi Mman,
 
Assuming that you are opening a new window using Popupmanager.
 
Passing value to Popup
In main.mxml
 
 On Button click, it call a function to open Popup window
 
private function showTitleWindow():void {
    var titleWindowInstance:TitleWindowData = TitleWindowData(PopUpManager.createPopUp(this, TitleWindowData, false));    
    titleWindowInstance.mainApp = this;                      //Reference to the main app scope
    titleWindowInstance.gnMyNumber = parseFloat(tiMyNumber.text);  //Pass a simple value to the popup - perhaps you can pass ArrayCollection too.
                                                                                                     // gnMyNumber  is a varibale defined in TitleWindowData
}
 
TitleWindowData.mxml
 [Bindable]public var gnMyNumber:Number;
  <mx:Label id="lblMyNumber" text="{gnMyNumber}"  width="100"/>  // this text will display the value that was transferred from Main.mxml
 
To send the data back to Main Application from Popup window , you can use the mainApp variable
 
Hope this helps.
 
Thanks,
Hemanth

mman

unread,
Oct 23, 2009, 3:37:23 AM10/23/09
to Flex India Community
Hi all,
thanks for your reply.

First of all, I am using an mx:Application. Yesterday I have tried to
use a Panel in a PopUpManager as Hemanth illustrated, thanx for that.

private function showReport() : void {
var reportWindow : ReportWindow = ReportWindow
(PopUpManager.createPopUp(this, ReportWindow, true));
....
reportWindow.allData = allData;
}

This works fine but what I am looking for is to open a new browser
window. I have read somewhere about how to send and receive parameters
(as text only I guess?). I need to send the ArrayCollection to the new
browser window, which has an AdvancedDataGrid and some further
functionalities like "save report" as view or something simillar.

Please let me know if it is possible with this type of application
(not AIR).

Thanks again
mman


On Oct 23, 2:03 am, "Hemanth Kumar T.S" <t.s.hemanthku...@gmail.com>
wrote:
> Hi Mman,
>
> Assuming that you are opening a new window using Popupmanager.
>
> *Passing value to Popup*
> In *main.mxml*
>
>  On Button click, it call a function to open Popup window
>
> private function showTitleWindow():void {
>     var titleWindowInstance:TitleWindowData
> = TitleWindowData(PopUpManager.createPopUp(this, TitleWindowData, false));
>     titleWindowInstance.mainApp = this;                      //Reference to
> the main app scope
>     titleWindowInstance.gnMyNumber = parseFloat(tiMyNumber.text);  //Pass a
> simple value to the popup - perhaps you can pass ArrayCollection too.
>
> // gnMyNumber  is a varibale defined in TitleWindowData
>
> }
>
> *TitleWindowData.mxml*
>  [Bindable]public var gnMyNumber:Number;
>   <mx:Label id="lblMyNumber" text="{gnMyNumber}"  width="100"/>  // this
> text will display the value that was transferred from Main.mxml
>
> To send the data back to Main Application from Popup window , you can use
> the mainApp variable
>
> Hope this helps.
>
> Thanks,
> Hemanth
>

Vaibhav Seth

unread,
Oct 23, 2009, 12:35:26 PM10/23/09
to flex_...@googlegroups.com
Just a concept.
Try opening a new window from the Javascript of the current window and use ExternalInterface to communicate from your application to the JS of your window and then communicate from your window to the newly opened window via JS. Otherwise I think SWF will suffer from security violations.
--
Thanks,
Vaibhav Seth.

xueliang wu

unread,
Oct 23, 2009, 11:57:03 PM10/23/09
to flex_...@googlegroups.com
Hi,everybody
   In my opinion,I have a idea to resolve the problem.
you can create a new component that's extend TileWindow,
you can add attribute,such source:ArrayCollection.
When you create new your component,you can send the data to the arrayCollection.
I often use the way to resolve the problem.
You can try it.
If  you have any question,let me know
Thanks.

2009/10/22 mman <malma...@googlemail.com>



--
有你,幸福的开始!

mman

unread,
Oct 27, 2009, 4:27:48 AM10/27/09
to Flex India Community
Thank you all for the suggestions. I find that the suggestion of
Vaibhav is interesting. I will try to do something in that direction
since the TileWindow and popup manager way is already works for me but
with less features.

Thanks again.

On Oct 24, 5:57 am, xueliang wu <xlian...@gmail.com> wrote:
> Hi,everybody
> In my opinion,I have a idea to resolve the problem.
> you can create a new component that's extend TileWindow,
> you can add attribute,such source:ArrayCollection.
> When you create new your component,you can send the data to the
> arrayCollection.
> I often use the way to resolve the problem.
> You can try it.
> If you have any question,let me know
> Thanks.
>
> 2009/10/22 mman <malmans...@googlemail.com>

kurakar

unread,
Oct 14, 2012, 12:03:36 PM10/14/12
to flex_...@googlegroups.com
Dear All, 

I have problem with that. I am attaching the code details what happend?

I will give the details i want?

In main page i have two grids and one panel with 4 to 6 text boxes.

The first grid have data with customer data (retrieving from php),  while the page loading, when i am clicking any coloum, data retrieve from php and shows there in another gird and text boxes with address details(upto here its working perfectly). After that i am clicking the second grid contains data, i want the datas retrieves from php and sql server and showing in  another gird in popup window.  

Please help me out.

Thanks
Kurakar
main application code.txt
titlewindowcode.txt
phpcode.txt

Janibasha Mca

unread,
Oct 15, 2012, 12:18:58 PM10/15/12
to flex_...@googlegroups.com
hi

create a public variable  array collection in pop up window.
from main application you can able to access that variable 
when your are going to open the pop up window asign the array collection to the pop up window array collection

it will work for you.


--
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To view this discussion on the web visit https://groups.google.com/d/msg/flex_india/-/66WTmFrqEwkJ.
To post to this group, send email to flex_...@googlegroups.com.
To unsubscribe from this group, send email to flex_india+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.



venu reddy

unread,
Oct 15, 2012, 9:43:37 AM10/15/12
to flex_...@googlegroups.com
Add a setter and getter in the component which u are trying to open then access that value


On Sun, Oct 14, 2012 at 9:33 PM, kurakar <vigink...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To view this discussion on the web visit https://groups.google.com/d/msg/flex_india/-/66WTmFrqEwkJ.
To post to this group, send email to flex_...@googlegroups.com.
To unsubscribe from this group, send email to flex_india+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.



--
Venu Reddy

shanmugam c

unread,
Oct 19, 2012, 7:44:26 AM10/19/12
to flex_...@googlegroups.com
Create a public function in Title window:
 Eg:
public function fnData(arrCol:ArrayCollection):void
{
   emaillist1.dataprovider=arrCol;
}
and assign that arraycolletion to that titlewindow datagrid..................
Regards

C.SHANMUGAM
KnowledgeQ Interactive Consultancy Services Pvt. Ltd.
First Floor, D-56, DP Estate, Thuvakudy, Trichy 620015, Tamil Nadu, India
www.knowledgeq.com
PH:9751633375
Reply all
Reply to author
Forward
0 new messages