ITSmobile: HTML element size is independent of font size

[] [] [] []

Symptom

Templates are generated using table-less ITSmobile Generator (ITSGENMOBILE4) for 25 or more columns wide dynpros. To have this many columns visible on a mobile device’s screen, a font-size must be small (10pt). Text of this size is almost unreadable on the screen.
Customers would like to increase font size of individual elements, but doing so affects all other visual elements on the screen, which is not anticipated.

Reason and Prerequisites

In table-less ITSmobile Generator, HTML element width and position on the screen is based on EM units of measurements. This means that it depends on the font-size of the element.
This was done to enable easy proportinal resizing of the whole screen, by changing the font-size property of MobileHtml CSS class.
However, users complained that much more often they want to increase the font-size of individual elements without changing element’s size or positions on the screen.
Solution

Two new service parameters (SICF) are introduced:
~itsmobileElemFactor
defines the factor (integer number) by which the width of visible elements will be multiplied.
~itsmobileElemUnits
defins which measurements units will be used.
For example:
~itsmobileElemFactor 9
~itsmobileElemUnits px
will produce “width:90px” for a 10-dynpro-character wide button.
If no factor is specified, the default factor “0.82″ and default units “em” will be used (these defaults are defined in the constructor of the CL_ITS_GENERATE_HTML_MOBILE4 class)
This calculation is done in a function called “w()” which is implemented in ITSMOBILE/99/FUNCTIONS template, but you can have your own function, just copy the FUNCTIONS.HTML template into your service and define
~itsmobileFuncInclude
if the template name has changed during copying.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Comment