none
Can I and how do I control the initial row value of a UocDropDownList RCDC control? RRS feed

  • Question

  • I am populating a DropDownListBox via a lookup of FIM objects.

    My createUser rcdc has near the top the line

    <my:ObjectDataSource my:TypeName="UocSearchDataSource" my:Name="search"/>

    I created a reference attribute departmentRef and bound it to User type objects.

    I have a custom Resource called CostCenters.

    I am populating my dropdownlist control with this code:

          <my:Control my:Name="departmentRef" my:TypeName="UocDropDownList" my:Caption="Tulosyksikkö" my:Description="{Binding Source=schema, Path=departmentRef.Description}" my:RightsLevel="{Binding Source=rights, Path=departmentRef}">
            <my:Properties>
                <my:Property my:Name="Required" my:Value="True"/>
                <my:Property my:Name="Columns" my:Value="40"/>
                <my:Property my:Name="ItemSource" my:Value="{Binding Source=search, Path=CostCenters}"/>
                <my:Property my:Name="SelectedValue" my:Value="{Binding Source=object, Path=departmentRef, Mode=TwoWay}"/>
            </my:Properties>
          </my:Control>

    I am very surprised to see the initial row of my List of Options being set to "<Please select an item>"

    When I expand the list I see all my CostCenters beneath this "<Please select an item.>" row.

    BUT, How do I get rid of this "<Please select an item>"?

    I would like either a NULL initial row or the first real CostCenter.

    What am I doing wrong?

    Should the create rcdc not have the selectedvalue property? I am baffled where this <Please select an item> string comes from!

    *HH

    Tuesday, January 13, 2015 11:28 AM

All replies

  • This works for me.  It defaults to the first item on the list.

    <my:Control my:Name="departmentRef" my:TypeName="UocDropDownList"
    my:Caption="Tulosyksikkö" my:Description="{Binding Source=schema, Path=departmentRef.Description}"  my:RightsLevel="{Binding Source=rights, Path=departmentRef}">
           
     <my:Properties>
             
      <my:Property my:Name="Required" my:Value="true"/>
             
      <my:Property my:Name="ValuePath" my:Value="Value"/>
             
      <my:Property my:Name="CaptionPath" my:Value="Caption"/>
             
      <my:Property my:Name="HintPath" my:Value="Hint"/>
             
      <my:Property my:Name="ItemSource" my:Value="{Binding Source=schema, Path=departmentRef.LocalizedAllowedValues}"/>
             
      <my:Property my:Name="SelectedValue" my:Value="{Binding Source=object, Path=departmentRef, Mode=TwoWay}"/>
           
     </my:Properties>
         
    </my:Control>

    Best,

    Nosh


    Nosh Mernacaj, Identity Management Specialist

    Wednesday, January 21, 2015 11:13 PM
  • I would hope that in your case it would since you are hand feeding a static list of values to be used into the Dropdownbox control.

    What I am surprised by is when we load the values from resource objects e.g. TimeZones, CustomResources like cost centers and so on. Note the source of the bound items! mine is search yours is schema.

    I use the same logic as the TimeZone drop down box. The TimeZone drop down returns "Default TimeZone" as the first option when expanded. Please check if there is in fact a 'Default TimeZone' in the loaded TimeZone resource objects!

    WhereTF do these default strings come from???????

    How can I change them to what *I* want them to be????????????

    Tuesday, January 27, 2015 7:16 AM