Difference between revisions of "Webview Gadget Attributes"
Yvonne.milne (Talk | contribs) (→Details) |
Yvonne.milne (Talk | contribs) (→Details) |
||
(17 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | = | + | {{DISPLAYTITLE:WebView Gadget}} |
− | [[: | + | =Overview= |
+ | Webview Gadgets can be loaded into a [[Form Section Attributes|Form Section]]. They are embedded browser panels that render HTML generated by [[Visual FoxPro Server Pages|Lianja/VFP Server Pages (.rsp)]], [[JavaScript Server Pages|JavaScript Server Pages (.jssp)]] or any other http request that returns HTML. | ||
+ | |||
+ | [[File:webview_gadget.png|middle|link=]] | ||
You build Apps in Lianja App Builder visually using the [[:Category:Page_Builder|Page Builder]]. | You build Apps in Lianja App Builder visually using the [[:Category:Page_Builder|Page Builder]]. | ||
− | If you have not yet | + | If you have not yet done so please read [[Understanding_the_Lianja_App_Architecture|Understanding the Lianja Architecture]] and also [[Lianja_is_all_about_ART|Understanding ART]] to better understand this article. |
An App consists of pages. Pages are made up of Sections. Form sections are made up of FormItems. We call these collectively "UI Elements" or "Visual Elements". | An App consists of pages. Pages are made up of Sections. Form sections are made up of FormItems. We call these collectively "UI Elements" or "Visual Elements". | ||
Line 12: | Line 15: | ||
You adjust the appearance and behavior of each UI Element in the '''Attributes''' Tab of the [[:Category:App_Inspector|App Inspector]]. | You adjust the appearance and behavior of each UI Element in the '''Attributes''' Tab of the [[:Category:App_Inspector|App Inspector]]. | ||
− | [[ | + | [[{{ns:file}}:bm-attributes.png|800px|left|border|link={{filepath:bm-attributes.png}}|Attributes]] |
+ | <br clear=all> | ||
The attributes available consist of some common ones as well as some specific to the UI Element being inspected. | The attributes available consist of some common ones as well as some specific to the UI Element being inspected. | ||
Line 21: | Line 25: | ||
<pre>Lianja.get("pageid.sectionid.fieldid").setAttribute("caption","Formitem1")</pre> | <pre>Lianja.get("pageid.sectionid.fieldid").setAttribute("caption","Formitem1")</pre> | ||
− | Note: the shortened form '''setAttr(name,value)''' is also available. | + | Note: on the desktop, the shortened form '''setAttr(name,value)''' is also available. |
The '''getAttribute(name)''' method can be used to get the value of an Attribute: | The '''getAttribute(name)''' method can be used to get the value of an Attribute: | ||
Line 27: | Line 31: | ||
<pre>cTitle = Lianja.get("pageid.sectionid.fieldid").getAttribute("caption")</pre> | <pre>cTitle = Lianja.get("pageid.sectionid.fieldid").getAttribute("caption")</pre> | ||
− | Note: the shortened form '''getAttr(name)''' is also available. | + | Note: on the desktop, the shortened form '''getAttr(name)''' is also available. |
+ | |||
+ | =See Also= | ||
+ | [[:Category:Developing Custom WebViews|Developing Custom WebViews]], [[Webview Section Attributes]] | ||
+ | |||
+ | Demo Apps (included in the Lianja App Builder distribution): | ||
+ | * Lianja Demo (lianjademo) | ||
+ | =Attributes= | ||
==Details== | ==Details== | ||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
Line 38: | Line 49: | ||
|valign="top"|[[Details Attributes#Name|Name]]||The name for this gadget (unique to the section) | |valign="top"|[[Details Attributes#Name|Name]]||The name for this gadget (unique to the section) | ||
|valign="top"|id||valign="top"|Character | |valign="top"|id||valign="top"|Character | ||
+ | |- | ||
+ | |valign="top"|[[Details Attributes#Full name|Full name]]||The full name for this gadget including its parent page and section, e.g. page1.section1.field1 | ||
+ | |valign="top"|fullid||valign="top"|Character | ||
|- | |- | ||
|valign="top"|[[Details Attributes#Alias name|Alias name]]||The alias name for this gadget | |valign="top"|[[Details Attributes#Alias name|Alias name]]||The alias name for this gadget | ||
|valign="top"|aliasid||Character | |valign="top"|aliasid||Character | ||
+ | |- | ||
+ | |valign="top"|[[Details Attributes#App Doc|App Doc]]||The App Doc file for this gadget. This will be included in the [[App Doc]] when it is generated. | ||
+ | |valign="top"|appdoc||valign="top"|Character | ||
+ | |- | ||
+ | |valign="top"|[[Details Attributes#Tag|Tag]]||The tag for this gadget | ||
+ | |valign="top"|tag||Character | ||
|- | |- | ||
|valign="top"|[[MetaTypes|Meta types]]||A comma separated list of metatype names | |valign="top"|[[MetaTypes|Meta types]]||A comma separated list of metatype names | ||
|valign="top"|metatypes||valign="top"|Character | |valign="top"|metatypes||valign="top"|Character | ||
+ | |- | ||
+ | |valign="top"|[[Details Attributes#Custom Props|Custom Props]]||A ';' separated list of custom prop key pairs, e.g. name=barry;company=lianja | ||
+ | |valign="top"|customprops||valign="top"|Character | ||
|- | |- | ||
|valign="top"|[[Details Attributes#Type|Type]]||The type of control: Gadget (readonly) | |valign="top"|[[Details Attributes#Type|Type]]||The type of control: Gadget (readonly) | ||
Line 65: | Line 88: | ||
|valign="top"|[[Details Attributes#Stretch width|Stretch width]]||Auto stretch the width of the gadget into the width of the section (True | False) | |valign="top"|[[Details Attributes#Stretch width|Stretch width]]||Auto stretch the width of the gadget into the width of the section (True | False) | ||
|valign="top"|gadgetStretchWidth||valign="top"|Boolean | |valign="top"|gadgetStretchWidth||valign="top"|Boolean | ||
+ | |- | ||
+ | |valign="top"|[[Details Attributes#Desktop Margin Top|Desktop Margin Top]]||Adjust the top margin when laying out an inline gadget to line it up with others horizontally in desktop Apps. | ||
+ | |valign="top"|gadgetpaddingtop||valign="top"|Int | ||
+ | |- | ||
+ | |valign="top"|[[Details Attributes#Web Margin Top|Web Margin Top]]||Adjust the top margin when laying out an inline gadget to line it up with others horizontally in Web/Mobile Apps. | ||
+ | |valign="top"|gadgetpaddingtopweb||valign="top"|Int | ||
|- | |- | ||
|} | |} | ||
Line 104: | Line 133: | ||
|valign="top"|[[Formitem Appearance#Caption|Caption]]||The caption for the gadget | |valign="top"|[[Formitem Appearance#Caption|Caption]]||The caption for the gadget | ||
|valign="top"|caption||valign="top"|Character | |valign="top"|caption||valign="top"|Character | ||
+ | |- | ||
+ | |valign="top"|[[Formitem Appearance#Caption CSS style|Caption CSS style]]||The gadget caption CSS style (separate attributes with ';' or use ''app:/''filename.css or specify CSS classes separated by spaces). | ||
+ | |valign="top"|captionCSSstyle||valign="top"|Character | ||
|- | |- | ||
|valign="top"|[[Colors|Background color]]||The background color for the caption | |valign="top"|[[Colors|Background color]]||The background color for the caption | ||
Line 152: | Line 184: | ||
|valign="top"|[[Data Attributes#URL|URL]]||The URL for this gadget (template included) | |valign="top"|[[Data Attributes#URL|URL]]||The URL for this gadget (template included) | ||
|valign="top"|gadgetArg||valign="top"|Character | |valign="top"|gadgetArg||valign="top"|Character | ||
+ | |- | ||
+ | |valign="top"|[[Data Attributes#HTML editor|HTML editor]]||Choose the HTML editor to use for this gadget (Desktop | Web | Mobile). | ||
+ | |valign="top"|htmleditor||valign="top"|Character | ||
|- | |- | ||
|valign="top"|[[Data Attributes#Editable|Editable]]||Data is editable (True | False) | |valign="top"|[[Data Attributes#Editable|Editable]]||Data is editable (True | False) | ||
Line 221: | Line 256: | ||
|valign="top"|[[UI Presentation Rules#Visible when|Visible when]]||Gadget is visible at runtime if specified expression evaluates to true. | |valign="top"|[[UI Presentation Rules#Visible when|Visible when]]||Gadget is visible at runtime if specified expression evaluates to true. | ||
|valign="top"|visibleWhen||valign="top"|Character | |valign="top"|visibleWhen||valign="top"|Character | ||
+ | |- | ||
+ | |valign="top"|[[UI Presentation Rules#Hidden at runtime|Hidden at runtime]]||Hide this formitem at runtime (True | False). | ||
+ | |valign="top"|hiddenAtRuntime||valign="top"|Boolean | ||
|- | |- | ||
|valign="top"|[[UI Presentation Rules#Display orientation|Display orientation]]||Display depending on mobile device orientation for Tablets and Phones. (Always | Portrait | Landscape) | |valign="top"|[[UI Presentation Rules#Display orientation|Display orientation]]||Display depending on mobile device orientation for Tablets and Phones. (Always | Portrait | Landscape) | ||
Line 227: | Line 265: | ||
|valign="top"|[[UI Presentation Rules#Apply rules on change|Apply rules on change]]||Apply UI presentation rules (Visible when and Readonly when) when data is changed interactively or when navigating records (True | False). | |valign="top"|[[UI Presentation Rules#Apply rules on change|Apply rules on change]]||Apply UI presentation rules (Visible when and Readonly when) when data is changed interactively or when navigating records (True | False). | ||
|valign="top"|applyRulesOnChange||valign="top"|Boolean | |valign="top"|applyRulesOnChange||valign="top"|Boolean | ||
+ | |- | ||
+ | |valign="top"|[[UI Presentation Rules#Responsive UI width breakpoint|Responsive UI width breakpoint]]||The responsive UI visibility width breakpoint in Web/Mobile Apps. | ||
+ | |valign="top"|responsivewidthvisibility||valign="top"|Int | ||
+ | |- | ||
+ | |valign="top"|[[UI Presentation Rules#Responsive UI height breakpoint|Responsive UI height breakpoint]]||The responsive UI visibility height breakpoint in Web/Mobile Apps. | ||
+ | |valign="top"|responsiveheightvisibility||valign="top"|Int | ||
+ | |- | ||
+ | |valign="top"|[[UI Presentation Rules#Responsive UI minimum width|Responsive UI minimum width]]||The responsive UI minimum width in Web/Mobile Apps. | ||
+ | |valign="top"|responsiveminwidth||valign="top"|Int | ||
|- | |- | ||
|} | |} |
Latest revision as of 10:56, 27 April 2023
Contents
Overview
Webview Gadgets can be loaded into a Form Section. They are embedded browser panels that render HTML generated by Lianja/VFP Server Pages (.rsp), JavaScript Server Pages (.jssp) or any other http request that returns HTML.
You build Apps in Lianja App Builder visually using the Page Builder.
If you have not yet done so please read Understanding the Lianja Architecture and also Understanding ART to better understand this article.
An App consists of pages. Pages are made up of Sections. Form sections are made up of FormItems. We call these collectively "UI Elements" or "Visual Elements".
Setting Attributes Declaratively
You adjust the appearance and behavior of each UI Element in the Attributes Tab of the App Inspector.
The attributes available consist of some common ones as well as some specific to the UI Element being inspected.
Getting and Setting Attributes Programmatically
The setAttribute(name, value) method can be used to set the value of an Attribute:
Lianja.get("pageid.sectionid.fieldid").setAttribute("caption","Formitem1")
Note: on the desktop, the shortened form setAttr(name,value) is also available.
The getAttribute(name) method can be used to get the value of an Attribute:
cTitle = Lianja.get("pageid.sectionid.fieldid").getAttribute("caption")
Note: on the desktop, the shortened form getAttr(name) is also available.
See Also
Developing Custom WebViews, Webview Section Attributes
Demo Apps (included in the Lianja App Builder distribution):
- Lianja Demo (lianjademo)
Attributes
Details
Attribute | Description | Name | Type |
---|---|---|---|
Name | The name for this gadget (unique to the section) | id | Character |
Full name | The full name for this gadget including its parent page and section, e.g. page1.section1.field1 | fullid | Character |
Alias name | The alias name for this gadget | aliasid | Character |
App Doc | The App Doc file for this gadget. This will be included in the App Doc when it is generated. | appdoc | Character |
Tag | The tag for this gadget | tag | Character |
Meta types | A comma separated list of metatype names | metatypes | Character |
Custom Props | A ';' separated list of custom prop key pairs, e.g. name=barry;company=lianja | customprops | Character |
Type | The type of control: Gadget (readonly) | type | Character |
Gadget type | The type of gadget: webview (readonly) | gadgetType | Character |
Margin | Margin size around the gadget | gadgetMargin | Int |
Fixed width | Fixed gadget width in pixels | gadgetFixedWidth | Int |
Fixed height | Fixed gadget height in pixels | gadgetFixedHeight | Int |
Inline | Render the gadget inline rather than it its own column (True | False) | gadgetInline | Boolean |
Stretch width | Auto stretch the width of the gadget into the width of the section (True | False) | gadgetStretchWidth | Boolean |
Desktop Margin Top | Adjust the top margin when laying out an inline gadget to line it up with others horizontally in desktop Apps. | gadgetpaddingtop | Int |
Web Margin Top | Adjust the top margin when laying out an inline gadget to line it up with others horizontally in Web/Mobile Apps. | gadgetpaddingtopweb | Int |
Geometry
Attribute | Description | Name | Type |
---|---|---|---|
Absolute | Enable or disable absolute positioning (True | False) | absolutePosition | Boolean |
Top | Top position in pixels | absolutePositionY | Int |
Left | Left position in pixels | absolutePositionX | Int |
Width | Width in pixels | absolutePositionWidth | Int |
Height | Height in pixels | absolutePositionHeight | Int |
CSS style | CSS style (separate attributes with ; or use app:/filename.css) | cssStyle | Character |
Caption
Attribute | Description | Name | Type |
---|---|---|---|
Caption | The caption for the gadget | caption | Character |
Caption CSS style | The gadget caption CSS style (separate attributes with ';' or use app:/filename.css or specify CSS classes separated by spaces). | captionCSSstyle | Character |
Background color | The background color for the caption | backColor | Character |
Foreground color | The foreground color for the caption | foreColor | Character |
Font | The font for the caption | captionFont | Character |
Icon | The image for the caption (png | jpg | gif). Use app:/imagename.ext for app specific images. |
captionIcon | Character |
Border width | The caption border width | captionBorderWidth | Int |
Border color | The caption border color | captionBorderColor | Character |
Transparency | Specify a transparency percentage from 0 to 100 | transparency | Int |
Gradient colors | Render the caption color as a gradient (True | False) | captionGradient | Boolean |
Gradient type | Specify the gradient type | captionGradientType | Int |
Gradient start color | Gradient start color | captionFromColor | Character |
Gradient end color | Gradient end color | captionToColor | Character |
Data
Attribute | Description | Name | Type |
---|---|---|---|
Data source | The table and column that this gadget is bound to. | gadgetControlSource | Character |
URL | The URL for this gadget (template included) | gadgetArg | Character |
HTML editor | Choose the HTML editor to use for this gadget (Desktop | Web | Mobile). | htmleditor | Character |
Editable | Data is editable (True | False) | editable | Boolean |
Background color | The background color for the gadget | gadgetBackColor | Character |
Foreground color | The foreground color for the gadget | gadgetForeColor | Character |
Other Options
Attribute | Description | Name | Type |
---|---|---|---|
Hide header | Hide gadget header at runtime (True | False) | gadgetHideHeader | Boolean |
Permissions and Roles
Attribute | Description | Name | Type |
---|---|---|---|
Read roles | A comma separated list of roles that can read (and view) the data. | permRead | Character |
Update roles | A comma separated list of roles that can perform update operations on the data. | permUpdate | Character |
UI Presentation Rules
Attribute | Description | Name | Type |
---|---|---|---|
Desktop | Include this gadget in a Desktop client (True | False). | desktopUI | Boolean |
Web | Include this gadget in a Web client (True | False). | webUI | Boolean |
Tablet | Include this gadget in a Tablet client (True | False). | tabletUI | Boolean |
Phone | Include this gadget in a Phone client (True | False). | mobileUI | Boolean |
UI States | UI states that affect this gadget. Specify multiple states as a comma separated list. | state | Character |
Initial UI state | The initial UI state for this gadget. | uiStateInit | Character |
Readonly when | Gadget is readonly at runtime if specified expression evaluates to true. | readonlyWhen | Character |
Visible when | Gadget is visible at runtime if specified expression evaluates to true. | visibleWhen | Character |
Hidden at runtime | Hide this formitem at runtime (True | False). | hiddenAtRuntime | Boolean |
Display orientation | Display depending on mobile device orientation for Tablets and Phones. (Always | Portrait | Landscape) | displayOrientation | Character |
Apply rules on change | Apply UI presentation rules (Visible when and Readonly when) when data is changed interactively or when navigating records (True | False). | applyRulesOnChange | Boolean |
Responsive UI width breakpoint | The responsive UI visibility width breakpoint in Web/Mobile Apps. | responsivewidthvisibility | Int |
Responsive UI height breakpoint | The responsive UI visibility height breakpoint in Web/Mobile Apps. | responsiveheightvisibility | Int |
Responsive UI minimum width | The responsive UI minimum width in Web/Mobile Apps. | responsiveminwidth | Int |