Note that there are some explanatory texts on larger screens.

plurals
  1. PODOJO StoreExplorer not displaying correctly
    primarykey
    data
    text
    <p>I have a very simple example of an html that calls a jsp page that returns a very simple JSON object. My problem is that what I expect the screen to show is not being displayed. </p> <p>Here is a screen shot of what I see.</p> <p><img src="https://i.stack.imgur.com/dqLiT.jpg" alt="screenshot"> <a href="http://www.flickr.com/photos/sky_dive_bound/4274347238/sizes/l/" rel="nofollow noreferrer">screen shot link</a></p> <p>Here is the relevent parts of the HTML file.</p> <p><code> </p> <pre><code>&lt;script type="text/javascript" src="resources/dojo/dojo.js" djConfig="isDebug:false,parseOnLoad:true"&gt;&lt;/script&gt; &lt;script&gt; dojo.require("dojo.data.ItemFileReadStore"); dojo.require("dojox.grid.DataGrid"); dojo.require("dojo.parser"); dojo.require("dijit.form.TextBox"); dojo.require("dijit.layout.ContentPane"); dojo.require("dojox.data.StoreExplorer"); var jsonStore; dojo.xhrGet({ url: "json.jsp", handleAs: "json", //handleAs: "text", load: populateDiv, error: function(type, data, evt){alert("error");} }); function populateDiv(dataItems) { console.log(dataItems); jsonStore = new dojo.data.ItemFileReadStore(dataItems); } &lt;/script&gt; &lt;div id="strexplr" dojoType="dojox.data.StoreExplorer" store="jsonStore" style="height:500px;width:100%;border:1px solid black"/&gt; </code></pre> <p></code></p> <p>Here is my JSP page. (forgive the formatting) <code> &lt;%@ page language="java" contentType="application/json; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> &lt;%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json" %></p> <pre><code>&lt;json:object&gt; &lt;json:property name="identifier" value="customer_name"&gt;&lt;/json:property&gt; &lt;json:property name="label" value="customer_address"&gt;&lt;/json:property&gt; &lt;json:array name="items" var="item" items="2"&gt; &lt;json:object&gt; &lt;json:property name="customer_name" value="nancy"&gt;&lt;/json:property&gt; &lt;json:property name="customer_address" value="LA"&gt;&lt;/json:property&gt; &lt;/json:object&gt; &lt;json:object&gt; &lt;json:property name="customer_name" value="ken"&gt;&lt;/json:property&gt; &lt;json:property name="customer_address" value="CA"&gt;&lt;/json:property&gt; &lt;/json:object&gt; &lt;/json:array&gt; &lt;/json:object&gt; </code></pre> <p></code></p> <p>Using the Firefox Plugin for JSON objects, I was able to determine I had a valid JSON object. Here is the output from the JSP page using that plugin.</p> <p><pre><code> {</p> <pre><code> identifier: "customer_name" label: "customer_address" items: [ { customer_name: "nancy" customer_address: "LA" } { customer_name: "ken" customer_address: "CA" } ] </code></pre> <p>} </pre></code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload