Select to view content in your preferred language

How can i pass parameter from my custom mxml to flex viewer header widget

2121
15
Jump to solution
07-29-2014 01:10 AM
NadirHussain
Occasional Contributor II

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.

0 Kudos
15 Replies
NadirHussain
Occasional Contributor II

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");

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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.

0 Kudos
NadirHussain
Occasional Contributor II

Dear Robert

I import com.esri.viewer.AppEvent in my custom page.if I update code like below

url:URLRequest;

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.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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.

0 Kudos
NadirHussain
Occasional Contributor II

dear Robert,

Thanks for your code and help.i make some changes in your code and its worked for me.

Thanks again

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Nadir,

  Glad that the code worked for you. Now can you help me in return?

  1. Mark my reply where I gave you the link to my code as the answer by clicking on the "Correct Answer" button Correct-Answer.jpg
  2. Than any reply of mine that you found helpful you can click on the Action menu link at the bottom left of that reply and choose "Mark As Helpful".Helpful.jpg