[SOLVED] FLEX: Refreshing an ibiDataGrid using a new seturl value
I need to be able to refresh the data contained within the ibiDataGrid using a dynamic url.
For example:
. The ibiDataGrid is first loaded using the seturl method: seturl="{fex}". The bound variable is declared in the mxml document:
[Bindable] public var fex:String ="http://localhost/ibi_apps/WFServlet?IBIF_ex=xmlData&IBIAPP_app=baseapp";
. The xmlData.fex pulls back, by default, 3 months of data. So far, it works great. I’m using several ibiList controls using this datagrid as a parent and they all work fine and filter perfectly.
Now the issue...
. Using mxateField controls I’ve added to the Flex app, a user can enter a customized date range by selecting a start date and end date to retrieve historical data.
. Once custom dates are selected, the user clicks a Submit button that creates an internal customized URL of: "http://localhost/ibi_apps/WFServlet?IBIF_ex=xmlData&IBIAPP_app= baseapp&STARTDATE=20090101&ENDDATE=20090916".
. I’ve been unable to figure out how to reload/refresh the ibiDataGrid with the results using the new URL I’ve created
In my tests I can load a DataGrid/ibiDataGrid using the ActionScript method, but when I do, the ibiList controls I have attached to the grid no longer work.
Is there some trick to getting the ibiDataGrid to refresh provided a new seturl=’’ value?
The reason I’ve opted to go this route opposed to pulling in all historical data to start with is speed. It takes way too long for Flash to process all of the possible historical record data when it won’t be used very often.This message has been edited. Last edited by: Kerry,
Kelly WF 7.6.6, Win 2K3 SP2, Tomcat
September 18, 2009, 08:32 AM
BJones
After you set the url call:
IBICANVAS01.reloadData("yourGridID","");
with IBICANVAS01 being the name of the IBI canvas.
Bob
Prod: WebFocus/ReportCaster 7.6.10 - Self Service - Windows 2003 Server - IIS/Tomcat
Test: WebFocus/ReportCaster 7.6.10 - Self Service - Windows 2003 Server - IIS/Tomcat
Databases: MS SQL Server, Focus DB, Output: HTML, Excel 2000 and PDF
September 18, 2009, 01:53 PM
Kelly Badger
Thanks for the info, Bob.
Using the reloadData does reload the the DataGrid. However it still insists on using the original fex value and not the new one.
I've set the original variable:
[Bindable] public var fex:String = "http://qtdenvwfd13/ibi_apps/WFServlet?IBIF_ex=brt_xmldata&IBIAPP_app=bcd";
A submit button's click event calls a function that changes the fex variable using the values from the date controls, and then reloads the data as you specified:
This does in fact cause the mainGrid to refresh, but not with the new dates. I've run it in debug mode, and it looks to me like the new fex variable is being created as it should. Maybe there is something easy I'm missing?
Kelly
quote:
Originally posted by BJones: After you set the url call:
IBICANVAS01.reloadData("yourGridID","");
with IBICANVAS01 being the name of the IBI canvas.
Bob
Kelly WF 7.6.6, Win 2K3 SP2, Tomcat
September 21, 2009, 09:37 AM
BJones
The way you are doing it looks fine, I'm not sure what the issue is. I would throw an 'Alert.show(fex);' right before the reloadData to make sure the url looks ok.
Bob
Prod: WebFocus/ReportCaster 7.6.10 - Self Service - Windows 2003 Server - IIS/Tomcat
Test: WebFocus/ReportCaster 7.6.10 - Self Service - Windows 2003 Server - IIS/Tomcat
Databases: MS SQL Server, Focus DB, Output: HTML, Excel 2000 and PDF
September 21, 2009, 10:57 AM
Kelly Badger
I thought the same thing. I tried both an alert and trace after setting the variable to its new value. It all looks good to me. If I enter the fex value into a browser, the report loads as it should.
Kelly WF 7.6.6, Win 2K3 SP2, Tomcat
September 21, 2009, 11:14 AM
BJones
If you can reproduce a simple example with the car file I'll look at the mxml file and see if I see anything. I'm working on this same type of stuff and I'm not having any issues.
Bob
Prod: WebFocus/ReportCaster 7.6.10 - Self Service - Windows 2003 Server - IIS/Tomcat
Test: WebFocus/ReportCaster 7.6.10 - Self Service - Windows 2003 Server - IIS/Tomcat
Databases: MS SQL Server, Focus DB, Output: HTML, Excel 2000 and PDF
September 22, 2009, 06:38 PM
Kelly Badger
Bob, I went back and created a simple example w/the CAR file and wouldn't you know -- it worked perfectly.
So in looking back at my original procedure, I found I was using a -SET command in my .fex to set the &variables during my original testing. Well, I never changed the -SET to -DEFAULT and that's all I needed to do to get it to work (argh!). So each time the procedure was running it was reseting the variables instead of accepting new ones. It always seems to be these simple things that get ya.
Thanks for your help! Adding the IBICANVAS01.reloadData("yourGridID",""); worked perfectly.
Kelly WF 7.6.6, Win 2K3 SP2, Tomcat
October 30, 2009, 08:06 PM
Pronuer
Hola que tal
Yo use este codigo con su ayuda pero no me funciona
My code
< ![CDATA[ [Bindable] public var direccion_datagrid:String =""; private function llenar_datagrid():void { direccion_datagrid = "http://172.20.21.11:8080/ibi_apps/WFServlet?IBIAPP_app=aplicacion&IBIF_ex=xmltest"; gidd.seturl = direccion_datagrid; inter.reloadData("gidd", ""); var temporal_mensaje:String = gidd.seturl; } ]]>