Welcome Guest Search | Active Topics | Sign In | Register

Using dialog to update database records and control workflow Options
Steve Corn
Posted: Saturday, August 25, 2007 8:43:19 AM
Rank: Newbie
Groups: Member

Joined: 7/3/2007
Posts: 2
I have a page with a datagrid of orders. Each row contains 4 buttons that call dialogs server-side:
1. Activate order
2. Receive order
3. Add notes to order
4. Edit details of order

Each dialog involves updating the order record, validating input before saving and closing (ie, keeping the dialog open if validation fails), and showing only the dialog that was called by the button click.

I have tried several different ways to handle the dialog content and buttons, but I haven't come up with the right combination yet. So I have a couple of questions:

a. Is the dialog a good way to accomplish my objectives?
b. If so, do you have any "best practices" suggestions as to how to accomplish this?
eo_support
Posted: Saturday, August 25, 2007 9:44:17 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Steve,

I do not see any reason using dialogs for your objectives is a bad way. Our dialog should work on this scenario. To simply the question, I would explain how the flow usually would be, for example, say you only want to add a notes to the order below:

1. User clicks "Add Note" button;
2. The page posts back, prepare the dialog for editing notes. This includes: 1. Set the dialog's InitialState to Visible. This will display the dialog; 2. Fill some contents inside the dialog, for example, an order ID label. You would need to make use of ContentContainer property to do that;
3. The updated page is sent to the client with the dialog now displayed. User enters notes and click "Save" button, which is a regular server side push button;
4. If all validations pass, save button would submit the page back to the server, you can then handle Save_Click on your server side and save the notes to your DB. At this point you can set the dialog's InitialState back to "Hidden"; If any validation fails, the dialog will still be there with the validator error message displayed;

The key at here is that it takes two postbacks to function. The first retrieves the order information and displays the dialog, the second saves data and close dialogs.

You can consider use a CallbackPanel control to smooth out the postbacks. CallbackPanel allows you to update a portion of your page. So you can put the dialog into a CallbackPanel control and have it updated without affecting anything else.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.