Iron Speed Technical Forums
Register Latest Topics
 
 
 


Reply
  Author   Comment  
pk_davidson

Registered:
Posts: 223
Reply with quote  #1 
I don't seem to be able to access either the SaveButton_Click code or the event handler for the click event from the RecordControl Class. 

I did use a FindControlRecursively(Me,"SaveButton") to get a handle to the button but that didn't seem to help.

Is there a way to do this ?  Seems like I need the instance of the button to hook the click event.
Or ?  I thought the page instance (Me.Page) would provide access to the SaveButton_Click code but no...

Thanks

__________________
Paul
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,950
Reply with quote  #2 
If your intention is just to save the changes, you can call instead the SaveData() method like:

Me.Page.SaveData()

You just need to enclose it with a Transaction boundary.


Cheers,
Jimi J


__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

miles

Avatar / Picture

MVP Consultant
Registered:
Posts: 1,656
Reply with quote  #3 
where is the Save Button?   Is the button for an Edit Table form or a record panel?  If embedded within a record panel, then it should be visible.

HTH,

__________________
Miles Gibson, MScIS
Iron Speed MVP
Senior Consultant, Principal
Milestone Software Inc.

http://www.ironspeedmvp.com\localizer 
Email: miles@milestone.ca
Milestone Localizer: Full Localization for your Iron Speed applications!
pk_davidson

Registered:
Posts: 223
Reply with quote  #4 
Tx for the replies gents:

Basically what I've done and has worked for a number of years, is to duplicate the Save button that is in the Page Button section and put it in the RecordControlTitleRegion.  Originally to do that, I basically did what Jimmy suggested and duplicated the save code.  The end users prefer one long page with all fields on one page rather than a tabbed setup (that would be my layout preference.) 
I added the top button just to save scrolling time if the edits are happening at the top of the page.

Recently an end user is claiming that his edits are not always being saved and that he's getting no error or notification messages.  He edits a record and is returned to the show page as if everything were ok.  But he says his edits are not always saved.  Of course, everytime I try it, it works fine and everytime he tries to show me the issue, it works fine on his desktop setup.
 
In order to troubleshoot this, I was hoping to make sure that both buttons were running identical code and hoped to do this by having the button in the title region just called the standard Save button click event from the PageButtons section.  I'm trying to add in queued up messages in case something is causing a rollback without notification.

The standard Save Button and associated code is defined in the partial class of the EditPage.
My duplicate Save button's click event is defined in the RecordControl class because that's where the button is apparently scoped.

And there's the rub, I just can't seem to intellisense my way to find access to the code on the edit page.  I tried Me.Page, got a handle to the control via FindControlRecursively, etc...

For now, to work on trying to trap the error, I've just gotten rid of the second Save button and only allow the stock button.  I'm 99% sure there's not a problem with the second button but for debugging, I'm removing as much extraneous and possible error sources as I can.

__________________
Paul
dingjing

Avatar / Picture

MVP Developer
Registered:
Posts: 256
Reply with quote  #5 
Switch the roles of 2 save buttons.
1. Set in-control Save button's action to "Save page data."
2. Override page Save button's click event handler, call MyControl.SaveButton_Click().

Page class is a partial class. Its methods are not accessible from outside. The control class is not partial. So its methods are accessible from page class.
pk_davidson

Registered:
Posts: 223
Reply with quote  #6 
Thanks Ding, good idea, I should have thought of this.
__________________
Paul
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement