Page 1 of 6

Collapsible block with dynamic content

Posted: Sat Oct 19, 2013 2:13 pm
by Deon

Hi

I have a collapsable set. The collapseblock header is dynamically populated with a description from the collection. This works perfectly.

Now I am trying to get a listview in the content of the collapseblock to display data based on the collapseblockheader text value.

I have mapped the collapseblockheader text to the Where Paramer in the Query service.

I invoke the service on expansion of the collapseblock, but the list is empty.
It works.

Is it correct to map against the CollapseBlock Header Text?

If I put a label containing the same text as the Cllapseblock header on the outside of the Collapseblock and change the Mapping it works but obviously not dynamically.

Please can you let me know if my mapping is correct.

My JS for the mapping is...
return ('{ $and: [ { "Category": "'+value+'" }, { "Property": "' + localStorage.getItem("PropertyName") + '" } ] }');

As I said this works with a label containing the Category Value.

Image


Collapsible block with dynamic content

Posted: Sat Oct 19, 2013 4:13 pm
by Illya Stepanov

Hello Deon,

[quote:]
If I put a label containing the same text as the Cllapseblock header on the outside of the Collapseblock and change the Mapping it works but obviously not dynamically.
[/quote]

can you clarify how it's not working as you need it? some screenshots would help -- how it's working now and how you want to get it working.


Collapsible block with dynamic content

Posted: Sat Oct 19, 2013 5:46 pm
by Deon

Hi Illya

It is very simple. I basically need to render the listview based on the collapsebloack header.

Similar to this link...
https://getsatisfaction.com/apperyio/...

Image


Collapsible block with dynamic content

Posted: Sat Oct 19, 2013 6:32 pm
by Illya Stepanov

I mean when you telling - it is working, but not dynamically, what do you mean by that?
Can you show the result you are getting now?


Collapsible block with dynamic content

Posted: Sat Oct 19, 2013 6:44 pm
by Deon

Sorry for the confusion. It is not working. The content area is empty. The listview is not being displayed/empty.


Collapsible block with dynamic content

Posted: Sat Oct 19, 2013 7:26 pm
by Illya Stepanov

What is the response when you test the where clause with your query in the service test tab?


Collapsible block with dynamic content

Posted: Sat Oct 19, 2013 8:29 pm
by Illya Stepanov

Are you sure you are defining the localStorage variable 'PropertyName' before executing the service?

Can you provide some steps to check this in your app?


Collapsible block with dynamic content

Posted: Sun Oct 20, 2013 1:07 am
by Deon

This is the problem.

Image

As you can see the query returns all the ColapseBlock Headers as well as the structure of it.

How would one only return the value of the ColapseBlockHeader that was expanded? This code below works with other elements (ie. Select), but does not work for the collapseblock element?

return ('{ $and: [ { "Category": "'+value+'" }, { "Property": "' + localStorage.getItem("PropertyName") + '" } ] }');

What needs to change in the code only to extract the expanded collapseblockheader value?


Collapsible block with dynamic content

Posted: Sun Oct 20, 2013 12:00 pm
by Deon

Any news here?


Collapsible block with dynamic content

Posted: Sun Oct 20, 2013 12:16 pm
by Alena Prykhodko

Hi Deon, sorry, not yet. Working to resolve it.