Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > KB Article: Selected item transformation in query repeater View modes: 
User avatar
Member
Member
Darren - 8/13/2009 11:06:45 AM
   
KB Article: Selected item transformation in query repeater
I have set this up using the instructions in the KB article but I have discovered a slight problem.

I have a web part that is set to only display for the selected document type in the repeater. Using the normal repeater it works fine and appears when a doc is selected but using this method it never appears. It's like the CMS doesn't know how to, or doesn't even try, to check what document type it is.

Any ideas on what I can do to recify this? Thanks for any help.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 8/18/2009 5:43:53 AM
   
RE:KB Article: Selected item transformation in query repeater
Hello,

could you please tell us if you use Show for document types property of query repeater do you restrict the parent document where the list of items should be?

It will work only if you click on an item of the list. It needs to know the query string from the URL so it will not work if you access the document by differently from clicking on the item in the list of items.

Does it help?

Best regards,
Helena Grulichova

User avatar
Member
Member
Darren - 8/18/2009 8:15:19 AM
   
RE:KB Article: Selected item transformation in query repeater
Well I have the repeater with the list of items and below that I have a static HTML web part that is only set to display for the document type that is listed in the repeater (show for document types). I click on an item in the repeater but the web part doesn't show on the transformation.

User avatar
Member
Member
Darren - 8/20/2009 4:17:01 AM
   
RE:KB Article: Selected item transformation in query repeater
Could I perhaps achieve this by using Macros? All the links in my repeater are using a querystring.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 8/20/2009 9:10:18 AM
   
RE:KB Article: Selected item transformation in query repeater
Hello Darren,

Could you please confirm me that I understand you?
You have a repeater configured according the knowledge base article. There is a Static HTML web part on the same template below the repeater. The Static HTML web part is configured to be shown only for document types which are listed by the repeater. So the parent should display the list of items and no Static HTML content. Children should show up the Selected item transformation and the content of the second web part. Is it right?

I tested this scenario and it worked correctly. Am I missing anything?

Best regards.
Helena Grulichova

User avatar
Member
Member
Darren - 8/20/2009 10:26:25 AM
   
RE:KB Article: Selected item transformation in query repeater
Hi Helena,

Yes that's exactly right. Although I have made one small change which perhaps I should have mentioned before.

In the KB article it says to have the following as the default transformation:
<a href="<%# GetDocumentUrl() %>?newsid=<%# Eval("NewsID") %>"><%# Eval("NewsTitle") %></a>

But this always generates the URL as default.aspx?newsid=... regardless of where the page is. I'm really not sure why? With this I was just getting blank results on the selected transformation.

My page is called jobs.aspx. I just substituted the <%# GetDocumentUrl() %> and hard coded the url in as follows:
<a href="jobs.aspx?jobid=<%# Eval("jobID") %>"><%# Eval("jobname") %></a>

...which works fine. Or at least I thought it did.

Could this be causing my problems?

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 8/26/2009 4:04:31 AM
   
RE:KB Article: Selected item transformation in query repeater
Hi Darren,

This issue is caused by when using this approach described in KB article you are not redirected to actual document displayed in detail (like with standard CMSRepeater), but you remain on the same page, only the query repeater is set to display only data of this one particular document. I would recommend creating copy of static text web part, and into its code-behind put code that will check the 'jobid' query string parameter - if it contains any value the detail is being displayed and you can show static text, otherwise you can hide it.

Best Regards,

Martin Dobsicek

User avatar
Member
Member
Darren - 8/27/2009 4:10:48 AM
   
RE:KB Article: Selected item transformation in query repeater
Hi Martin,

Yes that worked, thanks!