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!
|
|
CheckBox OnClick event runs on refresh
Posted: 03 Jan 07 5:20 AM
|
fiogf49gjkf0d Hi, I have a checkbox on the main account screen and basically when it's ticked I want it to write out to a table (similar to history) saying the current state of the checkbox with the time/date so I have a clear history of when the checkbox was ticked and unticked. This is all well and good but... when the account screen is refreshed it appears to be running the onclick event and in turn writing out information when the checkbox has not been ticked/unticked.
Is there any work around for this? A away of determining the difference between a click on the checkbox and a refresh etc?
All help appreciated, Kev |
|
|
|
Re: CheckBox OnClick event runs on refresh
Posted: 03 Jan 07 10:19 AM
|
fiogf49gjkf0d In 6.2.3 there were some new form properties added for just this sort of thing that allowed you to see what "state" the form was in.
In 6.2.3 there were some new form properties added so you can now monitor what is happening at the time the event occurs.
IsReading - means the data binding system is currently "active" IsValidating - validate event is currently being evaluated/run IsWriting - data is being saved to the DB Modified - an edit has been made to the value of a data bound control
So, if you want to be sure that the click event was triggered by the user clicking the checkbox, and not that the event is just being raised it being set by the binding engine, then you could just do this:
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
This exact scenario is why these form properties were added in SP3. |
|
|
|
Re: CheckBox OnClick event runs on refresh
Posted: 04 Jan 07 12:53 AM
|
fiogf49gjkf0d Even easier is to use the OnMouseUp event.....only fires on a mouse click release
Sub chkNotInterestedMouseUp(Sender, Button, X, Y) IF chkNotInterested.Text = "T" THEN dteNotInterested.DateTime = NOW() END IF End Sub
RJ Samp |
|
|
|
Re: CheckBox OnClick event runs on refresh
Posted: 04 Jan 07 4:12 AM
|
fiogf49gjkf0d Thanks Ryan, Works a treat.. In response to the OnMouseUp event, I don't think there is one for checkboxes within SalesLogix forms or am I mistaken? |
|
|
| |
| |
|