XModPro

Populating a Dropdown List

Warranty Mate Warranty Mate posted Jul 16, 2016
Active Jul 18 · Viewed 2336 times

Hi,

My 1st attempt at trying to populate a dropdown list from a view in the database. The view has handled the where statement so its just returning fields categoryID & Name

1st question is should I use a Feed or a <ControlDatasource>?

Ive tried using both but can't seem to get it to work although thanks to various articles here, I have got closer to getting it right. I can't seem to find an article or demo based on this exact need.

My feed is 

<xmod:Feed ContentType="text/html">

<ListDataSource CommandText="SELECT Categoryid, Name FROM vw_CategoryAU order by Name ASC">

</ListDataSource>

<HeaderTemplate></HeaderTemplate>

<ItemTemplate>

<option value="[[Categoryid]]"></option>[[Name]]</option>

</ItemTemplate>

<FooterTemplate></FooterTemplate>

</xmod:Feed>

the line in my form is

  <div><Label CssClass="xmp-form-label" For="Category">Category</Label><DropDownList Id="Category"

<xmod:LoadFeedButton FeedName="GrabCategoryAU" Target="CategoryID" Text="Name">

<Field Name="Categoryid" Value='[[Categoryid]]'></Field>

</xmod:LoadFeedButton>

</DropDownList></div>

1 Reply

Loading replies...