Hi!

I've this scenario where I've an accordion with a table of records filtered by a variable (CategoryID). When the number of posts of some category is more than 10 (eg.) i want to it display a ''See all'' link. When it has none i would like to display a ''create". 

How can i get a lineCount of those ''filtered'' values?

Thanks!

Hi Carolina,

all lists have in the output a count, so have an if with their conditions inside the accordion passing this count and every time you perform the filter inside the action make an ajax refresh in that accordion that has the if.


I hope it helps you..



Carolina

You can not use LineCount for or objective. Linecount set the max number of Rows|elements in tables


Regards

Solution

Marcilio Ferreira wrote:

Hi Carolina,

all lists have in the output a count, so have an if with their conditions inside the accordion passing this count and every time you perform the filter inside the action make an ajax refresh in that accordion that has the if.


I hope it helps you..



@Carolina:  What you might be missing (I had the same mental block for a while) is that the result of the ListFilter is a new list.  So as Marcilio said, you can drive your logic off of the Length property of the filtered list:  

Assuming you're using a List Records inside of an accordion, set the Line Count to 10 (or whatever).  Then add a container with the "See All" link and set the Display property to:


ListFilter.FilteredList.Length > 10

Then put another container with your "create" link and set the Display property to:


ListFilter.FilteredList.Length = 0

I guess for the "show all", you'll also need to do a little more work. You'll need a boolean input to your page (let's call it "ShowAllRecords", and default it to false.  On the List Records Line Count property:

If(ShowAllRecords = True,1000,10)

Then your link would call an Axax Submit to set ShowAllRecords to True and refresh the accordion

Solution

When I tried to do this before asking the community I did it by using an ''if'' expression, and I think that could have worked but I wasn't using lenght to make the statement, and then yes I had a mental block and thought that the lenght/count was respective to the total number os lines without the filter. 

Kevin, what you said was very helpfull and solved my doubt!

Thanks to all of you!

Alberto Ferreira wrote:

Carolina

You can not use LineCount for or objective. Linecount set the max number of Rows|elements in tables


Regards

Yes thanks! Actually I already had a "10" value on that, but somehow I didn't use the right words to make my question.


Carolina Santos wrote:

When I tried to do this before asking the community I did it by using an ''if'' expression, and I think that could have worked but I wasn't using lenght to make the statement, and then yes I had a mental block and thought that the lenght/count was respective to the total number os lines without the filter. 

Kevin, what you said was very helpfull and solved my doubt!

Thanks to all of you!

Excellent! Glad we could collectively help :)