111
Views
3
Comments
Assign an attribute to <ul> and <li> elements in a record list
Question
How can I create a list with special attributes for <ul> and <li> elements from a record list? The result must be:

<ul specialattribute="ulValue">
    <li attribute="liValue">List item content</li>
    <li attribute="liValue">List item content</li>
    <li attribute="liValue">List item content</li>
</ul>

Outsystems however, creates the following code when defining special attributes to the record list (Line Separator: Bullets) and its list items:

<span id="wt1_wtMainContent_wtLR_Group_ctl00_wt3_wtRL_Content" specialattribute="ulValue">
    <ul>
        <li>
            <span specialattribute="liValue">
                <li>A1</li>
            </span>
        </li>
        <li>
            <span specialattribute="liValue">
                <li>A2</li>
            </span>
        </li>
        <li>
            <span specialattribute="liValue">
                <li>A3</li>
            </span>
        </li>
    </ul>
</span>

Instead of giving the <ul> and <li> elements a special attribute, the special attribute is assigned to a newly created <span> element. Currently I define the special attributes in "Extended Properties" of a list record and the expression(s) it contains. The attribute specialattribute I used in the example can be any desired attribute.
2016-04-21 20-09-55
J.
 
MVP
don't get me started on the span-tags :/

in any case, set the list-seperator to none and create the <li> with an expression (ans set escape-content to no ofcourse)
don't forget to add the ul as well! (probably with an if-clause )
beware those have to be inside the listrecords, otherwise you still end up with some annoying spans where you don't want them.

https://www.outsystems.com/ideas/1122/

https://www.outsystems.com/ideas/983/

UserImage.jpg
Filipe Fortunato
Statler & Waldorf wrote:
don't get me started on the span-tags :/

in any case, set the list-seperator to none and create the <li> with an expression (ans set escape-content to no ofcourse)
don't forget to add the ul as well! (probably with an if-clause )
beware those have to be inside the listrecords, otherwise you still end up with some annoying spans where you don't want them.

https://www.outsystems.com/ideas/1122/

https://www.outsystems.com/ideas/983/
 
 
 Thanks :)
UserImage.jpg
Nick
Thanks for the quick response. This is exactly what I was looking for.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.