Select to view content in your preferred language

How change Geoprocessing widget interface?

2382
8
12-10-2013 06:26 PM
by Anonymous User
Not applicable
Original User: anjelinapon

Hi
My config.xml is: <layoutdirection>rtl</layoutdirection>
Because of above configuration (I need rtl direction), my geoprocessing widget show the drop down list right to left by default, like below picture:
[ATTACH=CONFIG]29752[/ATTACH]

As you see the items are right (Shown by red arrow).

It should be on the left, like this:

[ATTACH=CONFIG]29753[/ATTACH]

What should I do?
please help me.
Regards
A.ponker
0 Kudos
8 Replies
by Anonymous User
Not applicable
Original User: rscheitlin

Anjelina,

   Are you just talking about the position of the horizontal slider or what exactly?
0 Kudos
anjelinaponker
Emerging Contributor
Anjelina,

   Are you just talking about the position of the horizontal slider or what exactly?


Yes, horizontal slider position is my request.
0 Kudos
anjelinaponker
Emerging Contributor
Im looking for a solution to align left the horizontal slider position.
Please help me.
Regards
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

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>
0 Kudos
anjelinaponker
Emerging Contributor
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>



Hi

It dont work. When I add this changes, geoprocessing widget dont show any things.


Are you sure about this line?:
                        choiceSelection.dataGroup.horizontalScrollPosition += choiceSelection.dataGroup.getHorizontalScrollPositionDelta(NavigationUnit.END);


Regards
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

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?
0 Kudos
anjelinaponker
Emerging Contributor
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?




No, there is not any thing in the problem window and flex application ran ok.
What should I do?
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

Anjelina,

   Sorry, I have no further advice.
0 Kudos