Select to view content in your preferred language

multiple widget states, datagrids and scrollers

743
3
Jump to solution
04-03-2012 05:56 AM
ErikMartin
Frequent Contributor
Hi,

I have am working on developing a custom geoprocessing widget.  I have been making good progress, but have hit a couple problems that have me stumped.

The first involves datagrids.  The widget has 3 states -- an input form, a status update window that adds ArcGIS Server messages (from the python script), and a results datagrid.  I have the input form and the status updates working fine and now I am trying to get the datagrid working (and eventaully bound to the results graphicLayer).  To emphasize... the geoprocessing functionality and return of a graphicLayer result works -- both when I run it from localhost (http://localhost/ViewerCustom/bin-debug/index.html)) as well as when I run it from my test server.  However, when I add a generic sample datagrid using the follow code, it works fine when I am debugging locally (running it localhost) but, when I copy the .swf onto my test server, the widget won't even load up.  If I look in Firebug the GET CustomWidget.swf response is blank... nothing happens. 
    <s:Group id="resultsState" includeIn="Results"        width="100%" height="100%"        y="20">      <s:Panel width="100%" height="100%">              <s:DataGrid id="resultGrid" width="100%" height="100%" requestedRowCount="5">        <s:ArrayCollection>         <s:DataItem key="1000" name="Abrasive" price="100.11" call="false"/>         <s:DataItem key="1001" name="Brush" price="110.01" call="true"/>         <s:DataItem key="1002" name="Clamp" price="120.02" call="false"/>         <s:DataItem key="1003" name="Drill" price="130.03" call="true"/>         <s:DataItem key="1004" name="Epoxy" price="140.04" call="false"/>         <s:DataItem key="1005" name="File" price="150.05" call="true"/>         <s:DataItem key="1006" name="Gouge" price="160.06" call="false"/>         <s:DataItem key="1007" name="Hook" price="170.07" call="true"/>         <s:DataItem key="1008" name="Ink" price="180.08" call="false"/>         <s:DataItem key="1009" name="Jack" price="190.09" call="true"/>                     </s:ArrayCollection>        </s:DataGrid>      </s:Panel>     </s:Group>


However, if I take out the data grid and replace it with a text message, the widget loads fine when I copy the .swf over to my test server, the text is visible in the "Results" state , and the rest of the functionality continues to work.

    <s:Group id="resultsState" includeIn="Results"        width="100%" height="100%"        y="20">      <s:Panel width="100%" height="100%">       <s:TextArea text="test test test... this works fine"/>      </s:Panel>     </s:Group>

The test server is running the Flex Viewer 2.5 that is customized using config files to point to my URLs, change the color scheme, etc.  On my localhost, I am running the mostly un-configured Viewer 2.5 source code (I did the minimal amount of configuration necessary to plug in my URL and load my custom widget).  In both cases, I am consuming the apps on the same desktop computer with Firefox & the most recent debugger version of Flash.

So my question is: what else might be different between running an app on localhost and a server that could effect how a datagrid is handled?  Is there some other setting or option I should look into?  Any suggestions would be most welcome.

A second and mostly unrelated question...  In the same widget, if I add scroll bars (by wrapping a S:Scroller around the widget group the Design View in Flash BUilder gets grayed out.  This seems odd, but not critical.  Again, tahnks in advance for any insight.

 <viewer:WidgetTemplate id="myCustomWidget" includeIn="Params,Processing, Results"           width="450" height="600"          minWidth.Params="415" minHeight.Params="150">   <s:Scroller width="100%" height="100%"       y="25"      horizontalScrollPolicy="on"      verticalScrollPolicy="on">    <s:Group id="widgetGrp"       width="100%" height="100%">     <s:Group id="paramsArea"        width="100%" height="100%"        y="-35"        includeIn="Params">             <s:TextInput id="filter"           x="68" y="48"           text="&quot;OBJECTID&quot;&lt;200"          width="289" height="20"/>      <s:Button id="submit"          x="190" y="720"           label="Submit"           click="submit_clickHandler(event)"/>      <s:Button id="clear" x="270" y="720" label="Clear Results" click="clear_clickHandler(event)"/>           </s:Group>     <s:Group id="processArea"        width="100%" height="100%"        includeIn="Processing">      <s:TextArea id="statusArea" width="100%" height="100%" y="20" alpha="0.7" verticalScrollPolicy="off"/>     </s:Group>                                      <s:Group id="resultsArea" includeIn="Results"        width="100%" height="100%"        y="20">      <s:Panel width="100%" height="100%">       <s:TextArea text="test test test... this works fine"/>      </s:Panel>     </s:Group>    </s:Group>   </s:Scroller>  </viewer:WidgetTemplate> 
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ErikMartin
Frequent Contributor
I believe I may have found the problem: some of the .swz files in the bin debug folder are different versions, even though they are both Viewer 2.5.  On my test server, for example, i have spark_4.1.0.16076.swz while on my localhost it is spark_4.6.0.23201.swz.  I will post if updating these files solves the problem.

View solution in original post

0 Kudos
3 Replies
ErikMartin
Frequent Contributor
I believe I may have found the problem: some of the .swz files in the bin debug folder are different versions, even though they are both Viewer 2.5.  On my test server, for example, i have spark_4.1.0.16076.swz while on my localhost it is spark_4.6.0.23201.swz.  I will post if updating these files solves the problem.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Erik,

   That sould definetly fix the issue. The 4.1 Swz's on the production machine do not know what a s:DataGrid is as the spark data gird was not around back then.
0 Kudos
ErikMartin
Frequent Contributor
Yes-- that did in fact fix the problem.  I went through and completely aligned my local debug version (that I run on localhost) and the test server version so that all the library versions, widgets & configuration files are the same.  Hopefully I won't run into the same problem again.

Thanks,
-Erik
0 Kudos