locked
Custom EditForm to Lookup Field not working correctly RRS feed

  • Question

  •     I have created a custom EditForm that use a DVDropDownList to display a filtered list of items from another list.  When I pull up the EditForm I'm getting a wierd result.  I the list I'm see the selected item duplicated.  I'll explain what I mean.  In my lookup list I have 4 entries; one, two, three, four.  The filter that is applied to the dataset, should be filtering the items, so that only items two, and three are displayed, which it is doing, but when I hit the drop down to see the list of choices whatever option is selected I'm see in there twice, for example

    When the selected item is two I'm seeing the following entries: two, two, three (notice that two is in there twice)
    When the selected item is one I'm seeing the following entries: one, two, three (I like the fact that it added the one I thought I would need to do something special to get this to work, which I still might, since it is not completely working).

    If I view the source and look at these options the I see something like this for the last two options on the list, which is what I would expect:
         <option value="2">two</option>
         <option value="3">three</option>
    But the first option in the list is something like, which I assume is not good since the value of the option is three and not 3:
         <option selected="selected" value="three">three</option>


        I'm also getting the Save Conflict Error when I try and save the entry, but I see several other posts dealing with that, so I will look into that after I get the list looking correct.  

        Here is my DVDropList tag:
    <!--<SharePoint:FormField runat="server" id="ff3{$Pos}" ControlMode="Edit" FieldName="Formula_x0020_Group" __designer:bind="{ddwrt:DataBind('u',concat('ff3',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Formula_x0020_Group')}"/>--> 
           <SharePoint:DVDropDownList runat="server" id="ff40{$Pos}" selectedvalue="{@Formula_x0020_Group}" 
            __designer:bind="{ddwrt:DataBind('u',concat('ff40',$Pos),'SelectedValue','SelectedIndexChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Formula_x0020_Group')}"   
            datasourceid="OpenFormulaGroups" datatextfield="Title" datavaluefield="ID" /> 
           
        And my DataSource tag looks like this:
    <SharePoint:SPDataSource runat="server" DataSourceMode="List" SelectCommand="&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Neq&gt;&lt;FieldRef Name=&quot;Formula_x0020_Complete&quot;/&gt;&lt;Value Type=&quot;Text&quot;&gt;1&lt;/Value&gt;&lt;/Neq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;ViewFields&gt;&lt;FieldRef Name=&quot;Title&quot;/&gt;&lt;FieldRef Name=&quot;ID&quot;/&gt;&lt;FieldRef Name=&quot;PermMask&quot;/&gt;&lt;/ViewFields&gt;&lt;/View&gt;" UseInternalName="True" ID="OpenFormulaGroups"><SelectParameters><asp:Parameter DefaultValue="Formula Group" Name="ListName"></asp:Parameter> 
    </SelectParameters><UpdateParameters><asp:Parameter DefaultValue="Formula Group" Name="ListName"></asp:Parameter> 
    </UpdateParameters><InsertParameters><asp:Parameter DefaultValue="Formula Group" Name="ListName"></asp:Parameter> 
    </InsertParameters><DeleteParameters><asp:Parameter DefaultValue="Formula Group" Name="ListName"></asp:Parameter> 
    </DeleteParameters> 
    </SharePoint:SPDataSource> 
     

    Thursday, July 24, 2008 2:38 PM

All replies

  • Try to do this

    1. Change "@Formula_x0020_Group" field type from lookupfiled to single line text. I suppose you can't simple change type, you should delete old field and create new one

    2. Use datavaluefield="Title" instead of datavaluefield="ID" 

     

    Thursday, May 12, 2011 10:49 AM