Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, June 19, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: OnClick event fires for every checkbox on the form on open
Adam Conde
Posts: 14
 
OnClick event fires for every checkbox on the form on openYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Jul 07 2:16 PM
I have a form that OnOpen loops through all the controls on the form and performs various actions depending on the type of control (checkbox vs. button).
For each checkbox i have a sub that fires with the OnClick event.

The problem is that during the initial loop through all controls, it appears that the OnClick event fires everytime the loop encounters a checkbox. Is there a way to avoid this, so that the OnClick event fires only when a user clicks on the checkbox and not when looping through the controls? I considered using the OnMouseDown event, but I'm not sure what parameters I pass to it (sender, Button, X, Y).

Thanks!
[Reply][Quote]
Jeff Crawford
Posts: 52
 
Re: OnClick event fires for every checkbox on the form on openYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Jul 07 3:41 PM
When your loop encounters a checkbox, do you execute any statements or does the loop pass the control by without doing anything with it?

As far as the OnMouseDown event goes, you do not have to pass it anything. Sender is the object that triggered the event. Button is the index of the mouse button used to trigger the event, X and Y are the position of the pointer relative to the screen when the event was tiggered.
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: OnClick event fires for every checkbox on the form on openYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Jul 07 9:32 PM
Get rid of the on-click event.. use Mouseup.
--
rjl
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: OnClick event fires for every checkbox on the form on openYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 07 12:19 AM
It is true that setting the checkbox checked value will fire the click event. This is true for when the controls are binding as well. When the binding engine sets the value for the control, the click event will fire. However, there are form events that you can use to see when this is the case.

See http://www.slxdeveloper.com/forum.aspx?forumid=2000&postid=5393#5393

You can use the form's IsReading property to know whether the click event was fired by a user click, or by the value being set from data binding.

ie:

Sub checkbox1Click(Sender)
If Not IsReading
' do something here
MsgBox "The user clicked the checkbox. I can do whatever here"
Else
MsgBox "The checkbox was set via data binding. I won't do anything here"
End If
End Sub


Make sense?
[Reply][Quote]
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Re: OnClick event fires for every checkbox on the form on openYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 07 6:45 AM
Also, as a coworker pointed out to me a while ago, the 'mouse up' event of the checkbox is a workable substitute in most cases.
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: OnClick event fires for every checkbox on the form on openYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 07 8:31 AM
Correct, the Mouse Up is the key......but we didn't have it until 6.2 or so......

RJ Samp
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: OnClick event fires for every checkbox on the form on openYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 07 10:42 AM
Quote:
Originally posted by RJ Samp

Correct, the Mouse Up is the key......but we didn't have it until 6.2 or so......

RJ Samp


The problem with using the MoseUp event, is that I don't believe it will fire if the user is tabbing through fields and sets the checkbox (with spacebar) without using the mouse.
[Reply][Quote]
Adam Conde
Posts: 14
 
Re: OnClick event fires for every checkbox on the form on openYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 07 11:14 AM
Ryan,

I wasn't aware of IsReading, and that's exactly what I needed.
Thank you so much!
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: OnClick event fires for every checkbox on the form on openYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jul 07 6:45 AM
That's a new one for me....call me an old Mac guy.....but I've never heard of a space bar toggling a check box......

Is this one of those 'easy access' keyboarding shortcuts?

So we've been complaining that an OnChange is not the same as a Mouse Click for years....and now your telling me that you can change the value of a check box with another keyboard event?

Not a good GUI.

Can I toggle radio buttons without a mouse?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: OnClick event fires for every checkbox on the form on openYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jul 07 10:17 AM
Quote:
Originally posted by RJ Samp

That's a new one for me....call me an old Mac guy.....but I've never heard of a space bar toggling a check box......


