Dear All/Robert Shilten
I want to pass one parameter from my custom mxml page to header widget of flex viewer.please help me in this matter,
Thanks to All.
Solved! Go to Solution.
the below code is calling index page of flex viewer
var url:URLRequest
var uv:URLVariables;
var msArr:ArrayCollection = new ArrayCollection();
var transferData:Object = {message:"UGroup",Value:"0"};//value will come from database.
msArr.addItem(transferData);
var data:Object={key:"ug",collection:msArr};
AppEvent.dispatch(AppEvent.DATA_PUBLISH, data);
url = new URLRequest("index.html");
navigateToURL(url,"_self");
Nadir,
So does you login page even know what an AppEvent is then?.. Also it seems that your login page is dispatching the AppEvent before you navigate to the index page and that would seem to be a problem as the viewer would not have stated up all of its manager processes yet.
Dear Robert
I import com.esri.viewer.AppEvent in my custom page.if I update code like below
var uv:URLVariables;
var msArr:ArrayCollection = new ArrayCollection();
var transferData:Object = {message:"UserGroup",Value:"0"};
var data:Object={key:"user",collection:msArr};
url = new URLRequest("index.html");
uv=new URLVariables();
navigatetoURL(url,"_self");
com.esri.viewer.AppEvent.dispatch(com.esri.viewer.AppEvent.DATA_PUBLISH, data);
so it should work.
but not working.
the other thing is that can you suggest me how to add a login page to flex viewer,Because I am doing all this exerceise for login page.
Nadir,
Sure I have a couple of sites setup to use a login page that is part of the Viewers source code. You can find the code for this here http://gis.calhouncounty.org/devsummit2012/devsumit2012.zip It just sets up states on the main index.html page and the initial state is the login stuff and it will not switch states until login is successful. The ASP.net web service included also has the ability based on login to define which main config.xml the user is to receive.
dear Robert,
Thanks for your code and help.i make some changes in your code and its worked for me.
Thanks again
Nadir,
Glad that the code worked for you. Now can you help me in return?