Dynamic Action on new row in Tabular Form
Hi Guys,
APEX version is 4.1
I created a dynamic action on change of a select list, if changed then disable the related fields on the same row.
This is working fine for all EXISTING rows on the tabular form.
However, if I click on ADD ROW button, a new row is added to the page, but the change event on select list is
not triggerred from the dynamic action.
Is there any thoughts or workaround on this interesting problem?
Thanks in advance,
Frank
I got it working by adding a onchange event which is triggering js function on the page.
Similar Messages
-
How to stop insert of new row in tabular form if it's also being deleted
Suppose you have a tabular form, and one of the fields is a not-null column. A user checks a button to "add additional row", which adds a new row to the form, defaulting that not-null column to null. Assume it's a name or something, so there is no reasonable non-null default value that can be entered here to keep it from being null.
Now suppose the user makes a series of changes on the page, but then decides they don't want that row they just added, so they mark it for deletion, then click on "Delete Checked Rows". The not-null column was left blank.
The page is constructed in such a way that the ApplyMRD process runs first, then the ApplyMRU process. (I do this so that the user doesn't lose all their updates if they want to delete a row. I've had a few people complain when they tried to combine both operations, and unexpectedly lost their updates when they hit delete instead of submit.)
What happens? The page errors out because the ApplyMRU process is trying to insert a row with a null value in a not-null column. The ApplyMRD process ran fine, but because the row marked for deletion didn't exist in the database to begin with, it effectively did nothing. But ApplyMRU still tries to add the row, even though it was marked for deletion.
Is there any way to prevent this scenario from happening, without requiring the user to Cancel instead of deleting the blank row, which would cause all other changes on the page to be lost? I'd also like to avoid losing the ApplyMRU process when the user clicks "Delete", since it's more effective to combine operations and this will address the UI complaints I'd received otherwise.
(This is on ApEx 4.0, if it matters.)
Thanks,
KeithThinking about this some more, doing the delete and update together may not be an easy thing to accomplish after all.
Consider the above scenario, but the user puts a dummy value like "ignore-me" into the not-null text field, so the error doesn't come up with ApplyMRU is fired. But if ApplyMRD runs before ApplyMRU, it still doesn't do anything because there is no row in the database with the value "ignore-me". Then ApplyMRU runs and it adds that row, even though it was marked for deletion.
So you probably need to always run ApplyMRU before ApplyMRD. But then you wind up inserting a row before you delete it, and that may have unintended side effects, if the user really never wanted to add it in the first place.
Right now, the only workaround I can think of is to:
1) put ApplyMRU before ApplyMRD
2) add a pre-commit validation that checks to see if a row is blank AND checked, and if so, put a dummy value into the not-null field
3) let that row get added and then deleted, and make sure there are no side effects from this (for example, there is an audit table that tracks updates to the base table -- I can add a trigger that does nothing if presented with this dummy value)
Hopefully, though, there is an easier and more "built-in" way to achieve what I'm aiming for. -
Dynamic action on radio group in tabular form
Hi,
I'm very new to APEX and I've tried searching the web, but I can't seem to find a good answer for my problem. I have a page in APEX with a tabular form with 6 columns. The last column is supposed to show/hide a button for each row based on the value of a radio group (static LOV) with 2 options in column 5. I want to do this with a dynamic action on the radio group, but I'm having trouble figuring out how to do this. Since the radio group is in a tabular form it's not an item and so I can't just select it in the dynamic action wizard. I figure I have to use a JQuery selector here, but my knowledge of this is very limited.
I've created the button in the select statement for the tabular form like this:
select
"ROWID",
"DATA_COLLECTION_ID",
"ID",
"VARIABLE_NO",
"VARIABLE_NAME",
"DATA_TYPE",
'<a href="javascript:epf.dialog.open(''f?p=&APP_ID.:18:&SESSION.::::P18_ROWID,P18_ID:'||ROWID||','||ID||''',800,700);" id="Category" class="epf-button"><span class="epf-tooltip" data-epf-tooltip="Definer kategorier for denne variabelen"></span>Definer Kategori</a>' category
from "MATH_USER"."STA_VARIABLES"
where "DATA_COLLECTION_ID" = :P17_IDAny help would be greatly appreciated.
- Patrikpatrikfridberg wrote:
$('input[id="category"]')[currIndex].hide();;where does this category come from? and you are referencing id attribute which can only handle one row.
You must make the jquery selector based on column name (inspect your column using firebug/chrome and see the name attribute of the column form element, it will in format f0x).
Look at my original code below and i am controlling a column with name f01
>
It still doesn't work for me. From what I understood from the "Incorporating JavaScript into an application" page I should put the code in the JavaScript section. I tried that too, but nothing changed. So now I'm thinking there is something wrong with the code itself?
YES
this is my original code
function test(pThis) {
//get the curren row index on change
var currIndex = $('select[name="'+pThis.name+'"]').index(pThis);
if (pThis.value=='20') {
$('input[name="f01"]')[currIndex].style.display = 'block';
else {
$('input[name="f01"]')[currIndex].style.display = 'none';
} -
Dynamic Actions in Select List of Tabular Form
I have a tabular form in my application and one of the column A is Select List with lot of values. My requirement is, there is another column B in the same tabular column like Display text, which should appear when a user select A, B or C in the select list column A. Is it possible, how can I implement it?
I tried it through Dynamic Actions ->DOM Objects, but I am not sure what is the name of the Select List column value that needs to be specified, it is jst f06 or f06_???. Can someone tell me the exact steps that needs to be followed.My mistake, Javascript (and DOM attributes/methods) are case-sensitive. The attribute in question is readOnly, not readonly
I fixed it on my example page at http://htmldb.oracle.com/pls/otn/f?p=24317:255
<script type="text/javascript">
function ro_Item(nd,a){
var lEl = html_GetElement(nd);
if (lEl && lEl != false){
if(a){
lEl.readOnly = true;
lEl.style.background = '#cccccc';
}else{
lEl.readOnly = false;
lEl.style.background = '#ffffff';
return true;
function foo(pThis)
var lTD=pThis.parentNode;
var nextinput=lTD.nextSibling.getElementsByTagName('input')[0];
var nextnextinput=lTD.nextSibling.nextSibling.getElementsByTagName('input')[0];
if (pThis.value=="CLERK") {
ro_Item(nextinput,true);
ro_Item(nextnextinput,true);
else {
ro_Item(nextinput,false);
ro_Item(nextnextinput,false);
</script> -
How to add a new row in Tabular Form based on a table
Hi
I have tabular form based on a table.
I want the table to have an empty row when there is no data
in the table so that I can enter data directly.
But right now whenever the page is launched, its showing a no data found message and I have to press the 'Add Row' button to enter data.
Can anyone help me out on this?
ThanksHi Leo
Your suggestion works fine in the APEX 2.1
But in 3.0.1 it gives this error :
Error in add row internal routine: ORA-01476: divisor is equal to zero
Error Unable to add rows.
I am not sure why this happens. -
Hi,
Anyone knows how dynamicly delete rows from Tabular Form (on button click, button is as item)?
Thanks.I am in a great fix. We had a test instance.. and we had a version apex 3.2.. But when the same application has been uploaded to prod.. we used apex 4.0.Why on Earth would you do this? The whole point of the testing is to verify that the application will work in the production environment: the first requirement for this is that the test and production environments are equivalent.
has any body is facing the same issue as mine..Yes, as is easily discovered by searching the forum...see Delete button doesn't work in tabular form after upgrade from APEX3.2 to 4. -
Dynamic no of rows in tabular form
Dear oracle forms experts,
hope you all will be doing fine.
Is it possable to that a tabular form take dynamic no of rows at run time, i mean if we i query mode if data contains 20 rows then it should expand to 20 rows and if it is only 5 rown then it should expand to 5 rown. and if i do not want to use side bar as well.
Regards
AbbasOK and thanks you too.
now if i take it in this way that i have defied a tabular form for let say 20 rows and now in query mode if there are only 5 records then my form shuold show only first 5 rows that have data and rest 15 should get hidden..
so now can it be possable in forms Developer 10g.
Kind Regards
Abbas -
ADD ROW in tabular form with new max value for a certain field
All,
I have a tabular form with an 'ADD ROW'-button.
When a row is added the field 'TemplateID' should get
automatically a new value which is MAX from TEMPLATEID + 1.
I would be very glad, if someone has a hint for me.
Thanks in advance,
lucioHi
the cause of not seeing the 'Default Item Field' is,
that during creation of a 'Tabular Form' the column with the
primary key doesn't get that feature, why so ever.
I still hope that someone could give me a hint why that code isn't working:
function SetNewID(vDBID)
v_check = $v('P20_MAX_TEMPLATEID');
pNd = $u_Carray(vDBID);
for(var i=0;i<pNd.length;i++){
var node = $x(pNd);
node = $x_Check_For_Compound(pNd[i])
var lTr = $x_UpTill(node,'TR');
updateRow = lTr.rowIndex - 1;
document.wwv_flow.f02[updateRow].value=$v(v_check)
Many thanks in advance
lucio -
Add row in tabular form fails, "gErrItems is undefined"
I'm struggling to get Apex working on my new laptop.
Apex 4.1.1, Oracle 10.2.0.5, Windows 7 64 bit.
I click 'Add row' on the detail region (the tabular form) on my Master - Detail page.
The row appears, but after clicking 'Apply changes' it's gone again.
Using Firebug, I see that the javascript causes an "gErrItems is undefined" error, something coming from apex_4_1.min.js
The same application works fine on apex.oracle.com, so it's the installation on my laptop.It seems to be a problem with apex_listener under Glassfish.
I'll post in the proper forum again. -
Add Row on Tabular Form - column from read only to update/insert allowed
APEX 4.2.2
Newbie in the APEX forums, go easy please.
I'm building a rather simple tabular form based on a table with a primary key (emp_number). Sounds like an Oracle tutorial but trust me, it's a real table. This table has, for this example's sake the following attributes:
Table Name: EMP_EXCEPTIONS
EMP_NUMBER NUMBER (PK)
UPDATE_EXEMPT VARCHAR2(1)
I've used the Tabular Form wizard to create a nice looking tabular form page, all good and works as intended. Of course the primary key value is non update able by the wizard and that's by design - I've no need to update any primary keys. When I click the add rows button however, I'd like to be able to include the emp_number field as a input able field. At the moment, when I click the add rows button it inherits the property of the emp_number as read only. The user entering the new row would know the employee number and whether they were update_exempt or not. So rewinding my head in Oracle Forms, this would have been done by setting the row attribute as update allowed when the button is clicked. Is there such simple functionality in APEX and if so can you point me in the right direction?It seems to be true:
- if there is ascending order on columns which fields are null in new line (have no default value), new row is visible in current "pagination" page
- but if there is DEScending order OR ANY sort order is set on columns which fields are NOT null in new line (have default value), new row is NOT visible in current "pagination" page
thank you! -
How to disable row in tabular form when checkbox checked?
Hi.... this is what i want to do....
I created tabular form for offering items... there is a checkbox that is used to select item with lowest price...
But i have also one column that shows item options ( option is for example... i want offer for 22" monitor Samsung, but seller have only 22" LG monitor.... so in my offering will be shown item (22" monitor Samsung) that i want, and in row below item (22" LG monitor) that seller have... both items will have same order id....
Next thing i want to do is when i select checkbox with item (22" LG monitor) as lowest price, i want that row with same order id (22" samsung monitor) is disabled.
Is that possible to do?
This is my code for creating tabular form:
SELECT
CASE WHEN RED_BR_OPCIJE = 0 THEN '-' ELSE TO_CHAR(RED_BR_OPCIJE) END RED_BR_OPCIJE,
apex_item.hidden(1, ID_STAVKE)||
apex_item.hidden(2, ID_STAVKE_IZ_ZAHTJEVA)|| ---order_id
apex_item.hidden(3, ID_PONUDE)||
apex_item.hidden(4, ODABIR_NAJPOVOLJNIJE_STAVKE)||
apex_item.checkbox(5, '#ROWNUM#', null, decode(ODABIR_NAJPOVOLJNIJE_STAVKE, 'X', '#ROWNUM#')) Odabir, ---checkbox_lowest price
apex_item.textarea(6, NAZIV_ARTIKLA_TRAZENO, 3, 40, 'readonly="readonly"') NAZIV_ARTIKLA_TRAZENO,
apex_item.textarea(7, NAZIV_ARTIKLA, 3, 40, 'readonly="readonly"') NAZIV_ARTIKLA,
apex_item.text(8, SIFRA_ARTIKLA, 8, 20, 'readonly="readonly"') SIFRA_ARTIKLA,
apex_item.text(9, JMJ, 5, 20, 'readonly="readonly"') JMJ,
apex_item.text(10, KOLICINA, 6, 20, 'readonly="readonly"') KOLICINA,
apex_item.text(11, JEDINICNA_CIJENA, 12, 20, 'readonly="readonly"') JEDINICNA_CIJENA, ---price
apex_item.text(12, IZNOS_STAVKE, 12, 30, 'readonly="readonly"') IZNOS_STAVKE,
apex_item.text(13, IZNOS_RABATA, 12, 20, 'readonly="readonly"') IZNOS_RABATA,
apex_item.text(14, JEDINICNA_CIJENA_NAKON_POPUSTA, 12, 20, 'readonly="readonly"') JEDINICNA_CIJENA_NAKON_POPUSTA,
apex_item.text(15, IZNOS_STAVKE_NAKON_POPUSTA, 12, 20, 'readonly="readonly"') IZNOS_STAVKE_NAKON_POPUSTA
from PONUDE_STAVKE
where ID_PONUDE = :P34_ID_PON
ORDER BY ID_PONUDE ASC, ID_STAVKE_IZ_ZAHTJEVA ASC, RED_BR_OPCIJE ASC
And this is example table with a few column names:
order_id option_number item_name price checkbox_lowest price
1086 - Samsung 22" monitor 100$ null ---this row should be disabled because next row is selected as lowest price
1086 1 LG 22" Monitor 90$ X --- both rows have same order_id
1050 - Router 100$ XHi snake2903,
{thread:id=998140}
{thread:id=1554583}
{thread:id=2249233}
Hope it helps!
Regards,
Kiran -
Password Masking & Background Color for Multiple Rows in Tabular Form
Hi all,
I have a requirement of making a column in Tabular form, having multiple rows, masked(password field). I also want to give bg color to this field indicating that its a mandatory field.
I am unable to accomplish both at a time in my page. I am using Apex 3.2.
Waiting for your valuable comments. Thanks,
Regards,
SandeepAPEX_ITEM API doesnot have a password function, but input fields of type password are available in HTML.
So you would have to change the field type to password in JS
That is from :
<input type="text" ...change it to
<input type="password" ...If you were using jQuery it would have been simpler, but to do it in native JS it is a bit more hard work.
Anyway here goes (a quick check in a tabular form seens to work fine)
var password_array=document.getElementsByName("f04");
for(var i=0;i<password_array.length;i++)
password_array.type = 'password';
password_array[i].style.backgroundColor = 'RED';
+Replace the "f04" with your password field's array name(use firebug to identify the field name)+
Does that solve your problem ? -
Add a new row in Detail form in MASTER DETAIL FORM
Hello Everyone,
I need help on the following.I have master detail form .In detail form i have Add Row button which adds a new row and i have save button to save the record .But now if i am adding a row its not adding a new row .It says it process but didn't show the new row .
Can somebody help me on this
thanks in advanceHello,
How many records do you show in your detaii region and how many are there for that master? Maybe the new row is in the next set of records - or at the 'bottom' of the last set of records?
Did you check if the row is inserted in the database (and just didn't show up for one reason or another)?
Greetings,
Roel
http://roelhartman.blogspot.com/
http://www.bloggingaboutoracle.org/
http://www.logica.com/ -
How to create validation only for created rows in tabular form
Hi all,
I have a simple question. Is it possible to create a validation for tabular form which will be fired only for created?
There is a possibility in APEX 4.1 to choose two types of "*Execution scope*" first is "*For created and Modified Rows*" and second is "*All Submitted Rows*".
Thanks in advance!
Regards,
JiriHello Jiri,
>> Is it possible to create a validation for tabular form which will be fired only for created?
You can still use the scope of For created and Modified Rows and use a PL/SQL Expression condition of:
:APEX$ROW_STATUS = 'C'You also need to change Execute Condition to For Each Row .
Hope it helps,
Arie.
Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all. -
Hi,
I have created a tabular form using wizard.I am inserting into the table using a procedure which is being called at Page process.This procedure I am call
My problem is that when I click Add Row to create an empty row(we type in data to be saved in this empty row) on the form,my procedure to save the records into the table is being called which I do not want.I want the procedure to be called only when we click the Add Row to save.
This problem exists when I try to add row on entering the page from anther page.
If i click add row continuously without moving out from the page,it works without any problem.
please suggest a work around.
thanks and regards,
k.tannaHi,
Kindly go to the url
http://apex.oracle.com/pls/otn
Workspace:kdoyen
user:demo/demo
Application:60347 - test
You can login into the application using demo/kdoyen
Go to the tab 'Orders',clicking on an existing order,it will take to the page view/modify orders.
Go to sql commands and run the query select * from DEMO_ORDER_ITEM_DETAILS;check the records...
Click on Add Item to Order.
Go to sql commands and run the query select * from DEMO_ORDER_ITEM_DETAILS;
you will see a row has been added to the table even without entering any data on your empty row.
Now enter data in your empty row,and click add item to order,the row will be added in your table which works fine.
my problem is when we click Add item to Order to create an empty row,my procedure is called.
I hope you have understood.
Please let me know if you have any queries.
Maybe you are looking for
-
The error message is Server Error in '/' Application. StartIndex cannot be less than zero. Parameter name: startIndex I can avoid the message in IE by adding the site to the list of trusted sites. How do I accomplish the same thing in Firefox?
-
Please see why this is not working
hi everyone! Please spare ur time to see what's wrong in this code: I have written this code for a GUI which checks for 4 types of punctuation errors in .txt files. The code compiles correctly and the Gui also appears nicely but when I Give a pathnam
-
Blocks behaving differently.
Hi, DB 9.2.0.1. I am running the following anonymous block, but it's not executing the way, it should. Like I am assigning create table privililege by executing this block , according to me it should executed, but when I run this, the control takes i
-
Activity report in REM for each document posting
Dear All, Please help me with , how to get the Activity report for each & every for MFBF document posted. BR, Subbu.
-
Hi ALL i have a table with a column that contains a url: #{row.taskUrl}. Its displayed as any string, how can i display it as an active URL? thanks