Dynamic action to update database record AND redirect to a different page - sql

I'm building a system of modal dialogs to allow users to edit database records.
The user clicks the "Edit" button on a specific row in a report somewhere
A modal dialog pops up, with fields that the user can edit and manipulate
The dialog has four standard buttons the user can select: Cancel, Delete, Save, and Create
Let's start with the Save button.
By default for modal dialogs, the Save button has the following behavior:
I presume this 1) submits the information from the items in the modal dialog (which refreshes the browser, closing the modal dialog), and then 2) performs the SQL UPDATE action with the submitted information, in time for the refreshed page to include the updated information?
This is fine, but I need to:
Avoid refreshing the browser (e.g. submit individual items, rather than the whole page), and
Manually redirect to another modal dialog (a different page) AFTER the SQL UPDATE action is completed
I presume this can be accomplished with dynamic actions, but I don't know how.
How can I ensure the database action is completed, before the dynamic action which navigates to a new page?

Manually redirect to another modal dialog (a different page) AFTER the SQL UPDATE action is completed
I'm thinking of creating a branch with Server-side condition set to "When button pressed" (for every button), or perhaps "Request is contained in value" where request name (by default) equals button name.
So: button would first do its processing part, and then branch to another page, without involving dynamic actions.

Related

How do I write this BDD script?

I have an exit button in my application which I want to write a story for. It behaves this way:
If I have content filled in the form I am editing and I click on the exit button, it will pop up with a confirmation message letting me know there are unsaved content and if I am sure I want to exit from the page.
If I do not have any content filled in the form I am editing and I click on the exit button, the confirmation message will not show up and I am instantly exited from the form.
What I have so far is something like this:
Given as a User on New Profile page
And I fill in the customer name = "Bob"
When I click on the Exit button
And I click on the "Ok" in the confirmation dialog
Then I will be redirected to the landing page.
My question is the part on And when I fill in the customer name = "Bob" only covers one of the fields. How do I write the story in a succinct way that if any of the fields are filled or chosen (drop downs), the confirmation dialog will show up ? Secondly, is my story correct ?
You can use a scenario outline in conjunction with parameterizing the step that fills in a field with a dummy value.
Scenario Outline: The user is taken to the landing page after exiting new user profile
Given I am registering as a new user
And I have filled in the "<Profile Field>" field
And I have chosen to exit the current page
When I confirm I want to abandon my unsaved changes
Then I should be redirected to the landing page
Examples:
| Profile Field |
| Name |
| Phone Number |
| ... |
You didn't post the scenario title, which is just as important as the wording for each step, so I made on up. The important thing is to focus on the behavior:
Scenario Outline: The user is taken to the landing page after exiting new user profile
The step Given I am registering as a new user should navigate to the new user profile page.
The step Given I have filled in the "<Profile Field>" field should accept an argument where you name the field you want filled in. The definition for this step should fill in the field with dummy information, or blindly chose an option in a dropdown.
The step Given I have chosen to exit the current page should click the exit button. Notice there is no mention of "clicking" on anything. You should avoid language in your steps the sound like instructions on how to use the user interface, and instead focus on the behavior of the application using business terms.
Same thing for When I confirm I want to abandon my unsaved changes. It does not mention clicking on anything. It just focuses on the behavior (choosing to abandon your changes). The step definition should know how to click the "OK" button in the confirmation dialog. The fact a confirmation dialog even exists should only be known by the step definition.
Finally, Then I should be redirected to the landing page makes your assertion about where the user ends up. I like to include the word "should" in my Then steps. If find it easier to pinpoint the test failure when a Then step fails. The condition that comes after the "should" in my step is usually the thing that fails.
you can use datatable in that particular step as below
Given as a User on New Profile page
And I fill in the customer details
|name|address1|adress2|pincode| //can be accessed with DataTable datatype in SD*
When I click on the Exit button
And I click on the "Ok" in the confirmation dialog
Then I will be redirected to the landing page.
*SD-Stepdefinitions

Need prompt to save changes in Windows form when changing displayed record