Spacebar has always been used in windows for toggling a checkbox. If you're an all keyboard user, as you tab through a form, and you land on a checkbox, spacebar is what you use to check/uncheck the checkbox. Been like that in windows for as long as I can remember. It is a built in part in windows so it works like that for *any* checkbox in windows (even on a webpage), so we're not just talking the SLX checkbox here. I'll bet the Mac has something similar - maybe even the spacebar too. After all, if you tab to a checkbox, there has to be some way to check or uncheck it without the mouse. If not then *that* is bad GUI.

OK. I had to google it, Mac also uses the spacebar to check a checkbox. Look at this page here: http://www.bbc.co.uk/accessibility/mac/seeing/talk/talk_osx.shtml Item #11 says "press the ' Tab' key until the ' Speak the alert text' checkbox is highlighted and press the ' Spacebar ' to check it". So it's not just a weird windows thing.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: OnClick event fires for every checkbox on the form on openYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jul 07 10:18 AM
But the point is, using a "mouse" event for the checkbox ignores the users who use all keyboard to check the box - without the mouse. So the MouseUp event won't fire for those users, making your code break.
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: OnClick event fires for every checkbox on the form on openYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jul 07 12:47 PM
Got it. So we still don't have an event for keyboarding OR mousing the checkbox....so that's the bad GUI.

As a developer, I don't care if a letter get's typed, pasted, voiced, or selected off of a character/keyboard combination Pallete....somehow a physical GUI action changed the edit box.....that's an OnChange event. As differing from an OnOpen / data reading ONChange datavalue change or a Script throwing a value into a control.....

Similarly, if an OnPopupReturn is triggered from a Popup that's invoked by voice, keyboard, mouse, picklist.Click, act of God.....it MUST always trigger the event OnPopupReturn.

When is a mouse click on a grid row not a mouse click on a grid row?
a) when it's on a Group Node band
b) when it's a RMB? see (a) as well, am getting strange values back on an RMB of a grid row
c) don't tell me that a down arrow or some keyboard command that jumps me to the next row doesn't change the OnClick event nor change GetCurrentField value calls.....

Are we going to find some ActiveX Control that doesn't respond to Ctrl-X, Ctrl-C, Ctrl-V but only the RMB Cut, Copy, Paste controls? No need to answer that, that already is occurring all over the PC world.

We all understand, now, that an OnChange of a check box is not the same as a OnMouseClick. What the control developer's need to understand is what the developer's are asking for. So SPACE bar is functionally equivalent to a Mouse up (Mouse down) on a check box....it's a keyboarding shortcut. I'll buy that....but since it's the equivalent it need's to be captured in the event (or another one but that would be a pain for us wouldn't it).

IF I'm using a VOICE Command to effect the mouse click, I'd expect that to be handled by the Control's Event manager as well.
If I'm using a Graphics Pad, and I check box using the stylus I'd expect it to fire.
If there's some special Phone Pad combination of arrow keys, and the select key (under the screen) or the Circle button in the middle of the arrows I'd expect all of those to fire off the OnClickEvent.
Same with Laser designated, infrared, and HUD human eye retinal image scanning keyboards

Shouldn't the Control should be inheriting these functional equivalents???

Next you're going to tell me that Tabbing into a cell is different than Alt-Tab backwards into a cell is different than arrowing into a cell is different than Keyboard special character combination jumping into a cell is different than programmatically jumping to the next cell (say when you enter a 6th character into a 5 character field) is different than Jump Ahead into a cell is different than mouse clicking Left or Right MB into a cell.

Ryan, there's no difference and there shouldn't be in event handling.

And that's why this is bad GUI/Event handling interface.

(BTW in the MAC in Pascal, the space bar triggers the same event as the Mouse Click according to my former Apple employee brother...you don't have to code for any additional 'functional' equivalents.... in fact ALL of the Easy Access keyboard equivalents fire off the same events as their mouse click or other GUI interface equivalents.... so if Fn-L is a '3', and a 3 is a 3...and a 10 Key extended keyboard 3 is a 3......then ALL 3 events that were looking for a '3').

It would be a sad day indeed if you had to code for a Voice 3 versus a 10 key pad 3 versus a 3 versus Function-l would it not?
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/19/2025 4:23:33 PM