Add new field in cloned repeater web part

Shweta S asked on June 15, 2017 01:00

Hi,

I cloned a Repeater WebPart and added an extra field DocumentName which is a dropdown field. The values of the field comes via a sql query (custom page type table).

Basically, instead of selecting a Path on the webpart I would like the user to select a value from my new field. After saving the webpart,I want to do what would happen once a path is selected but with the value of the dropdown field.

How can I proceed to add functionality of the new field?

Correct Answer

Roman Hutnyk answered on June 15, 2017 09:39

You don't need an extra field in your cloned web part, just change control for Path property to drop down and populate with your sql query. Use DocumentName as text value for your drop down and NodeAliasPath as drop down value. I believe this will do a trick.

2 votesVote for this answer Unmark Correct answer

Recent Answers


Mike Wills answered on June 15, 2017 02:06

Hi Shweta,

One solution would be to create your dropdown with a second repeater. This would allow you to avoid cloning the out-of-the-box one. With this option you would:

Create a dropdown using a repeater, bound to your SQL query, and using customer transformations to render the dropdown.

Add script so that when the dropdown is changed a value is added to your URL as a query string.

Add a repeater to list the results on the page. Use a macro in the WHERE property to check the query string value and create the where condition.

Mike

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.