Token: Action / Actions

By Kevin M Schreiner

November 02, 2015

Setting session variable values to specific column values and immediately transporting to the Tab/Page associated with consuming those values is made simple with out Action syntax. All runtime actions like Sorting, Interactive Lists and Actions utilize the similar formatting structures contained within curly braces {...}. Actions require four parameters. The first is simply the type of interaction performed, in this case ACTION. The second parameters, the name of the column (inside or out of square brackets) passed to the session variable. Third, the name of the Session Variable where the Column Value will be stored. And finally, the link or TabId which the Action will be directed towards. The block for action will render a formulated HREF tag which is required for Anchor tag elements. The action tag will execute a javascript function built in to ListX, so the ACTION element should always occur within an ANCHOR tag. Follow the syntax definitions provided to assist in building the appropriate output block.
Tip: Actions do not always need to leave the current page when clicked. Sometimes you will simply be drilling deeper into a query, or changing the information provided on other modules in the same page. Leaving the Link blank or setting it to the current tab will easily provide this behavior.
Action Syntax:
{ACTION,ColumnValue,SessionVariableName,Link,Optional Variable Type,Option render HREF }
You may also use the ACTIONS syntax to execute multiple variable assignments at once.
{ACTIONS,ColumnValue1,SessionVariableName1,Variable Type1,ColumnValue2,SessionVariableName2,Variable Type2...,Optional Link}
Example
<a {ACTION,[EventLogId],CurrentEventLogId,62}/>...<a/> 
Additionally, you could send Module Communication Messages through the same Action tags - the following sample broadcasts a Message with a Type of "DeleteItem" and a value appearing in the EventLogId column:
<a {ACTION,[EventLogId],DeleteItem,,Message}/>...<a/> 
Suppose you had a listing with a column that was an edit button. You need the button to assign the primary key value from the row to a session variable. What if your primary key were a composite key, as is the case with ModuleSettings? Use the ACTIONS tag:
<a {ACTIONS,[ModuleID],SettingModuleID,Session,[SettingName],SettingSettingName,Session,85}/>...<a/> 
Interaction Type
All interaction elements for ListX utilize similar formatting to keep things uniform. Action Items are always contained within curly braces {...} with the first parameter identifying the type of interaction. In the case of this element, ACTION will be the first parameter. Other types of actions include SORT,SORTHEADER, and other types including CHECKLIST.
Column Name
The value from the column column which will be placed in the Session Variable assigned as the next parameter. The variable may be a single column name, or could utilize the Column Value syntax to build combined - or formatted values. (See Column Values)
Variable Name
The core of interactive elements on the web is provided by utilizing some type of shared variable which can be assigned or read from different modules within your overall system. ListX is capable of reading and writing to variable located in the Session, QueryString, Cookie and ViewState. Place the name of the variable which will store the value of the column chosen in this interactive element.
Link
Finally, once you have specified which variable you will utilize in your action, and where that variable should be stored, you must provide a link which will be followed upon completion of the variable assignment. This value is normally the Id of a Tab, or could be the tab name, URL, or value from a module setting. In the case of the ACTIONS tag, the Link is optional, but you MUST have the , in place anyway.
Optional Variable Type
ListX is capable of reading and writing to variable located in the Session, QueryString, Cookie and ViewState. The default value to which ListX binds is Session, but it is simple to bind to any of the other types, just provide the name of the type in this position.
Optional Render HREF
ListX generates the standard href=”javascript:__doPostBack” logic, so, if you want to use an action tag within an onclick, or a physical javascript tag – set the last parameter to False, as True is the default.  When false, just the __doPostBack section will be generated.

The ACTION token allows you to assign a value to a session (or other) system variable and immediately render a specified page (tab), passing the assigned variables to the newly rendered page.


All runtime actions like Sorting, Interactive Lists and Actions use a similar formatting structure contained within curly braces {...}. Actions require four parameters. The first is simply the type of interaction performed, in this case ACTION. The second, the name of the column (inside or out of square brackets) or value to be assigned as to a session variable. Third, the name of the Session Variable where the Value will be stored. And fourth, the link or TabId to be rendered.
Two additonal optional parameters may be added.  The first, the variable type. The default, unless otherwise specified, is Session but another variable type ("Q" for Query, for example) may be specified.  The action block will render an HREF tag as required for Anchor tag elements. The action tag will execute an OWS javascript function, so the ACTION element should always occur within an ANCHOR tag.  Consult the examples and syntax below as references.
 
 
Action Syntax:

{ACTION,ColumnValue,VariableName,Link,(Optional) Variable Type,(Option) render HREF }


<a (ACTION,[RecordID],EditPage,151) >Edit</a>
Will assign the value of the column named RecordID to a Session variable named Edit Page, then render TabID 151.

<a {ACTION,36,Age,407,Q}/>
Will create a query variable named "Age" and pass it to tab 407


You may also use the ACTIONS syntax to execute multiple variable assignments at once.

{ACTIONS,ColumnValue1,VariableName1,Variable Type1,ColumnValue2,VariableName2,Variable Type2...,Optional Link}

Example

<a {ACTION,[EventLogId],CurrentEventLogId,62}/>...<a/> 

 

You can also send Module Communication Messages through the same Action tags - the following example broadcasts a Message with a Type of "DeleteItem" and a value appearing in the EventLogId column:

 

<a {ACTION,[EventLogId],DeleteItem,,Message}/>...<a/> 

 

Suppose you had a listing with a column that was an edit button. You need the button to assign the primary key value from the row to a session variable. What if your primary key were a composite key, as is the case with ModuleSettings? Use the ACTIONS tag:

 

<a {ACTIONS,[ModuleID],SettingModuleID,Session,[SettingName],SettingSettingName,Session,85}/>...<a/> 

 

 

Interaction Type

All interaction elements for ListX use similar formatting to keep things uniform. Action Items are always contained within curly braces {...} with the first parameter specifying the type of interaction. In the case of this element, ACTION will be the first parameter. Other types of actions include SORT,SORTHEADER, and other types including CHECKLIST.

 

Column Name

The value from the column column that will be assigned to the Session Variable specified in the next parameter. The variable may be a single column name, or could use the Column Value syntax to build combined - or formatted values. (See Column Values)

 

Variable Name

The core of interactive elements on the web is provided by using some type of shared variable which can be assigned or read from different modules within your overall system. OWS is capable of reading and writing  Session, QueryString, Cookie and ViewState variables. Place the name of the variable that will store the value of the column chosen in this interactive element.

 

Link

Finally, once you have specified which variable you will use in your action, and the variable name, you must provide a link to will be rendered upon completion of the variable assignment. This value is normally the Id of a Tab, but it could be the tab name, URL, or value from a module setting. In the case of the ACTIONS tag, the Link is optional, but you MUST have the , in place anyway.

 

Optional Variable Type

OWS is capable of reading and writing to variable located in the Session, QueryString, Cookie and ViewState. The default value to which OWS binds is Session, but it is simple to bind to any of the other types, just provide the name of the type in this position.

 

Optional Render HREF

OWS generates the standard href=”javascript:__doPostBack” logic, so, if you want to use an action tag within an onclick, or a javascript tag – set the last parameter to False, as True is the default.  When false, just the __doPostBack section will be generated.

 

 

 

Average ( Ratings):
 
Want to help out?
 
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seattle, WA • info@openwebstudio.com

Bookmark & Share Bookmark and Share