I am relatively new to programming, so this may be an easy one. I have a Windows form that connects to SQL Server and displays the data in a form where a user can edit and add or delete records (via databinding). The form works well, and has record navigation controls as well as context menus that allow the user to filter data on any field.
Currently, the user can make changes and switch to new records, etc... but changes are not applied until the user clicks the "save" button. However, I'd like to prompt the user to save records whenever the user navigates to a new record (either through navigator or through application of a filter which displays a different record).
What event can I use that will trigger whenever a different record is reflected in the form?
Thanks,
Jay

Oracle Apex 5 Modal Call

I created 2 interactive reports to work as a master detail. In the master, I have a link that will refresh the detail report with records for the master.
I have a create detail record button that will call a page as a modal window and then save. Everything works correctly except the Create detail button does not refresh with the master record id. The button is suppose to set the page item on the modal for the master record id.
It looks like the button is built when the original page is built and never changes. I have a dynamic action that sets an item on the main with the master record ID and I assumed that the button would use that, but it never refreshes with it.
How do I get the button to refresh when I change the item that holds the master record id? I can try and build it other ways but the I can not get the checksum to work and it will throw an error when the modal opens.
Here is the javascript call attached to the onclick of the button:
apex.navigation.dialog('f?p=810:6010:14381566697413::NO::P6010_TRACK_SERNO,P6010_FORM_ACTION:90,CREATE\u0026p_dialog_cs=z9T5rK-dt186xh83jq4Dy4d2vumFtU_Fj1a0Opm8M4gyGXp5eQ89zcx3KvDE84L_63s_4583R7WGcYhAHXyX1Q',
{title:'Level',height:'500',width:'720',maxWidth:'960',modal:true,dialog:null},
't-Dialog--standard',
$('#createLevel'));
I am just trying to change the P6010_TRACK_SERNO item from 90 to 95 as an example
In these cases I usually set the value of the item not on button click, but on initializing the called page.
For example, you could copy the item value via PL/SQL in Pre-Rendering like this:
:P6010_TRACK_SERNO := :P0000_MASTER_ID;
Is that an option?

PDF creation with page refresh

I have a page with a viewPanel and a dialog. When an item in the viewPanel is clicked, the dialog opens, prompting the user to make changes to that item, and offering them the option to generate a report of the item in PDF format.
At first, I tried putting the PDF creation onto a button, as described here: http://www.eknori.de/2011-10-25/xpages-to-pdf-with-itext/ However, whenever the button is pressed, I get a "NotFoundError: DOM Exception 8" which seems to stem from the dojo JS. So currently I have an alternative whereby the button simply sets some sessionScope variables and opens a pdf.xsp XPage, where the variables are read back and the PDF is created.
The PDF gets created correctly, but it also means that the page that the user is on won't be refreshed to display their new change in the viewPanel. I've tried adding page redirects at the bottom of the XPage which creates the PDF, but with no luck.
So, how can I create a PDF and prompt a user to download it, but also refresh the page that they are currently on?
Are you isseuing an partial refresh on the button to hide your dialog and to execute the code for pdf generation? If so you I think that there is your problem. What you could do is to do a partial refresh on the onClose() method of the dialog to refresh the viewpanel. In the clientside onunload method you could open a so called xAgent which renders the pdf for you in a new window (window.open(pdf.xsp?docid=xxx). Take a look here: NotesIn9: 039 Creating PDF’s with XPages Part 2
Of cours the problem with this approach is that when you have a button / image in yoru viewpanel row that displays if the report has been created is not shown because the xagent runs after the / during the time the viewpanel row is being refreshed.

Disabling the initiation form when workflow is started manually in sharepoint 2010

I have a sharepoint site(sharepoint 2010).
I have created a custom action, on click of which will initiate the workflow associated to a list. When the user clicks on the custom action button, an initiation form will be shown which will have the Start and Cancel button. Only on click of this Start button, the workflow will Run. I want to avoid the last step of clicking on the Start button. What I want is "On click of Custom action, Workflow should Run. Initiation form should not come into picture at all". Is this possible ?
two solutions:
Say it's good because you make sure the user didn't make a mistake
Change the custom action form to a page where you start the workflow manually (via code) and then redirect the user to the home screen (you can also do that with a dialog and then there's no need for redirect)