What is a Trigger?

We can perform any action on a specific events like On change of field value, On Focus of a field, On Blur of a field,Record Active, Data change etc using triggersWe can add N number of actions under trigger.

Trigger on Change:
This trigger can be used when we want to perform any action on change of field value.

How to configure Trigger on Change
?
Consider a scenario where you have two date fields (i) Due Date (ii) Original Date. When you change the Due date and if the Original Due date value is null then due date will be copied to Original due date. This can be acheived using Trigger on Change.

  
 
Under Trigger we can add any action can be used based on requirement.



TriggerOnUserChange: This trigger can be used when we want to perform any action on change of field value by user. This trigger will not fire if value is changed programatically whereas, TriggerOnChange will fire whenever field value changes irrespective of programatically change.

 



Under this Trigger action you can specify any number of button actions.


Trigger On Focus:This trigger can be used when we want to perform any action on focus of a field. Lets take an example of Text Area.Consider intially the height of Text Area is very small. Now as soon as user goes to that text area to enter text then we want to increase it's height. This can be achieved using TriggerOnFocus. Inside TriggerOnFocus we can use ActionSetHeight by specifying TextArea item id to increase height of TextArea.

          


Now Consider a scenario where you want to show the City and Zipcode fields when the State field is focused.



Here in the UI Item Id field, the item id's of City and Zipcode are to be specifiedTrigger On Blur: 
This trigger can be used when we want to perform action when field loose it's focus.Let's take previous TextArea example.On focus of a field we increased height of TextArea. Now we need to reset it's height.So on TriggerOnBlur we can reduce text area height by using ActionSetHeight.







Trigger On AccordionActive:This trigger can be used when we need to perform any action on Accordion Active.We need to specify layout as accordion layout, for layout container or content panel and then we can add this trigger as a child of that container.


Consider you have an Accordion Layout with two Content Panels(Documents,Tasks) and each panel has got specific implementation.
When the Document Content Panel is clicked, it should be directed to the document submission form.






Trigger On TabActive:
This trigger can be used when we need to perform any action on Tab Active. We can add this trigger as a child of Tab Item only. Lets consider a scenario,whenever user comes to any particular tab and you want the focus to be on particular field then you can use this trigger. Inside trigger on tab active, we can add GoToTarget and define where we want focus to go.
Note: If we uses GoToTarget inside TriggerOnTabActive to focus any field then platform will skip auto focus of first field to make sure that focus should go whereever developer want.

Consider you have two tabs(Shipments,Sales Orders). When the Sales Orders tab is clicked, the focus should be on the supplier name field.  
.



Here salesgrid is the grid itemid and item69 is the field item id. 

Trigger On Record Active:
This trigger can be used whenever we need to perform any action on record active of grid. Lets consider a scenario, whenever end user goes to each row in the grid and based on row data, we need to to show and hide some button or any other case then we can use TriggerOnRecordActive and then we can use respective actions under that.
Note: Generally we use this trigger as a child of a Grid.

How to configure Trigger On Record Active?
  • First  go to the widget and click on new. A new child item will be added.
  • Select the item type as TriggerRecordActive.
  • Specify the condition if any.
  • Below that add a button action according to your need.
  • Here ActionInvokeDatasource is added.
      
  • Below that add Set data properties.
      
  • Add Get data properties.
  • You can add as many button actions as needed according to your requirement.
Trigger On Before Commit:
This trigger can be used when we need to perform any valition before saving the data. We can add this trigger to any container data source child like Grid,Content Panel. So before saving that data source, it will execute this trigger and we can perform validations. If any validatiaon fails and we don't want to save the changes then we can use ActionAbort. ActionAbort will stop the further execution and return the control back.

Here  the employee name is validated in the Trigger On BeforeCommit.



Trigger On Before Popup Close:
This trigger will be executed before closing the popup.We can perform any validation before popup closes. Lets take an example. End user open the popup and inside that popup one field is mandatory. So we don't want user to close popup without filling that field. This can be achieved using TriggerOnBeforePoupClose.
Inside this trigger, we can perform validation and if any validation fails then we can stop popup from being close. We can use  ActionAbort inside TriggerOnBeforePoupClose to prevent popup from closing.

Example: To Create an order, the shipping date is mandatory, so untill and unless the shipping date is specified, the popup should not close.

 



Trigger On Before Search: To perform an action before the search is performed.
Here consider that you need to clear the filter before search.

The Trigger On Before Search will be visible in the property pallet if and only if the Simple Search Property of the grid if enabled.
Here item354 is the item id of the grid.

Trigger On Click: To perform an action when a click is performed either on field, button or link etc.
Consider you want to list all the shipment details when the image is clicked. First Upload the image using the Image Uploader.
Create a html field and specify the text as <img src="appimages/Shipping.png" height="30px" width="20px"></img>.


Shipments.
Click on Save.
Now specify the Trigger On Click event for the html component.
Create a button action goto target. This will take you to the Shipment Details page.


  .
Trigger On Commit: To perform an action on data commit.
Consider a confirmation message has to be returned when data is committed successfully.
 


Trigger on Mouse Over: To perform an action when you mouse over on a field,button,panel etc..
Consider you want to display Contact info when you mouse over on the supplier name.



Trigger On Mouse Out:  To perform an action when you mouse out of a field,button,panel etc..
Consider the above example where on mouse over, the supplier contact info is being displayed and now on mouse out the supplier contact info has to be hidden.



Trigger On Page Init: This is the event where you should be performing any initialization steps that you need to setup or create instances of server controls.
This event fires only when the first time page is loaded and from the next time on a postback Page_init is not fired.

Consider two tabs(Dashboard Tab,Sales Activities Tab).
Now when the Manager log's in he should be able to see both the tabs.
When the user log's in, he should be able to see only the Sales Activities tab.
For this first add the Trigger On Page Init event to the layout container next to the page item.
Then add the Action Show button action with visibility condition.(Has Role('User')).



Trigger On Record Create: To trigger the event before inserting the record.
Consider you want to validate the record before you insert.
To do that, you need to invoke data source and inturn call a procedure by specifying the package name in the API field.
Do the validations in the package and then insert the data into the tables.



Trigger On Check / Uncheck: These triggers are applicable only to Checkbox Menu Item.
Consider you have the menu item 1) Applicant History 2) Applicant Info.
When checkbox of  Applicant History is checked, it should show a popup with all the Applicant History records grid.
When checkbox of  Applicant History is unchecked, it should close the Applicant History Popup.



Trigger On Data Change: 






Location

101 California Street, Suite 2710
San Francisco, CA 94111


440 N. Wolfe Rd.
Sunnyvale, CA 94085


Office 11, 5th Floor, Building 9,
Mindspace IT Park
Hyderabad 500081

p: +1 (844) AT CloudIO (844-282-5683)
f: +1 (650) 300-5247 | e: sales@cloudio.io
© 2009, 2017 CloudIO Inc. | Terms of Use | Privacy Policy