SetWebStyle Method


PLB Web Only, 9.7C

 

The SetWebStyle method sets a specific CSS style for a PWS object which is implemented as a visible HTML object.

 

[label]

{object}.SetWebStyle

[GIVING {return}] [USING [*CssName}=]{cssname}:

 

 

[{*StrValue}=]{strvalue}[,[*Flags=]{flags}]

Where:

Where:

{label}
Optional. A Program Execution Label.
{object}
Required. A PWS object type that is being accessed.
{return}
Optional. A Numeric Variable that receives the pass or fail result for the execution of the method.
{CssName}
Required. A Character String Variable or Literal that specifies the CSS style name.
{StrValue}
Required. A Character String Variable or Literal that specifies the CSS style value.
{Flags}
Optional. A Numeric Variable or Literal that invokes special behaviors for the method.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. This method dynamically changes the CSS styles as described at this link:

    http://www.w3schools.com/css/default.asp
     

  2. The EOS flag is always cleared.

  3. The ZERO flag is always set to TRUE with a return value of zero.

  4. The OVER flag is always cleared.

  5. If the SetWebStyle method changes the physical characteristics of an HTML object, the GETPROP instruction {pwsobject} property values will not reflect the HTML object changes.

  6. Go to this W3School link for detailed CSS style information that can be used in the 'CssName' and 'StrValue' parameters for the SetWebStyle method.

    http://www.w3schools.com/css/default.asp
     

  7. The optional {flags} bit mask values changed the executions behavior of the SetWebStyle method as follows:

  8.  

    Value

    Meaning

    0x1

    This bit value causes the CSS style to be applied to the HTML <div> enclosing the {object} HTML object.

    0x2

    This bit mask value allows CSS styles to be set for the HTML label of the web objects CHECKBOX, GROUPBOX, and RADIO.

     

    Example PWS SetWebStyle:

     

    Panelx PANEL

     

             CREATE Panelx... //Generated as HTML <div>

             ...

    .

     Change PWS Panel HTML <div> CSS style.

    .

             Panelx.SetWebStyle USING *CSSNAME="background-color":

                                       *STRVALUE="Red"

     

     

    See Also: Objects

     



    PL/B Language Reference RemoveWebClass Method