maqetta/maqetta — Issue #1145: ListItem should stuff value as child content rather than label attribute
Author: JonFerraiolo
Created: 2011-11-03 21:33:28+00:00
State: open
Labels: Mobile, Priority Low, Smart Input, Widget Libraries

@billreed63, @peller

Assigning to @jhpedemonte because @billreed63 is all booked up, but @jhpedemonte might be all booked up, too.

Remember we had issues with one of the first Preview 3 users with ListItem using 'label' attribute instead of child content? But besides the flakiness we saw with 'label' attribute, there is another reason for putting text content as innerHTML instead of within attribute: sometimes users will want to use rich markup. (That is, include some markup characters within SmartInput so that the radio button for "HTML markup" appears.) In fact, a user request is the reason I started poking around in this area. Sometimes users want a 2-line value as text content, where the top line is normal size and the bottom line is a smaller size:

```
MAJOR TEXT
minor text
```

Since dojox.mobile doesn't support major/minor text natively within the widget, the way to pull it off with dojo 1.7 is:

* Enter the following into smart input: ```

MAJOR TEXT

minor text

```
* In Properties palette, set 'height' on the ListItem to a larger value. (Defaults to 43px, perhaps set to 63px)
* In Properties palette, might want to set 'line-height' to a smaller value. (Defaults to 43px, perhaps set to 38px)
* In app.css, define the ListItemSubTitle class to something like this:

```
.ListItemSubTitle {
margin-left:1em;
font-size:12px;
line-height:12px;
font-weight:normal;
}
```

This bug is about putting the ListItem child content into innerHTML rather than the 'label' attribute. The reason for that is that while it is possible to put markup in the 'label' attribute, it's really ugly with all of the entities and therefore makes it virtually impossible to enter the desired markup in source view. It's probably just a few minutes to change widgets.json to say stuff the content into innerHTML.

@peller - probably good to ask the dojox.mobile guys about the possibility of supporting multi-line text values in ListItem in a future release so that authors don't have to resort to the monkey business I'm outlining above.