Thursday, November 14, 2019
Tip of the Day: Dynamic Properties in Web Browser Controls
Product.......: R:BASE X.5 and R:BASE X.5 Enterprise (Version 10.5)
Build.........: 10.5.2.11111 or higher
Sections......: Forms
Keywords......: Web Browser, PROPERTY, GETPROPERTY, TAG, ID, NAME
Did you know the Web Browser controls have been enhanced to allow manipulation
of HTML controls in EEPs?
The Web Browser controls support dynamic properties to allow manipulation of
HTML controls in EEPs with the PROPERTY and GETPROPERTY commands. The dynamic
properties are useful in the following:
. Integrating local data with web sites that do not have an API
. Automating web page tasks within R:BASE
. Extracting data from web pages
Dynamic Properties
------------------
HTML elements can be referenced by TAG, ID, and NAME. For a well defined HTML
page, the ID alone is enough to locate the HTML element. In case of conflicts
combination of the three identifiers can be used depending on the document.
The property name is preceded with an underscore to distinguish
between dynamic
and non-dynamic properties. Dynamic property is composed of the property name
and the HTML element identifiers.
The full dynamic property name syntax is: "_PROP|TAG xxx|ID yyy|NAME zzz"
Parameters:
_CLICK - simulates a mouse click on a control on the page (e.g. button, link)
PROPERTY WebBrowser1 "_CLICK|ID btnSubmit" "AnyValue"
_VALUE - specifies the value of the HTML control
PROPERTY WebBrowser1 "_VALUE|ID txtName" ".vNameFromDatabase"
GETPROPERTY WebBrowser1 "_VALUE|ID txtName" "vNameFromDatabase"
_INNER_HTML - specifies the HTML between the start and end tags of the object
PROPERTY WebBrowser1 "_INNER_HTML|ID txtName" ".vNameFromDatabase"
GETPROPERTY WebBrowser1 "_INNER_HTML|ID txtName" "vNameFromDatabase"
_INNER_TEXT - specifies the text between the start and end tags of the object
stripping all the tags
PROPERTY WebBrowser1 "_INNER_TEXT|ID txtName" ".vNameFromDatabase"
GETPROPERTY WebBrowser1 "_INNER_TEXT|ID txtName" "vNameFromDatabase"
_OUTER_HTML - specifies the object and its content in HTML
PROPERTY WebBrowser1 "_OUTER_HTML|ID txtName" ".vNameFromDatabase"
GETPROPERTY WebBrowser1 "_OUTER_HTML|ID txtName" "vNameFromDatabase"
_OUTER_TEXT - specifies the text of the object
PROPERTY WebBrowser1 "_OUTER_TEXT|ID txtName" ".vNameFromDatabase"
GETPROPERTY WebBrowser1 "_OUTER_TEXT|ID txtName" "vNameFromDatabase"
_<TagAttribute> - gets the value of an attribute inside the tag
PROPERTY WebBrowser1 "_HREF|ID linkNewEmp" ".vNewLink"
GETPROPERTY WebBrowser1 "_HEIGHT|TAG IMG|ID imgEmpPhoto" "vPicHeight"
_ID_LIST - captures a CSV string of element IDs
Get all IDs:
GETPROPERTY WebBrowser1 "_ID_LIST" "vIDList"
Get IDs of all anchors:
GETPROPERTY WebBrowser1 "_ID_LIST|TAG A" "vIDList"
Get IDs of all dropdowns:
GETPROPERTY WebBrowser1 "_ID_LIST|TAG SELECT" "vIDList"
_NAME_LIST - captures a CSV string of element Names
Get all Names:
GETPROPERTY WebBrowser1 "_NAME_LIST" "vNameList"
Get Names of all anchors:
GETPROPERTY WebBrowser1 "_NAME_LIST|TAG A" "vNameList"
Get Names of all dropdowns:
GETPROPERTY WebBrowser1 "_NAME_LIST|TAG SELECT" "vNameList"
_CUSTOM_LIST - captures a CSV string of element details
GETPROPERTY WebBrowser1 "_CUSTOM_LIST|FIELDS ID,VALUE" "vIDValuePairs"
GETPROPERTY WebBrowser1 "_CUSTOM_LIST|FIELDS ID,SRC|TAG IMG" "vImageList"
Very Best R:egards,
Razzak.
https://www.rbase.com
http://www.facebook.com/rbase/
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/201911141049.xAEAnUiB151863%40atl4mhob21.registeredsite.com.