Page 1 of 1

display picture in itemlist iff picture exists in recordset

Posted: Fri Jul 18, 2014 4:16 pm
by EJLD

Hi Everyone,

overall concept:
I am doing like a forum where users post up msgs (via Appery DB).
some msgs may include pic att'd, and some others no attachment.

page layout:
I use the itemlist and the label to display the text.
question : if I include in the itemlist the picture component, then when no att'd pic, the component will be empty which doesn't look good.

choices:
anybody asked you this kind of question before ?
any direction I shld look into ?

thk you very much in advance,
Best,
Eric


display picture in itemlist iff picture exists in recordset

Posted: Fri Jul 18, 2014 6:25 pm
by Kateryna Grynko

Hi Eric,

You should use JS in service response mapping:
http://devcenter.appery.io/documentat...

And if you see an empty image URL in response, hide an Image component.


display picture in itemlist iff picture exists in recordset

Posted: Sat Jul 19, 2014 7:03 am
by EJLD

Hi (again) Katya,
i'll check this out too.
thk you for your prompt reply (again).
:)


display picture in itemlist iff picture exists in recordset

Posted: Sat Jul 19, 2014 12:48 pm
by EJLD

Hi, I need a bit more help.
I found the way to read the data of {record ; field} for the field AttdImg.
I can hide the first record's img component since the Appery("imagecomponent") name matches.
but I do believe that not all "imagecomponent" don't carry that same name since there are many.
consequently, my condition doesn't apply to all "imagecomponent".
how can I hide all empty images within my ItemList ?
thk you in advance,
Eric


display picture in itemlist iff picture exists in recordset

Posted: Sat Jul 19, 2014 1:02 pm
by EJLD

Hi again, I found the way to make it work.
thk you very much.
Eric