CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Submitting one section of a form from another

Print topic Send  topic

Author Message
FrankR

Posts: 154
Posted: 10/04/2006, 2:16 PM

I have multiple panels/sections on one web page.

I need to be able to trigger the submit of one section from another.

I read everything here and Googled for hours. I found some suggestions, but nothing has worked.

Could anyone bail me out and show me a code clip to programmatically click the button of one CCS section/panel/whatever from another?
_________________
FR
View profile  Send private message
peterr


Posts: 5971
Posted: 10/04/2006, 2:19 PM

From what I understand the .NET framework converts the whole page to one form and submits everything together as one form. So there is no concept of submitting one section in .NET. You can probably submit any section and as result everything will be submitted (whole page as one form).

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
FrankR

Posts: 154
Posted: 10/04/2006, 2:46 PM

Quote peterr:
From what I understand the .NET framework converts the whole page to one form and submits everything together as one form. So there is no concept of submitting one section in .NET. You can probably submit any section and as result everything will be submitted (whole page as one form).


Thank you for replying.

That's what I was hoping for, but that's not what's happening with the code generated by CCS. With 2 Submits on one page, the code of 1 does not execute when the other is clicked.


_________________
FR
View profile  Send private message
peterr


Posts: 5971
Posted: 10/04/2006, 3:26 PM

Possibly this clarifies things a bit because "the button of one CCS section/panel/whatever from another" may be different from "the code of 1 does not execute when the other is clicked".
Or at least on the client side the page with all forms may be submitted regardless of which button is clicked. However, on the server side the code is determining which form was active at the time when it was being submitted, thus the code is being run in a way specific to the "submitted form".
Anyway, the form submission process may be clarified now, but unfortunately now I don't know the answer to your question.
I'll check into this tomorrow in case no one else will provide an answer.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
FrankR

Posts: 154
Posted: 10/05/2006, 5:26 AM

Quote peterr:
I'll check into this tomorrow in case no one else will provide an answer.

Thank you. I'd appreciate this.
_________________
FR
View profile  Send private message
krzysiok

Posts: 4
Posted: 10/05/2006, 11:13 PM

Assuming your buttons/sections are located within single CCS record form you can just call other button's event handler to execute code related to the other button's click event. So assuming form is called NewRecord1, clicked button is called Button1 and the one you want executed is called Button2 you can call from Button1 OnClick event handler:

NewRecord1_Button2_OnClick(sender, e);

Make sure to put this call as the last line executed in your Button1 OnClick event handler because Button2 event handler will redirect after successful execution and no other code from Button1 will be executed.

In general you always extract the code you want executed for all buttons into separate routine and call it from other event handlers.

If you want to force executing form's Insert/Update/Delete operation inside button's event handler use:
<formname>Data.<operation>Item(item);
i.e.
NewRecord1Data.InsertItem(item);

This approach is useful if you wish to perform both insert and update operation with a single click (defaults selected from one record are submitted into new record and parent record gets updated with some update time etc.). You define both Custom Update and Custom Insert accordingly and in update button's OnClick handler you force Insert operation as well.

Regards,
Chris
View profile  Send private message
peterr


Posts: 5971
Posted: 10/06/2006, 12:22 AM

Thanks C. So looks like buttons matter even if all forms are submitted.
One more note that I received:
A button's handler always performs redirect at the end of execution and calling another button's handler may never return back to the original button. Therefore you may need to handle differently an execution of multiple button handlers. Please let us know if this is what you need.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
FrankR

Posts: 154
Posted: 10/06/2006, 3:30 AM

Good stuff. Thank for the post.

In my case, I actually have multiple record forms on one page.

_________________
FR
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.