Page 1 of 1

Can a list divider have a label component from the UI?

Posted: Fri Nov 15, 2013 12:10 am
by Branden

Hmm... I'm trying to add value from the database to a Label in the UI. No big deal normally... But I do not seem able to drag a label component onto a List divider. Can a Label component be inserted into a List divider? If not, is it possible to dynamically change the label of a divider from within the Appery UI?

If not, that's fine. I think I can do it another way, just would be nicer if I could do it this way. :-)

Thanks!


Can a list divider have a label component from the UI?

Posted: Fri Nov 15, 2013 8:12 am
by Kateryna Grynko

Hi Branden,

This can't be done in UI builder. Please change dynamically:preAppery("mobilelistitem_3").html("");
Appery("mobilelistitem_3").append("test");/pre


Can a list divider have a label component from the UI?

Posted: Sat Nov 16, 2013 3:37 am
by Branden

Thank you! :)


Can a list divider have a label component from the UI?

Posted: Thu Sep 25, 2014 5:46 pm
by Fred McIntyre

I need to do the same thing, however I need to do it in mapping the response from a REST api array.

I have a list item:
Image

I need to replace "contact_info" in each item with html from the response:
Image

"info" in the response array is html. In the old builder, before 9/22/2014, it worked fine. But now it doesn't.

Just mapping it like this causes the < and > to be changed to < and &gt. Looking at the source of the page, when testing in a browser, I see that the text from the response is between <a> and </a> I have tried numerous ways, with JavaScript to modify the Text of the list item in the mapping, but can't figure out what I need.

The suggestion above works if you are changing one specific list item since you know the name of it. However, in the loop in the Success mapping I don't know what the name of each item would be. Nor am I sure that code would change just the text of the "a" tag.

I also tried dropping an HTML component on the list item in the Builder UI, but that wipes out the button/icon to the right on the list item, and I need that button.

I also have other instances where I would like to put HTML code into a label. I know I could use an HTML component instead, but they aren't as flexible as labels.

One possibility would be if, in the Services creation, where the Response fields are, one of the items in the drop down of the type of was HTML:
Image

I realize that would require modification of the Builder code, and even if that suggestion is accepted by the developers, I can't wait until it would be implemented. I need to publish this app as soon as I can.

Any help would be appreciated.
Fred


Can a list divider have a label component from the UI?

Posted: Thu Sep 25, 2014 6:19 pm
by Fred McIntyre

Update:
In the Javascript in the Success mapping for the Text of the list item, I put:
prereturn '<div>test<>';/pre

and that is exactly what shows in the app. So, obviously, the escaping of the content is done after the Javascript is run. The only thing I can think of to deal with this is to add a Run Javascript after the mapping and try to find the list item elements and unescape the html code that was put in with the mapping. I'd have to loop through the list item object. I will give that a try and add another comment with my success or failure report.


Can a list divider have a label component from the UI?

Posted: Thu Sep 25, 2014 7:47 pm
by Fred McIntyre

I solved my problem by putting a grid on the list item, and in the grid cell I put an HTML component, then mapped my info to the HTML component.


Can a list divider have a label component from the UI?

Posted: Thu Sep 25, 2014 8:01 pm
by Kateryna Grynko

Hi Fred,

Thank you for the update! Glad it's solved.
Please let me know if you have any questions.