Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Nested repeater question. View modes: 
User avatar
Member
Member
vcarter - 7/19/2013 2:06:57 PM
   
Nested repeater question.
I am using a repeater to display a list of documents. One of the columns for the documents stores a list of business units as a pipe delimited list. Unlike my previous usage of the column, where the ID values are being used for filtering purposes. I would like to be able to display the list of associated business units as part of the document information.

So in the database I have:

DocumentName | Description | BusinessUnits
-------------------------------------------------------------------
Doc1 | A document | 1|2|3

Doc2 | A doc too | 3|5|7


And my list display would be something like:

Document Name | Description | Business Units
-------------------------------------------------------------------
Doc1 | A document | Business1, Business2, Business3

Doc2 | A doc too | Business3, Business5, Business7


I am not sure what the best way to handle this is. My initial thought is to try and use nested repeaters, but something about that feels clunky. Is there a recommended way for extracting this type of data(The business Units)?

Thanks

User avatar
Member
Member
vcarter - 7/19/2013 2:09:13 PM
   
RE:Nested repeater question.
As a caveat, I am trying to avoid writing custom controls, which would be the easiest way to accomplish my goal however it is not optimal due to restrictions on the development environment. So a solution available using the tools in the portal engine would be appreciated.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 7/19/2013 5:38:19 PM
   
RE:Nested repeater question.
Check this post out.

User avatar
Member
Member
vcarter - 7/23/2013 9:24:10 AM
   
RE:Nested repeater question.
FroggEye did you mean to link to the page on Object Versioning? I am not sure how that applies here?

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 7/23/2013 9:30:09 AM
   
RE:Nested repeater question.
@vcarter, not at all. Must have had a few too many clipboard copies that day. This is the post I meant to reference.

User avatar
Member
Member
vcarter - 7/23/2013 3:35:43 PM
   
RE:Nested repeater question.
Ah, that makes a lot more sense. Where I am getting stuck is at the nested repeater.

I have a document called fact sheet. It has a bunch of detail information. One column of that table is assigned to related business units. These are picked from a multi select list and are stored via kentico as a pipe delimited list in my fact sheet database table.

Ideally I would just store the names in that column, however kentico uses the ID as the value of my checkboxes.

Business units are not a document type. They are just reference data pulled from a custom table. So what I end up with is

Item | Description | Business Units
-----------------------------------------------
Red | A color | 1|3|7

I am trying to change "1|3|7" to Business1, Business3, Business7.

So my thought was to nest a repeater however I am not sure how I would pass the list 1|3|7 into the repeater to return the names.

I have tried to do this via my select statement but it seems I would require the addition of a function in order accomplish that task. Adding additional functions, while possible, is not optimal at this time. And my ability to add custom controls(my preferred way to handle this) is limited by my clients control of their environment. I am not able to add code without submission to the kentico directory on their server.

So my task has become solving simple coding problems only using the portal engine. And for the most part, Kentico has proven quite robust, the main issue I am having is when it comes to relational data like my business units.

thoughts?

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 7/24/2013 6:51:53 AM
   
RE:Nested repeater question.
Since you are limited strictly to using the portal engine without touching any physical files you can make your modifications in the transformation.
<script runat="server">
protected string GetBUName(object businessUnits)
{
// perform your string.split and lookup here and return Business 1, Business 2, Business 5
}
Business Unit(s) <%# GetBUName(Eval("MultiSelectField")) %>

User avatar
Member
Member
vcarter - 7/24/2013 12:05:30 PM
   
RE:Nested repeater question.
Wow, thanks FroggEye. I will give this a try. I was not sure what level of code could be used in a transformation.

User avatar
Member
Member
kentico_davidb2 - 7/22/2013 1:13:44 AM
   
RE:Nested repeater question.
Hi,

unless you want to develop it in the code (which would give you much more flexibility), I would recommend going with the nested repeaters.

This section of the Kentico CMS Controls guide might be of help: http://devnet.kentico.com/docs/controls/cms_listings_and_viewers_using_nested_controls.htm