Anjelina,
Are you just talking about the position of the horizontal slider or what exactly?
<?xml version="1.0" encoding="utf-8"?> <!-- /////////////////////////////////////////////////////////////////////////// // Copyright (c) 2011 Esri. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /////////////////////////////////////////////////////////////////////////// --> <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" autoDrawBackground="false"> <fx:Script> <![CDATA[ import mx.collections.ArrayList; import spark.core.NavigationUnit; import widgets.Geoprocessing.parameters.IGPParameter; [Bindable] private var hasChoiceList:Boolean; private var param:IGPParameter; override public function set data(value:Object):void { super.data = value; if (value) { param = value as IGPParameter; hasChoiceList = (param.choiceList && param.choiceList.length > 0); if (hasChoiceList) { choiceSelection.dataProvider = new ArrayList(param.choiceList); setChoiceListDefaultValue(param.defaultValue as String); choiceSelection.dataGroup.horizontalScrollPosition += choiceSelection.dataGroup.getHorizontalScrollPositionDelta(NavigationUnit.END); } } } private function setChoiceListDefaultValue(defaultValue:String):void { var defaultValueIndex:int = param.choiceList.indexOf(defaultValue); if (defaultValueIndex > -1) { choiceSelection.selectedIndex = defaultValueIndex; } } protected function updateDefaultValueWithChoice():void { param.defaultValue = choiceSelection.selectedItem; } ]]> </fx:Script> <mx:FormItem width="100%" label="{data.label}" required="{data.required}"> <s:TextInput width="100%" includeInLayout="{!hasChoiceList}" text="@{data.defaultValue}" toolTip="{data.toolTip}" visible="{!hasChoiceList}"/> <s:DropDownList id="choiceSelection" width="100%" change="updateDefaultValueWithChoice()" includeInLayout="{hasChoiceList}" requireSelection="true" visible="{hasChoiceList}"/> </mx:FormItem> </s:ItemRenderer>
Anjelina,
This is what I THINK (not 100% sure) you need to update:
GPInputStringParamItemRenderer.mxml<?xml version="1.0" encoding="utf-8"?> <!-- /////////////////////////////////////////////////////////////////////////// // Copyright (c) 2011 Esri. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /////////////////////////////////////////////////////////////////////////// --> <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" autoDrawBackground="false"> <fx:Script> <![CDATA[ import mx.collections.ArrayList; import spark.core.NavigationUnit; import widgets.Geoprocessing.parameters.IGPParameter; [Bindable] private var hasChoiceList:Boolean; private var param:IGPParameter; override public function set data(value:Object):void { super.data = value; if (value) { param = value as IGPParameter; hasChoiceList = (param.choiceList && param.choiceList.length > 0); if (hasChoiceList) { choiceSelection.dataProvider = new ArrayList(param.choiceList); setChoiceListDefaultValue(param.defaultValue as String); choiceSelection.dataGroup.horizontalScrollPosition += choiceSelection.dataGroup.getHorizontalScrollPositionDelta(NavigationUnit.END); } } } private function setChoiceListDefaultValue(defaultValue:String):void { var defaultValueIndex:int = param.choiceList.indexOf(defaultValue); if (defaultValueIndex > -1) { choiceSelection.selectedIndex = defaultValueIndex; } } protected function updateDefaultValueWithChoice():void { param.defaultValue = choiceSelection.selectedItem; } ]]> </fx:Script> <mx:FormItem width="100%" label="{data.label}" required="{data.required}"> <s:TextInput width="100%" includeInLayout="{!hasChoiceList}" text="@{data.defaultValue}" toolTip="{data.toolTip}" visible="{!hasChoiceList}"/> <s:DropDownList id="choiceSelection" width="100%" change="updateDefaultValueWithChoice()" includeInLayout="{hasChoiceList}" requireSelection="true" visible="{hasChoiceList}"/> </mx:FormItem> </s:ItemRenderer>
Anjelina,
No, I told you I was not 100% sure... I don't use the GP widget at all so I am not sure that the GPInputStringParamItemRenderer.mxml is the correct file to changed based on your screenshot. If the widget is not displaying anything now, then you most likely have an error in the code. Do you not see anything displayed in the problems window?