Results 1 to 6 of 6
  1. GSMacLean's Avatar
    Posts
    57 Posts
    Global Posts
    68 Global Posts
       #1  
    Is there a simple way to insert HTML into a ListSelector widget? I want to have some of the items in the list to have HTML, such as <sup>xx</sup>, and characters like &deg; - but webOS escapes all of this and shows it verbatim, instead. What I want is the equivalent of the "allowHTMLMessage" argument in the showAlertDialog function. Is there a way around this that anyone knows of?
    http://wwwebos.com - webOS User Community
  2. #2  
    I think I just read something about this, I will see if I can find it.

    Edit: found it. I think this may help you: (From http://developer.palm.com/index.php?...rticle&id=1742) I could not find anything regarding escaping in the MOJO doc.

    Controlling HTML Escaping in Templates

    HTML escaping in templates is controlled by the value of escapeHTMLInTemplates in the file framework_config.json. If your application does not already have a framework_config.json file, create one in the application directory.

    By default, HTML escaping is turned on in the PalmŪ Mojo™ SDK version 0.3.5 or above, and off in version 0.3.4 or below.

    HTML escaping is important unless you are sure that the content is safe, because unescaped HTML that is interpreted by the application can have unintended consequences.

    * To turn off HTML escaping in templates, place the value "escapeHTMLInTemplates":false in framework_config.json. Example:

    { "escapeHTMLInTemplates": false }

    * To turn on HTML escaping in templates, place the value "escapeHTMLInTemplates":true in framework_config.json. Example:

    { "escapeHTMLInTemplates": true }

    With HTML escaping turned on, you can add a leading hyphen ('-') to any property reference in the template to prevent its HTML from being escaped. Example:

    #{-myPropertyWithHTML}
  3. GSMacLean's Avatar
    Posts
    57 Posts
    Global Posts
    68 Global Posts
       #3  
    Yeah, I'd rather not turn off HTML escaping in my entire app (that's kind of dangerous when you're accepting foreign input), and escaping just the -listElements in the template doesn't seem to have any effect. I'm sure I'm missing something obvious.
    http://wwwebos.com - webOS User Community
  4. #4  
    Maybe you just wrote that wrong about the listElements ... you don't want to escape them, you want them to be un-escaped. The way I read it is escaping is turned on by default, which is why you get garbage, but you can disable escaping for a particular tag with the hyphen. I have not started doing any development yet, but when I do, that is an area I will want to work on.
  5. GSMacLean's Avatar
    Posts
    57 Posts
    Global Posts
    68 Global Posts
       #5  
    Quote Originally Posted by Grabber5.0 View Post
    Maybe you just wrote that wrong about the listElements ... you don't want to escape them, you want them to be un-escaped. The way I read it is escaping is turned on by default, which is why you get garbage, but you can disable escaping for a particular tag with the hyphen. I have not started doing any development yet, but when I do, that is an area I will want to work on.
    Yup you're right - teach me to write message at 2:30 am.

    I want the items in my listElements to NOT be escaped.
    http://wwwebos.com - webOS User Community
  6. #6  
    I found some threads on the Palm developer forums on the subject this morning. It sounds to me like you should be able to do it.
    Last edited by Grabber5.0; 10/18/2009 at 03:55 PM.

Tags for this Thread

Posting Permissions