Josiel Denardi6690187
Posts: 0
Joined: Mon Feb 24, 2014 9:23 pm

Hide Button

I want to hide the button if the return from REST SERVICE will be empty.

If the "whatsapp" from REST SERVICE will be empty, the app should hide the button with the name "whatsapp"

Thank you.

Image Image

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

Hide Button

Try this:
click on js next to the whatlabel text field and add the following javascript:

pre
if (value === undefined) {
Apperyio("whatsapp").hide();
} else {
Apperyio("whatsapp").show();
}
return value;
/pre

Hopefully this will hide the whatsapp button if the corresponding data is empty

Josiel Denardi6690187
Posts: 0
Joined: Mon Feb 24, 2014 9:23 pm

Hide Button

Run when I was put if (value === undefined || value === "").

Thanks a lot,

Josiel Denardi6690187
Posts: 0
Joined: Mon Feb 24, 2014 9:23 pm

Hide Button

Terry, have a detail, the button is into list (list item) component. the system only considers the first button for hide. How I do for apply the hide for other buttons from list component? Is a array the buttons?

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

Hide Button

Glad i could help

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Hide Button

Hi

Does not work for me. This only applies to the first value in the list. For some reason it is not repeated for all list items?

Can anyone help, pleas?
Thanks

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

Hide Button

It should work for all list items, try checking the value of 'value' in the js and then altering the code above.

Notice if (value === undefined) worked for me, but Josiel also needed to check for a null string if (value === undefined || value === "").

It might be that you are checking for the wrong value,

Return to “Issues”