Oracle Apex 5 Modal Call - oracle-apex-5

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?

Related

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

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.

FormGroup still have controls although deleted dynamically

We have angular page with structure of Left bar (Say Component A), Main content (Say Component B)and right side bar (Say Component C).
Under Left bar , we have dynamically added custom controls. Custom control has say 2 textbox (with validations) and a button. There is button called "Delete" under each control so that that control would be deleted if clicked.
Right Side bar has button say "Save" . Once user clicks on it validation do get fired (if applicable) or saves data.
Issue:
Lets Say I have 5 controls on Left side bar. Lets say their names are ctrl01,ctrl02,ctrl03,ctrl04,ctrl05
When I click on delete button of ctrl02 , It gets Deleted. and then FormGroup has only 4 records ctrl01,ctrl03,ctrl04,ctrl05 and so is UI
However when I Delete ctrl03/ctrl04/ctrl05 the object are Deleted from UI but FormGroup still has ctrl01,ctrl02,ctrl03,ctrl04,ctrl05.
So, Application doesn't Save data for ctrl01 as Validation gets fired for controls which are deleted(ctrl03,ctrl04,ctrl05) but still part of FormGroup.
Please note this issue occurs only after Deleting 2nd and onwards controls .For First it works fine.
I also checked if Object holding all these records is properly updated or not after Deleting. It is updating properly. That's why UI shows correct number of Custom controls. Its just FormGroup which is causing this issue.

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

Issues saving current record from custom dialog

I am currently developing a custom app in Maximo Asset Management where i have form and an empty DataTable that have a button, when user clicks this button, a custom dialog appears and user can select a related record from this dialog on a data table to process it by clicking a button to launch an action script. The problem i am facing is when system finish process the record, it saves correctly, but application shows the first record of table and not the current saved record, so user gets confused when this happens.
Let me put an example, lets suppose the first record id of my custom table is CC1055 and the current saved generates as CC1156, when i close dialog after process record with automation script custom logic, the systems shows the record with id CC1055 and not the new saved record CC1156, postdata: I use Maximo 7.5.0.9
I had the same issue. The reason Maximo goes to the first record in the table is that it does not know which record to display after opening and closing your new custom dialog and saving the record.
The simplest solution is to add savemode="ONLOADUNLOAD" in your custom dialog tag in xml.
This will save the record before you open the dialog and Maximo will know to which record to return after closing it.

Setting active a page(tab) in a notebook of form view

I'm developing a module for openerp v7.
I've defined a workflow and in my view defined a form with a notebook which contain as tabs as status defined in workflow.
In every tab i've a button which triggers the change of status of the workflow. All of this works like a charm!
The problem I am facing is that when the button triggers the workflow status change, the status changes but the tab marked as active is not changed, as far i know this is the expected behaviour, but i would like to change the active tab when the status of workflow changes and i didn't find any way to do it.
INFO: According to the DOCS there is a way of doing this with the fields:
default_focus: set to 1 to put the focus (cursor position) on this field when the form is first opened. There can only be one field within a view having this attribute set to 1 (new as of 5.2)
But no way with pages...
Any help would be very appreciated.
I think that making a tab to be active is not the expected behavior with a workflow. Normally, buttons are putted in the header next to the statusbar, and each button have the "states" attribute to define those status they must appear in (according with the "state" field of the model).
If you want to show/hide some information (say field, group, page, etc) according to the workflow status, you can use the "attrs" parameter with the "invisible" option restricted to a domain over a "state" field value.
If you want to use JavaScript, you can use this to focus a tab page:
$('.oe_notebook #ui-id-3').click()
Where ui-id-3 is the 1 based index of the tab page. Here it would be the third page. Works in v8, can't tell for other versions. Hope it helps anyway :)