datagrid refresh after pop up window closed

Avatar

Avatar
Level 1
czou
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
czou
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile
czou
Level 1

01-06-2008

Hi,



I am pretty new to Flex. I have a simple question which I
think someone can certainly help.



So basically my main page contains a datagrid that maps to a
XMLListCollection that tied to a php backend (this php script
queries a db table). From the main page, I can invoke a pop up
window which displays a form. Once the form is submitted(the same
table is updated correctly), how can I refresh the datagrid?



Any help would be greatly appreciated!



Here is the code sample:



----in the main page

<mx:HTTPService id="ds" url="
http://127.0.0.1:81/test.php"
method="GET" resultFormat="e4x"/>

<mx:XMLListCollection id="xmlList"
source="{ds.lastResult.People}" />



<mx:DataGrid id="peoplelist" initialize="ds.send()"
dataProvider="{xmlList}">

<mx:columns>

<mx:DataGridColumn dataField="ID" />

<mx:DataGridColumn dataField="Name" />

</mx:columns>

</mx:DataGrid>

-- action script to handle submit action

public function submit():void

{

srv.send(); //this send HTTP POST request which is executed
successfully

PopUpManager.removePopUp(_window);



ds.send();

xmlList.refresh();

}

Replies

Avatar

Avatar
Affirm 1
Level 2
atta707
Level 2

Likes

0 likes

Total Posts

30 posts

Correct reply

2 solutions
Top badges earned
Affirm 1
View profile

Avatar
Affirm 1
Level 2
atta707
Level 2

Likes

0 likes

Total Posts

30 posts

Correct reply

2 solutions
Top badges earned
Affirm 1
View profile
atta707
Level 2

02-06-2008

try moving these two statements



ds.send();

xmlList.refresh();



to the result event of the underlying HTTPService that's
being used at srv.send();

Avatar

Avatar
Level 1
czou
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
czou
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile
czou
Level 1

02-06-2008

why this is not working inside submit function? Conceptually,
putting them inside the HTTPService event result function is the
same as this one, you still havce to call these two lines.



thanks!