Problems utilizing sessionStorage.getItem(); in ArcGIS Online

2345
6
05-25-2016 03:34 PM
BrendanDuffy
New Contributor II

Hi,
I am updating some web editing tools that use seesionStorage to navigate between a specific record and the featurelayer associated with it.

I have recently subscribe to ArcGIS Online and am wondering how I can customize the code to allow me to provide the same functionality, or if another option is available that is easy to implement.

Thank you for your help!

-Brendan

0 Kudos
6 Replies
RebeccaStrauch__GISP
MVP Emeritus

I don't know that this will help with your immediate question about session.Storage, but if you are wanting to do customization beyond what ArcGIS Online provides out-of-the-box, you will want to look at the Web AppBuilder Developer Edition.  There are many resources available.  To start off, I keep a Web AppBuilder Developer Edition - Customization Resource List​ that has many of the links and a lot of custom widgets folks have written.

To get started, you will want to download and read up on the official page Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers

The bookmark and follow Web AppBuilder for ArcGIS​  and Web AppBuilder Custom Widgets​ and those that I mention in the resource list, at a minimum Robert Scheitlin, GISP

To get started on installation Tips and Observations for getting Web AppBuilder -  Developer Edition Installed​  and TAPAS DAS​'s detailed pdf Installing Robert’s Enhanced Search Widget for the Web AppBuilder​​   which is very detailed on getting started.

0 Kudos
BrendanDuffy
New Contributor II

Thank you Rebecca, I will down load the Web AppBuilder (Developer Edition) and play around with it.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brendan,

I have recently subscribe to ArcGIS Online and am wondering how I can customize the code to allow me to provide the same functionality, or if another option is available that is easy to implement.

AGOL is a large vague term. Can you be more specific? Are you talking about one of the templated apps, or Web AppBuilder, etc, etc?

0 Kudos
BrendanDuffy
New Contributor II

Either the Web AppBuilder or templated apps such as the Find, Filter, Edit. What I am looking for is a method to sync both my app and the record on my website to only display the related feature automatically when the page loads. It is a pretty easy thing to do with the javascript api, just want a viable option for AGOL.

Thanks for the help.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brendan,

  Both the templated apps and WAB are built on top of the JS API so yes you can do the same thing in either of these that you could using the vanilla JS API.

BrendanDuffy
New Contributor II

HI Robert,

I have successfully launched an application from IIS However the session isn't working the same way as it was in the javascript widget.

Here is the break down from original javascript widget:

 

1. Form.html {this is the html page that houses the unique id that is being shared through a session to the JavaScript in the editor widget}:

var sample = "{{data}}";

sessionStorage.setItem("sample", sample);

 

2. JavaScript widget:

var sample1 = sessionStorage.getItem("sample") 

  • var query = new Query();
  • qyery.where = "Unique_ID'" +sample1 +"'";
  • query.outFields = ["*"];
  • query.returnGeometry =true;

This successfully grabs the records based on the unique id provided in the form.html

 

Web app builder:

1. index html:<between script tags>

var sample1 = sessionStorage.getItem("sample") 

OR

2. env.js 

var sample1 = sessionStorage.getItem("sample") 

 

2. config.JSON

included Unique_ID = 'sample1'

This is being referenced 6 times

 

This doesn't not grab the sessionStorage.

Can you help me?

 

Thanks in advance,

 

Brendan

0 Kudos