This discussion is archived
8 Replies Latest reply: Feb 28, 2013 11:26 AM by jfosteroracle RSS

Dynamic Action on Tabular Form Columns

721928 Newbie
Currently Being Moderated
Is it possible to perform dynamic actions on the tabular form columns? For example, if a user populates one column then make the other appropriate columns disabled/non-updatable.
The tabular form is used to perform updates only.

Thanks,
DP

Just tried it, and it seems that you can't. Right clicking on a tabular form report column only provides options to Edit, Create Validation, Expand All, and Collapse All.
Versus, right clicking on items in the HTML Region provides options to "Create Dynamic Action" amongst others like copy, rename, etc.

Edited by: user4115675 on Aug 20, 2010 1:07 PM
  • 1. Re: Dynamic Action on Tabular Form Columns
    Prabodh Guru
    Currently Being Moderated
    DP,
    Everything is possible if you are willing to write enough code or think hard enough !

    You can write Dynamic Actions only at the Page Level and they can be made to run on Tabular Forms items, but it needs some good understanding of the HTML DOM of the Tabular Forms and jQuery.

    Write Dynamic Actions on the Page and use jQuery Selector for you tabular form items (arrays), not Items.

    Regards,
  • 2. Re: Dynamic Action on Tabular Form Columns
    631222 Expert
    Currently Being Moderated
    Hi,

    Suppose you want to disable field in second column when correponding field in thrid column is changed.

    -------
    method - 1 (jQuery)
    --------
    Basic - First column in tabular form f01 , second f02 , third f03 and so on.



    1) Edit the Column 3 of tabulr form.
    2) Go to Column Attribute Tab.
    3) in Element Attribute Enter - onchange=disable_column_2( this );
    4) Click on apply changes.

    Now, in HTML header of page enter the below javascript
    <script>
    function disable_column_2( pThis )
    {
       column_3_id = $(pThis).attr('id');
       column_2_id = 'f02_' + column_3_id.substr( 4);
      $("#" +column_2_id).attr("disabled", "disabled"); 
    }
    </script>
    ------
    method - 2 (Dynamic Action)
    -------

    3rd column id begins with f03 and 2nd column id begins with f02..

    1) Edit the Third Column ..
    2) Go to Column Attribute Tab -> Under Element Attribute enter class="myClass"
    3) Create Dynamic Action.
    a) Under Event Select Change.
    b) Selection type : JQuery Selector.
    c) JQuery Selector : .myclass (there is a don (.) in front of myClass- its important)
    d)In true action select Execute Javascript Code and enter a code similar to below code
               column_2_id = 'f02_' + $(this.triggeringElement ).attr('id').substr(4);
               $("#" + column_2_id).attr( 'disabled','disabled');
       
    http://apex.oracle.com/pls/apex/f?p=12060:18:

    Regards,
    Shijesh
  • 3. Re: Dynamic Action on Tabular Form Columns
    721928 Newbie
    Currently Being Moderated
    Prabodh,

    I guess I should have specified that, yes, as a last resort I will be writing my own code to make fields dynamic. As, I had to write extensive javascript and jquery code to trigger events and provide client-side validations. So, a lot of us are capable of writing enough code and thinking hard enough. I was just wondering if Oracle APEX 4.0 new features lists of Dynamic Actions, then why the same features are not available for other items/columns like the tabular form columns.

    DP
  • 4. Re: Dynamic Action on Tabular Form Columns
    721928 Newbie
    Currently Being Moderated
    Shijesh,

    Thank you for your assistance.

    I tried the first method.

    If the second column, second f02, is of the type datepicker then I can not type the date into the field, but I can still change the date using the calendar. Does not disable the field completely.

    DP

    Edited by: user4115675 on Aug 22, 2010 1:43 PM
  • 5. Re: Dynamic Action on Tabular Form Columns
    721928 Newbie
    Currently Being Moderated
    I would have to disable the datepicker pop up or make the pop up read only also, correct?

    Edited by: user4115675 on Aug 22, 2010 1:51 PM
  • 6. Re: Dynamic Action on Tabular Form Columns
    721928 Newbie
    Currently Being Moderated
    I disabled the datepicker pop up as following and it works
    $("#" +column_2_id).datepicker("disable");

    Thanks

    Edited by: user4115675 on Aug 22, 2010 3:02 PM
  • 7. Re: Dynamic Action on Tabular Form Columns
    782976 Newbie
    Currently Being Moderated
    hi,
    thax for ur solution....

    but the problem is ........

    its not execute when i add a row by tabular form select/popup lov item.....

    if can help plzzzzzzzzzzzz......
  • 8. Re: Dynamic Action on Tabular Form Columns
    jfosteroracle Newbie
    Currently Being Moderated
    I tried your JQuery approach below and I came close, but not quite there.

    I have an application where I have a tabular form and when field COUNT > 1, then I want to disable field LENGTH. Alternately, when COUNT <= 1 the enable field LENGTH.

    With Shijesh's jQuery approach below, using a dynamic action, I was able to disable my LENGTH when COUNT > 1. But if I change the COUNT to <= 1, then my LENGTH field stays disabled. I need it to become enabled once COUNT <=1.

    So I have the TRUE Action is working correctly, but not the FALSE action. This is the code for the TRUE action:

    column_2_id = 'f02_' + $(this.triggeringElement ).attr('id').substr(4);
    $("#" + column_2_id).attr( 'disabled','disabled');

    What would the code be for the FALSE action?

    Thanks!
    John

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points