Hi Everyone,
I know...there are a lot of information about how to implement modal dialog form.....but I cannot find an answer on how to deal with my situation.
What I am trying to achieve is to create a form in apex page, assign items to this form , add Jquery script to the page header where I am going to call this form into modal dialog ..... fill out items in modal dialog and when click on "Create" - insert value of the items into my table.
Yes, this is common thing to do (like here http://shijesh.wordpress.com/2010/04/10/jquery-modal-form-in-apex-4 )....but I am trying to find a way where I don't need to create function for my "Crete" button which will call OnDemand Process. Anyways, here is what and how I am trying to do this and please correct me where I am wrong.
*1.* I do have a table called "inventory_modal", ID column has a PK and trigger/sequence is there too.
*2.* Do have a page with Form Region with data entry based on my table and Static ID "myModalForm".
*3.* Do have items assigned to my From Region :
:P23_ID (hidden)
:P23_INVENTORY_DATE (data picker)
:P23_ASSET_ID (number)
:P23_CONDITION (text field)
:P23_INVENTORY_OWNER (text field)
:P23_STATUS (text field)
:P23_LOCATION (text field)
:P23_COMMENTS (text field)>
*4.* Do have a button called "Open Modal" to open my form in dialog window with redirect to URL:
javascript:openForm();
*5.* Do have an On Submit - After Computations and Validations process
insert into inventory_modal (id, inventory_date, asset_id, condition, inventory_owner, status, location, comments)
values (:P23_ID, to_date(:P23_INVENTORY_DATE,'&APP_DATETIME_FORMAT.'), :P23_ASSET_ID, :P23_CONDITION,
:P23_INVENTORY_OWNER, :P23_STATUS, :P23_LOCATION, :P23_COMMENTS);
the process is Conditional with Request = Expression1 , where Expresseion1 is set to "CREATE".
*6.* And here is HTML Header Jquery script where I am calling "myModalForm" form to open in dialog window and by selecting "Create" button passing "CREATE" vallue back to page which should fire my process to insert data:
<link rel="stylesheet" href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/
redmond/jquery-ui.css" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"> </script>
<script type="text/javascript">
$( function() {
$('#myModalForm').dialog(
{
modal : true ,
autoOpen : false ,
buttons : {
Cancel : function() {$(this).dialog("close")},
Create : function() {$(this).dialog("close");doSubmit('CREATE')}
}
});
});
function openForm()
{
$('#myModalForm').dialog('open');
}
So, and here is my question. I don't want to use any OnDemand Process, I would like dialog window to pass values to my regular procedure in my page. I had an assumption that
Create : function() {$(this).dialog("close");doSubmit('CREATE')}
will do the trick but apparently it doesn't. Is there any way to do it?
Here is my testing page : http://apex.oracle.com/pls/apex/f?p=39330:23
If you click on Open Modal, it will open my form in modal dialog window, on create it will send "CREATE" request to my procedure which will insert data into table....but it unfortunately it will insert only NULLS into my table (only ID column will have data as it has trigger/sequence). So, click Create and then refresh the page.
Thanks