API
Version 7.x > API > Query Repeater Nested Repeaters Where condition View modes: 
User avatar
Member
Member
jilheu-manapro - 5/18/2013 2:32:58 PM
   
Query Repeater Nested Repeaters Where condition
Hi

I have a problem with a queryrepeater in which i need to pass the WhereCondition, I already try to do like proposed solution in that Nested Repeaters Where condition but it doesn't work my code is like this:
<cc1:queryrepeater id="CMSRepeater1" runat="server" TransformationName="customtable.temas.Titulo" QueryName="customtable.temas.selectdocuments"
SelectTopN="1" />
<h2><%# Eval("Titulo") %></h2>
</div>
<script runat="server">
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
CMSRepeater1.WhereCondition= "nombreTema = "+ Eval("Tema");
CMSRepeater1.ReloadData(true);
}
</script>

that is in a selected transformation loading by a repeater

another question is why if kentico is in version 7 this webpart still not have the delayed property?

I appreciate your answers

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/20/2013 1:41:22 AM
   
RE:Query Repeater Nested Repeaters Where condition
Hello,

It seems you are using the query repeater web part and not the control - only controls can be nested.

You should use "<cms:QueryRepeater..."
Also, have you tried setting the nested control the DelayedLoading property to true?

Best regards,
Juraj Ondrus

User avatar
Member
Member
jilheu-manapro - 5/22/2013 5:33:37 PM
   
RE:Query Repeater Nested Repeaters Where condition
Hello Juraj,

I did what do you say, and the site gives me the next error:
[CMSDataProperties.LoadTransformation]: Type 'CMS.Controls.QueryRepeater' does not have a public property named 'DelayedLoading'.

I change the "<cc1:queryrepeater" for "<cms:QueryRepeater..." and annexed the DelayedLoading property to true

Any help is appreciate, Thanks

Best Regards
jilheu

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/24/2013 2:11:14 AM
   
RE:Query Repeater Nested Repeaters Where condition
Hi,

Indeed, the control does not have this property - checking the code, it should not be necessary to have it. Could you please use the control instead of the web part and set its properties in the script tag as you did for the web part in your first post and reload the data for given control?

Best regards,
Juraj Ondrus

User avatar
Member
Member
lwhittemore-emh - 6/29/2013 1:25:26 PM
   
RE:Query Repeater Nested Repeaters Where condition
I am trying to do this but no matter what field I put into the script I get a where condition that is "1=1"

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/1/2013 1:13:00 AM
   
RE:Query Repeater Nested Repeaters Where condition
Hi,

Could you please share your code and settings?

Best regards,
Juraj Ondrus

User avatar
Member
Member
vcarter - 7/25/2013 10:18:50 AM
   
RE:Query Repeater Nested Repeaters Where condition
Make sure your query has a WHERE statement: WHERE ##WHERE## or you can put the where clause in your code

<script runat="server">
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
CMSRepeater1.WhereCondition= "WHERE nombreTema = "+ Eval("Tema");
CMSRepeater1.ReloadData(true);
}
</script>


I had a similar 1=1 problem and I believe that ultimately was my problem, the WHERE statement was not being set correctly.