This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



May 2, 2011, 6:45 PM
4 Posts
topic has been resolvedResolved

FYI : buttons and onClick event

  • Category: Other
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: button,events,onClick,All properties
  • Replies: 3
Hi All,
 
I needed to post this.... to frustrating to do not so :-)
I was looking all day for a problem with a button that worked previously. 
 
On a xPage there is a simple button. In the events tab at the bottom I added the server javascript code 'applicationScope.Language ="EN"'
After a few days I decided to change this to "sessioScope..." So I opened the page, selected the button and clicked on "all properties" 
In the events part there is my code at the "onClick" event.. changed that to "sessioScope.." 
Tried the page in a browser IE 9 and .... i receive some IE error that "EN" is not defined...
Looking for hours to solve this.. (it worked in Firefox !)
Now I noticed.. In the events tab there is still the old code.. "applicationScope..."  In the all properties - events - onClick there is the new code "sessionScope.." 
Removed the code in the "all properties" section, saved & closed the page. Refreshed the browser and it works...
Opening the page and clicking on the "all properties section"   shows the correct code..
 
So for some reason the all properties is not updated or synchronised with the "events tab "of a button. 
 
Just for your information... 
 
regards, 
 
Peter 
 
May 3, 2011, 2:24 AM
25 Posts
Re: FYI : buttons and onClick event
 Peter,
 
I experienced this also a while back while working on the XPages Calendar (now defunct). I even posted about it but I can't find the post now, weird. But yes, you need to only edit your event code within the event tab of DDE, otherwise you may encounter some weirdness to say the least. 
 
Keith 
May 3, 2011, 2:57 PM
7 Posts
Re: FYI : buttons and onClick event: two different things
The reason why the update is not made via "all properties", is because this is not the same thing:
- when add an onclick event via the Events tab, you actually create an <xp:eventHandler> child property for the button, which has an <xp:this.action> tag that contains your code.
- when you edit the onClick event of the button in All Properties, you add an <xp:this.onlick> property to the button
 
have a look at the source code of the XPage to see what I mean. 
 
You can edit the code of the event handler via All Properties, but you need to navigate to the "Event Handler" under the button in the Outline view, and NOT to the button itself. Then, you will see that the "action" property has the right, up-to-date value. 
 
May 4, 2011, 1:17 PM
25 Posts
Re: FYI : buttons and onClick event: two different things
 Agreed... because of this I've started working more in the source rather than the UI. However I think this needs to be more obvious in the UI. There are so many people that have encountered this and had trouble with it, especially those just starting to learn XPages.
 
Keith 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal