Solved! Go to Solution.
Nice video, too bad he leaves out the important part.
While creating his service, he points out how/where you can select the formats available. However, he skips over and fails to mention this part from the help documentation:
So, it doesn't matter how many of the formats, templates, etc. you un-check creating the service, you will still get them all.
The only way I have found to get around this is to only allow one option (Constant value), or not give them the option in the config.
For the templates, you can, as long as you only have the two "desired" templates in the template folder.
R_
<mx:FormItem id="formatsFI" width="100%" includeInLayout="{shouldShowFormatOptions}" visible="{shouldShowFormatOptions}"> <!-- <s:DropDownList id="formatsDDL" width="100" dataProvider="{printTask.getServiceInfoLastResult.formats}" requireSelection="true"/> --> <s:DropDownList id="formatsDDL" width="100" requireSelection="true"> <mx:ArrayCollection> <fx:String>PDF</fx:String> <fx:String>JPG</fx:String> <fx:String>PNG</fx:String> </mx:ArrayCollection> </s:DropDownList> </mx:FormItem>
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.
Do you know is there possible to change the code to only show 2 choices for Layout template when using ESRI GP service on ExportWebMapForm.mxml?
Nice video, too bad he leaves out the important part.
While creating his service, he points out how/where you can select the formats available. However, he skips over and fails to mention this part from the help documentation:
So, it doesn't matter how many of the formats, templates, etc. you un-check creating the service, you will still get them all.
The only way I have found to get around this is to only allow one option (Constant value), or not give them the option in the config.
For the templates, you can, as long as you only have the two "desired" templates in the template folder.
R_
<mx:FormItem id="formatsFI" width="100%" includeInLayout="{shouldShowFormatOptions}" visible="{shouldShowFormatOptions}"> <!-- <s:DropDownList id="formatsDDL" width="100" dataProvider="{printTask.getServiceInfoLastResult.formats}" requireSelection="true"/> --> <s:DropDownList id="formatsDDL" width="100" requireSelection="true"> <mx:ArrayCollection> <fx:String>PDF</fx:String> <fx:String>JPG</fx:String> <fx:String>PNG</fx:String> </mx:ArrayCollection> </s:DropDownList> </mx:FormItem>
I looked into this, because I did it a while back and had forgotten how I got around that bug in the API V3.1
Try this out in your ExportWebMapForm.mxml
<mx:FormItem id="formatsFI" width="100%" includeInLayout="{shouldShowFormatOptions}" visible="{shouldShowFormatOptions}"> <!-- <s:DropDownList id="formatsDDL" width="100" dataProvider="{printTask.getServiceInfoLastResult.formats}" requireSelection="true"/> --> <s:DropDownList id="formatsDDL" width="100" requireSelection="true"> <mx:ArrayCollection> <fx:String>PDF</fx:String> <fx:String>JPG</fx:String> <fx:String>PNG</fx:String> </mx:ArrayCollection> </s:DropDownList> </mx:FormItem>