Select to view content in your preferred language

PrintWidget Layout dropdown list - How to get rid of some items

5564
20
Jump to solution
07-23-2012 12:06 PM
ShaningYu
Honored Contributor
In V3, I want to get rid of some items in the PrintWidget layout dropdown list.  However, all of these items are defined in the server-side Geoprocessing Print Tool.  Is there a way to filter out some of the items?  Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Shanning,

   Yep that is what:
<layouttemplates visible="false">MAP_ONLY</layouttemplates>
means.

View solution in original post

0 Kudos
20 Replies
RobertScheitlin__GISP
MVP Emeritus
Shanning,

   I don't see anywhere that this list is configurable , but you could always replace the drop down lists dataprovider in the code:
replace printTask.getServiceInfoLastResult.layoutTemplates in the ExportWebMapForm.mxml
        <s:DropDownList id="layoutTemplatesDDL"
                        width="175"
                        dataProvider="{Your own iList}"
                        requireSelection="true"/>
0 Kudos
BjornSvensson
Esri Regular Contributor
You are supposed to be able to do this two different ways, but neither one is working properly.  Neither server side when you publish the print service, nor clientside.

Serverside:
See http://resources.arcgis.com/en/help/main/10.1/index.html#/Tutorial_Publishing_additional_services_fo...
"Due to a known limitation with the Export Web Map tool in 10.1, you cannot filter the parameter choices available to end users.
You can hide a parameter completely from end users and force them to use the default by setting the parameter's Input mode to Constant value."


Client-side:
The same is true client-side.  Despite the tag reference in the resource center is hinting at how it should work, but it doesn't seem to work that way (yet).

But if you want to "hardcode" it and not make it show up in the widget, then you could use something like:
    <layouttemplates visible="false">A4 Portrait</layouttemplates>

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Print_widget_tags/01m30000001n0...
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Bjorn,

   The client side documentation is pretty confusing as there is a layouttemplates element, yet in the actual widget code there is nothing that will use a value other than the first one (i.e. not comma separated list or anything). As it is now you can enter one value and then have it supposedly do the same thing by defining the defaultvalue attribute. The layouttemplates needs to be able to override the printTask.getServiceInfoLastResult.formats and allow for multiple entries if you want to just eliminate one or more particular layouts. Is that the direction that the fix is going to go?
0 Kudos
ShaningYu
Honored Contributor
After I posted my thread, I tried the approach (the same as Robert proposed),
   [Bindable] public var layoutList:ArrayCollection = new ArrayCollection(
    [{label:"A3 Landscape"}, {label:"A3 Portrait"}, {label:"A4 Landscape"},
                                                                {label:"A4 Portrait"},  
     {label:"Letter ANSI A Landscape"}, {label:"Letter ANSI A Portrait"},   
     {label:"Tabloid ANSI B Landscape"}, {label:"Tabloid ANSI B Portrait"} ]  );
  <s:DropDownList id="layoutTemplatesDDL"
    width="175"
    dataProvider="{layoutList}"
    requireSelection="true"/>
But I received the error,
Error executing print task:
[RPC Fault faultString="Unable to complete operation." faultCode="400" faultDetail="Error executing tool.: ERROR 000800: The value is not a member of A3 Landscape | A3 Portrait | A4 Landscape | A4 Portrait | Letter ANSI A Landscape | Letter ANSI A Portrait | Tabloid ANSI B Landscape | Tabloid ANSI B Portrait | MAP_ONLY.
The value is empty.
ERROR 000800: The value is not a member of A3 Landscape | A3 Portrait | A4 Landscape | A4 Portrait | Letter ANSI A Landscape | Letter ANSI A Portrait | Tabloid ANSI B Landscape | Tabloid ANSI B Portrait | MAP_ONLY."]
0 Kudos
ShaningYu
Honored Contributor
Bjorn,
Where the code
<layouttemplates visible="false">A4 Portrait</layouttemplates>
should be put?  Is it in <fx:Declarations> </fx:Declarations> bolck?  Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Shanning,

   It goes in the PrintWidget.xml
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Shanning,

   This worked for me.

[Bindable] public var layoutList:ArrayCollection = new ArrayCollection(["A3 Landscape","A3 Portrait","A4 Landscape","A4 Portrait","Letter ANSI A Landscape","Letter ANSI A Portrait","Tabloid ANSI B Landscape","Tabloid ANSI B Portrait"]);

        <s:DropDownList id="layoutTemplatesDDL"
                        width="175"
                        dataProvider="{layoutList}"
                        requireSelection="true"/>
        <!--printTask.getServiceInfoLastResult.layoutTemplates-->
0 Kudos
ShaningYu
Honored Contributor
Robert:  I use the PrintTools in our ArcGIS Server.  Did you do any customization on that tool?  I still get the same error.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Shaning,

   Nope I just tested against the esri printTools.
0 Kudos