Skip to main content link. Accesskey S
  • Anonymous
  • Log on
  • Help
  • IBM logo
  • IBM Composite Applications wiki
  • All Wikis
  • Home
  • Community Articles
  • Product Documentation
  • Learning Center


Search

Advanced Search

Categories

Tag Cloud

  • 6.2
  • 6.2.1
  • 8.0.1
  • 8.5
  • 8.5+
  • 8.5.1
  • advanced features
  • advantages
  • API
  • app dev
  • assembling
  • basics
  • benefits
  • Browser
  • CAE
  • catalog
  • changing page properties
  • changing value to another type of value
  • code snippet
  • component library
  • component properties
  • components
  • Composite Application Editor
  • Composite Applications
  • container components
  • containers
  • custom actions
  • debugging
  • demos
  • deploying
  • designing
  • developing
  • Eclipse
  • Eclipse components
  • editing properties
  • Editor
  • education
  • enablement
  • Expeditor
  • extending
  • extensions
  • FAQ
  • feature rules
  • framework
  • getting started
  • Help
  • HOD
  • host on demand
  • how to
  • Java
  • lead manager
  • linking
  • live text
  • match rules
  • new users
  • Notes
  • Notes components
  • nsf
  • NSF components
  • overview
  • page navigation
  • page properties
  • Palette
  • PBE
  • PIM
  • plugins
  • Portal
  • preference
  • product documentation
  • programming
  • properties
  • property broker
  • property broker editor
  • Property Broker Monitor tool
  • provisioning
  • resources
  • roadmap
  • samples
  • setting component properties
  • Sidebar
  • sideshelf
  • Symphony
  • Symphony view component
  • technote
  • testing
  • toolkit
  • TopologyHandler
  • troubleshooting
  • tutorial
  • update site
  • updating
  • upgrading
  • video
  • view
  • Web
  • web services
  • white lists
  • widgets
  • Wiring
  • WSDL
InformationInformation
You are currently viewing machine translated content. IBM translation might be available. Click IBM Translated Product Documentation to see what is available.X


Home > Java Components > Understanding the DataChange event in Container Components
Rate this article 1 starRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Understanding the DataChange event in Container Components 

expanded Abstract
collapsed Abstract
No abstract provided.
ShowTable of Contents
HideTable of Contents
  • 1 Introduction
    • 1.1 Behavior for publish action within data change
    • 1.2 Behavior for receive action within data change
    • 1.3 Sample custom action showing getParameterValue method on the event class

Introduction



In this article, we will discuss what the DataChange event is and how to leverage it in your container components. The DataChange event is one of several events that can be leveraged to execute actions for a given landmark within your component. The DataChange event is used to react to property changes and to field changes within the context of the container.

There are some constraints that should be pointed out when utilizing the DataChange event type. The behavior for publishand receiveactions is a little bit different than it is for custom actions. Since the DataChange event is invoked via a property change OR a field change, any publish actions which are listed under the event will only be executed if the event was invoked via a field change. For property changes, it does not make sense to invoke the publish action since the component will simply be re-publishing the same property but replacing the value with the contents of the fieldassociated with the action. This behavior would create some ambiguity with regards to how the DataChange event should behave when a publish action is used. If you wish to publish a property when a DataChange event occurs, the publish will only be executed if the field that is associated with the publish action changes. The property will then be published with the value of that field. The figure below shows a data change event created for a browser component. There is a single property named searchProperty along with a field, name:q (the search input field for Google.com) associated with the action. This publish action will only be executed if the data change is a field change event. If the searchProperty property were changed by some other component and the data change event was triggered via this property change from the property broker, the publish action would NOT execute.

    Behavior for publish action within data change


        Figure 1
    If you wish to receive a property value when a DataChange event occurs, the receive will only be executed if the property that is associated with the receive action changes. It does not make sense to execute the receive action when the field changes because it will simply overwrite the field with the value of the property.

    Behavior for receive action within data change


        Figure 2

    Any custom actions that are implemented will always execute when associated with data change events. It depends on the implementation of the action on whether or not it will work with field change events, property change events or both. Starting with Expeditor 6.2.2 and Lotus Notes 8.5.2, custom action code can call a method to get the value for the event that the action needs in order to execute (if it requires a property or field value). This method allows for the action to not have to know anything about whether or not the event was a field change or property change DataChange event type. The value returned will be the field value if it was a field change event or a property value if it was a property change event.

    Sample custom action showing getParameterValue method on the event class



    This action calls the new getParameterValue() method on the LandmarkEvent object in order to get the proper input value. This is used if your action supports both field change AND property change dataChange event types. There is also a method on the LandmarkEvent object called isFieldChange() which can be used to determine if the event is a field change data change event type.

       1:  
       2:  
       3:  	public void execute(AppContainer container, LandmarkEvent event, Object context) {
       4:  		BrowserAppContainer c = (BrowserAppContainer)container;
       5:  
       6:  		//
       7:  		// Attempt to get the parameter value from the event object
       8:  		// If this value is null then check to see if we have a property value
       9:  		// cached in the broker for the property associated with this action
       10:  		//
       11:  		String value = event.getParameterValue();
       12:  		if (value == null)
       13:  			c.getPropertyValue(property);
       14:  				
       15:  		if (value != null && value.length() > 0) {
       16:  			// Set the URL
       17:  			final WebBrowser browser = c.getWebBrowser(context);
       18:  			final String url = value;
       19:  			browser.getDisplay().asyncExec(new Runnable(){
       20:  
       21:  				public void run() {
       22:  					browser.setUrl(url);					
       23:  				}
       24:  				
       25:  			});
       26:  		}
       27:  	}
       28:  




    expanded Article information
    collapsed Article information
    Category:
    Java Components
    Tags:
    container components, containers, custom actions, Composite Applications, developing

    This Version: Version 8 June 4, 2010 2:42:12 PM by Bob Balfe  IBMer

    expanded Attachments (0)
    collapsed Attachments (0)

     


    expanded Versions (8)
    collapsed Versions (8)
    Version Comparison     
    Version Date Changed by               Summary of changes
    This version (8) Jun 4, 2010 2:42:12 PM Bob Balfe  
    7 Jun 4, 2010 10:15:58 AM Bob Balfe  
    6 Jun 4, 2010 9:56:59 AM Bob Balfe  
    5 Dec 11, 2009 3:17:29 PM Chuck Imperato  
    4 Dec 10, 2009 5:49:20 PM Chuck Imperato  
    3 Dec 10, 2009 5:40:01 PM Chuck Imperato  
    2 Dec 10, 2009 4:24:47 PM Chuck Imperato  
    1 Dec 10, 2009 3:55:47 PM Chuck Imperato  
    expanded Comments (0)
    collapsed Comments (0)
    Copy and paste this wiki markup to link to this article from another article in this wiki.
    Go ElsewhereStay ConnectedSubscribe to RSSHelpAbout
    • All Lotus and WebSphere Portal wikis
    • IBM developerWorks
    • IBM Software support
    • IBM Social Business User Experience Blog
    • IBMSocialBizUX on Twitter
    • IBMSocialBizUX on Facebook
    • Lotus product forums
    • IBM Social Business UX blog
    • IBM Collaboration Solutions
    • Recently added feedRecently added
    • Recently edited feedRecently edited
    • Recently added comments feedRecently Added Comments
    • Wiki Help
    • Forgot user name/password
    • Wiki design feedback
    • Content feedback
    • About the wiki
    • About IBM
    • Privacy
    • Contact IBM
    • IBM Terms of use
    • Wiki terms of use