leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

How to put Html text in TextArea Component

I want to show story text when a name or picture is clicked in the app. I have created a detail page for this with a Textarea component named "detailedText" and a Back Button in the Header. The text I want to show is contained in xml node elements like so:

code<story>
<H1>The Story of Paul<&#47;H1>
<pic>Paul&#46;jpg<&#47;pic>
<p>This is line 1 of Paul's story<&#47;p>
<p>This is line 2 of Paul's story<&#47;p>
<p>This is line 3 of Paul's story<&#47;p>
<p>Line 4 of Paul's story has <g>a link<&#47;g> inside of it<&#47;p>
<&#47;story>/code
What do I need to do to be able to show all the items as Html inside the component on the page?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to put Html text in TextArea Component

Hello! If you change your text to look like standard html you can map that text to Panel component.

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

How to put Html text in TextArea Component

Hi Marina. My thinking is to convert this as Html on the fly, as needed and then send it to the component to be rendered. That is doable, right?

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

How to put Html text in TextArea Component

Please I really need help on this.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to put Html text in TextArea Component

Maybe, you would need to write or find some JavaScript to do that.

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

How to put Html text in TextArea Component

Thanks, Max. Maybe my question was vague. My question is not how to convert the elements to Html. My question is what is the Tiggzi code for extracting the element from the REST service so I can convert it to Html. Since Tiggzi is heavily UI oriented and simplifies things that way, I also need to know the Tiggzi code to pass the HTML to the Panel component to be displayed after it has been converted. thanks.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to put Html text in TextArea Component

Hello! You can add JS to mapping. Received value would be sent to that JS in variable "value". After converting this value to HTML you would need to return new value using "return" function - use return convertedValue; after all conversion.

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

How to put Html text in TextArea Component

Hello! One of my confusion is where to put the JS. I know you can add JS to Request that you have mapped to. But since I couldn't map the node to any component:

  1. Where would I add the JS?
  2. Would the value equal or the whole XML?
Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to put Html text in TextArea Component

1) You can add JS to Response too - transmitted value will be in "value" variable (http://docs.tiggzi.com/documentation/... see Mapping JavaScript section)

2) It depends on your mapping - you can map either whole XML or separate field

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

How to put Html text in TextArea Component

Thanks Marina. That's what I'm looking for.

Return to “Issues”