With the help of JavaScript condition in the dynamic action of JQuery selector

Hi guys,.

I have a Setup master detail on a page.

The detail section, I have a tabular presentation.  One of the fields is a selection list.  The first record in the select contains the value * not * that has a value of primary key for the 1.  I have a distinct region with a simple text field where the user can insert a value into the table if the value does not exist.

I want than the region of text element to only appear if the value * not listed * is selected.

I managed to make it work when the value is selected with the help of dynamic action with a bit of JQuery and JavaScript by setting the ID on the selection list to 'create' and have the following in JavaScript $(this.triggeringElement) .val ()! = 1 in the JavaScript for dynamic action condition shows it or hides the region of 'create' and that works well.

However, if the secondary table is empty before the detail records were created (nothing selected in triggering jQuery Selector) the region of create is displayed when I don't want it.

I guess I need some sort of NVL in JavaScript condition?

I use APEX v4.2.

Any advice would be appreciated.

Chris

Cashy wrote:

I have a Setup master detail on a page.

The detail section, I have a tabular presentation.  One of the fields is a selection list.  The first record in the select contains the value * not * that has a value of primary key for the 1.  I have a distinct region with a simple text field where the user can insert a value into the table if the value does not exist.

I want than the region of text element to only appear if the value * not listed * is selected.

I managed to make it work when the value is selected with the help of dynamic action with a bit of JQuery and JavaScript by setting the ID on the selection list to 'create' and have the following in JavaScript $(this.triggeringElement) .val ()! = 1 in the JavaScript for dynamic action condition shows it or hides the region of 'create' and that works well.

However, if the secondary table is empty before the detail records were created (nothing selected in triggering jQuery Selector) the region of create is displayed when I don't want it.

I guess I need some sort of NVL in JavaScript condition?

I use APEX v4.2.

Simple solution is to hide the region containing the element of text by default, using the style = "" view: no ' in the property of the attributes of the area in the region. " It will be always hidden when the page initially, but its visibility will be controlled by the DA subsequently.

Tags: Database

Similar Questions

  • Navigation of the page with the dynamic action button.

    Hi all

    I use apex 4.2.6 on windows 8.1

    I create a button with the dynamic action.

    When the end user, click on the button, I want to access a page.

    How to do this?

    I created a branch of this button to access the page 10 on SUBMIT AFTER TREATMENT CALCULATION VALIDATION.

    but no navigation happens.

    they code plsql works well that is put into the dynamic action, but the page is not navigate.

    kindly guide me.

    Kind regards.

    Maahjoor wrote:

    I create a button with the dynamic action.

    When the end user, click on the button, I want to access a page.

    How to do this?

    I created a branch of this button to access the page 10 on SUBMIT AFTER TREATMENT CALCULATION VALIDATION.

    but no navigation happens.

    they code plsql works well that is put into the dynamic action, but the page is not navigate.

    If you want to run the PL/SQL code and creates a branch to another page, why do you use a dynamic action? The easiest way to do this is the button send page, the PL/SQL to run as a process after submit (potentially conditional, click on the button) and the page navigation to achieve using a plug (once again, perhaps conditional on the button that is clicked).

  • A collapsible region with the dynamic Action of the collapse

    Hi all

    in my Apex 5.0 - application, I have a button that shows a masked area when you press. I wish also that the current developed a collapsible area collapse when this button is pressed. Since collapse a collapsible region is not native as a dynamic action I must find a custom way (JavaScript) to do. Anyone know the best way to do this?

    Kind regards

    Arjan

    Hi Sunil,

    Thanks for your reply. I already found a solution, just a JavaScript code very simple:

    document.getElementById("div1").classList.remove("is-expanded");

    document.getElementById("div1").classList.add("is-collapsed");

    Thanks anyway!

    Best regards, Arjan

  • Can we add this type on the Windows Server that comes with the Microsoft Action Pack subscription?

    Can we add this type on the Windows Server that comes with the Microsoft Action Pack subscription?

    Hello

    The question you have posted is related to professional level support. Please visit the link below to find a community that will offer in support of your request:

    http://social.technet.Microsoft.com/forums/en/category/WindowsServer

  • Cannot perform the insert/update on the form of tables, due to the dynamic action

    Hi all

    I created a dynamic action that calculates multiple cells in a table.

    This feature works well, when I change the value of the associated cell then the computed value is changed by the dynamic action.

    But I am not able to insert or update the line in a table when the dynamic action is enabled. When I put the condition 'Never', then the line is inserted or updated without any problems.

    All guess where is the problem?

    Apex version: 4.1.1.00.23

    Jiri

    Nina wrote:

    I don't know why the 123,40 value (or other) is set to the next item in line (f09, fsc, etc.)
    >

    What is hidden and generated Apex elements are always included in the last cell (td) of the line. Thus, it has nothing to do with the next item, only the last cell.
    If you see the last cell of the 888 Page you will see probably the same type = "hidden" entries here also.

    Your problem is not related to the HTML fragment to the last cell in the row showing all those extra items, it's somewhere else.

    Oh, here comes the jQuery selector:

    var clickedRow = $(this.triggeringElement).closest('tr');
    
    $(clickedRow).children('td[headers="SAL"]').find("input").val(myCalculatedTotal);
    

    SAL, COMM, w/e. here you will find the TD with headers = "COMM" and all the input fields and the value of all the entries in total calculated. Your selection is not precise enough in this case.
    So, target the specific entry.
    With the code example:

    
    
    
    
    
    
    
    
    

    change the switch on

    $(clickedRow).children('td[headers="SAL"]').find('input[name="f08"]').val(myCalculatedTotal);
    
  • Confirm the dynamic action does not not as expected in the APEX 4.2.5

    This looks like a bug in APEX 4.2.5.  I have a page with a "Cancel" button that redirects to another page.  There is a dynamic action that fires on the button with a confirmation action and the text ' are you sure?  However, if the user selects OK or cancel in the confirmation dialog box makes no difference - the redirect is always performed.

    I found this question after the migration of a page that worked to 4.1.1-to-4.2.5.00.88 APEX and were also able to replicate on apex.oracle.com here:

    https://Apex.Oracle.com/pls/Apex/f?p=19896:2

    (Press the Cancel button in the top right of the page redirects to page 1, regardless of the user's response to confirm the popup.)

    I don't need someone to suggest the alternative code, I know how to build my own confirmation processing.  I want to just raise this as a bug as possible and see if there is a solution to make the dynamic action works as it should.

    NB I found this in the patch notes for 4.2.5.00.88 on a fix for a similar problem:

    http://www.Oracle.com/technetwork/developer-tools/Apex/application-express/Apex-425-patch-set-notes-2186274.html

    15984978

    Dynamic action front-Submit with a confirmation message does not

    Hi Tony,.

    I think the problem is that the action of the button is defined as 'Redirect page in this Application', but it must always be "defined by the dynamic Action" as soon as you have set dynamic actions 'click' to a button. Normally, which is automatically changed as soon as you create your first dynamic action of a button, and I just confirmed by creating a test button in your application that has been defined as «Redirect...» ». After that I created a dynamic action the action of the button is set to "defined by the dynamic Action.

    Is it possible that you have modified the action of the back button to «Reorient...» » ? The question why «redirect...» "does not work, it's that we cannot guarantee in what order the browser will process click on events defined with onclick in the tag button itself and those events attached as a click event handlers. This is why it is necessary that everything is defined as dynamic actions. Only in this case you will be able to cancel the treatment.

    Concerning

    Patrick

    Member of the APEX development team

    My Blog: http://www.inside-oracle-apex.com

    APEX Plug-Ins: http://apex.oracle.com/plugins

    Twitter: http://www.twitter.com/patrickwolf

    Post edited by: Patrick Wolf

  • Redirecting to a page after the dynamic action

    I stated a dynamic action of a button (its dynamic action of pl/sql). After its been pressed it fills a line in a table.

    I want to redirect it to another page, once completed the dynamic action. How can I do?

    PL/SQL D.A. have an indicator expected result, make sure that is selected.

    Then, action of true of JavaScript:

    Window.Location.href = ' & APP_ID.: 1: & APP_SESSION. :::'

    or simply add a real action of page submit and manage the re - run by a branch of the page?

  • Redirect button AND perform the dynamic action

    Hello

    I use Oracle 11 g and Apex 4.2.2

    It could be a matter of beginners (but that's what I'm ;-)) but I'll ask anyway.

    I created a button and can "redirect to the Page in this application" in the section "Action when the button clicked" or select "defined by the dynamic Action."

    Is there a way to select "Redirect."... "AND run the SQL Code?

    This is exactly the situation that I was considering. You start at the apex (which means don't not offensively or anything like that) and so the concept of session state can still be fresh for you. Telling me where you're just complicates things for yourself.

    Why do you, or makes you think, that you need to run plsql in dynamic action first and then redirect the page?

    Running code plsql already involves tracking session state and would require the value of the required items on the server. Running WHAT PLSQL is on the side server, if a call should be made. Given that you want to redirect afterwards, the call should happen synchronously, IE make the browser wait the result in order to continue to the next step. A redirect will just tell the server to send the new page to you.

    So why would not just use a send page? A page sent will submit all values of item on the server and thus session state. You can use the values of calculation and validation processes and never worry about having properly put it. You can filter out inappropriate process etc. According to the values of query (for example submit) so no problem there. Finally, a branch should redirect you to the target page. Remember, a branch is a part too and is essentially a redirect server-side. Find yourself on your new page without problem really and just send 1 page (send page, get another back essentially).

    That said, I simply don't consider a dynamic action. It is useless to laregely here and creates more problems than is useful to review more.

    What you have now is to redirect the client to another page, but in the process, you have lost everything from the original page. No values are stored in the session to all State: no save manual to submit State or session page. Add the element to the redirect link doesn't work either, as the link is built during rendering and is not dynamic (so no ' regenerated' link when you click it).

    Again, I advise you to:

    -put the button to send the page

    -create a process after you submit and run your plsql code

    -create a branch to a point after the process and set it to redirect to the target page

    or

    -put the button to send the page

    -create a branch set up to redirect to the target page

    -create a process on the target page and run your plsql code (but be aware that it may have to be executed conditionally)

    There are several traps on session state, so when you feel better grasp it. Page submits are not all that bad.

  • application of the hierarchy with the dynamic start condition

    Hello

    I have a table that stores line items (foohierarchy) and other storage users and items (useritems). Unfortunately, it is not consistent and is missing some entries. I would like to correct this using pure sql. Fixing here means that a user who has a certain child element must also have parents of this child. However, there are a few obstacles here. First the hierarchy table does not explicitly which elements are higher level items. I'm trying to fix this by emulating an adequate structure and named this fixedhierarchy. A select statement that returns only designed relations users/article would be nice.
    Here a few visualization and sample data, sample data follows the model that each element uses its level that its suffix, but this should not be exploited in the statement:

    art of ASCI:
    -- A1 (peter,paul)
    --   \_ B2
    --   \_ C2
    --        \_D3 (thomas)
    --            \_X4
    -- E1
    --   \_F2
    -- G1
    --   \_H2 (heidi)
    examples of data
    drop table foohierarchy;
    drop table useritems;
    
    create table foohierarchy (
    child_item varchar2(30),
    parent_item varchar2(30));
    
    
    insert into foohierarchy values ('B2','A1');
    insert into foohierarchy values ('C2','A1');
    insert into foohierarchy values ('D3','C2');
    insert into foohierarchy values ('X4','D3');
    insert into foohierarchy values ('F2','E1');
    insert into foohierarchy values ('H2','G1');
    
    create table useritems (
    username varchar2 (40),
    item varchar2(30)
    );
    
    insert into useritems values ('peter','A1');
    insert into useritems values ('paul','A1');
    insert into useritems values ('thomas','D3');
    insert into useritems values ('heidi','H2');
    
    commit;
    my attempt at fixing the hierarchy table
    with fixedhierarchy as
    (select parent_item,child_item from foohierarchy
    union all
    select distinct null parent_item,parent_item child_item from foohierarchy where parent_item not in (select child_item from foohierarchy))
    select * from fixedhierarchy;
    Which should return to select it:
    'peter'|'A1'
    'paul'|'A1'
    'thomas'|'A1'
    'thomas'|'C2'
    'thomas'|'D3'
    'heidi'|'G1'
    'heidi'|'H2'

    Hello

    Thanks for posting the CREATE TABLE and INSERT statements; It's very useful! Don't forget to mention which version of Oracle you are using. This is especially important with the predetermined; all versions since Oracle 7 had significant improvements in how to handle them.

    I'm kinda comfused about what you want. Are you trying to permanently change the tables? If so, show what the changed table should look like when the work is completed. After the release, you do not want to see of "SELECT * of useritems;" or "SELECT * FROM foohierarchy;", or, if you want to change the two tables, both.

    Looks like you have two distinct problems:
    (1) change foohierarchy, so that each item appears once as a child_id. That means add lines with NULL parent_item for all the roots ('A1', 'E1' and 'G1'). The query you posted seems oriented toward it.
    (2) denormalization useritems, so that when a user name is bound to an element, the user name is linked to all this that the ancestors of the element, too. Results you posted seem to be what you want useritems to look after that.

    Here's how to do these things:

    (1) change of foohierarchy


    The query you posted seems good. Do you see anything wrong with it? You can use this query (or something very close to it) in an INSERT or MERGE statement.
    If you just want to add some new lines to foohierarchy, you need not Union: just the second part of it. If you are sure that none of these lines already exist in foohierarchy, then

    INSERT INTO foohierarchy (parent_item,      child_item)
         SELECT DISTINCT   NULL,          childitem
         FROM     foohierarchy
         WHERE     parent_item     NOT IN (
                             SELECT      child_item
                             FROM     foohierarchy
                               )
    ;
    

    If some of the roots may already exist in foohierarchy correctly, then you will like something in the WHERE clause to make sure that you n '; t add a duplicate. A MERGE statement can do better than the INSERT.

    (2) useritems denormalization


    This adds new lines at useritems, to make it look like what you have posted:

    ERGE INTO     useritems     dst
    USING (
         WITH     all_ancestors     AS
         (
              SELECT     CONNECT_BY_ROOT child_item     AS descendant
              ,     parent_item               AS ancestor
              FROM     foohierarchy
              START WITH     child_item   IN     (
                                       SELECT     item
                                       FROM     useritems
                                  )
              CONNECT BY     child_item   = PRIOR parent_item
         )
         SELECT DISTINCT
              u.username
         ,     a.ancestor
         FROM     all_ancestors     a
         JOIN     useritems     u  ON     a.descendant     = u.item
          )                    src
    ON     (     src.username     = dst.username
         AND     src.ancestor     = dst.item
         )
    WHEN NOT MATCHED THEN
         INSERT     (dst.username,     dst.item)
         VALUES     (src.username,     src.ancestor)
    ;
    

    After doing this, ' SELECT * from useritems; "will produce this output:

    USERNAME   ITEM
    ---------- ----------
    paul       A1
    peter      A1
    thomas     A1
    thomas     C2
    thomas     D3
    heidi      G1
    heidi      H2
    

    Here's how it works:
    All_ancestors of the subquery is a bottom-up CONNECT BY query, connecting each node in useritems with all his ancestors. CONNECT requests are often slow in the best of circumstances; do a join in a query CONNECT BY makes it even slower. It is more effective to CONNECT BY query first, in a subquery and then join tht game results at the other tables, like I did in src.

  • How the dynamic Action to update several items based on a JavaScript Expression producing a table?

    Using APEX 4.2.

    I have the list of selection using a LOV which returns a display value and a value separated by a comma e.g. return 'reserved to items' and "66,88" or "Available items" and "90,23".

    I want that return values for example "66,88" to be assigned to two my form fields.

    I have a dynamic action that fires when the field with the changes of the list/select-LOV. I am using an action of 'Set value' and set 'Expression JavaScript' with the expression itself type value ' $v("P1_MY_SELECT_LIST").split(",") and using Type "Article (s)' selection and listing the two points that I want to set as the items in question (from the description of the JavaScript expression field it appears that a table of the results would be assigned to the changed items , in the order.

    However, the original value of the LOV return value is passed to the first of the elements concerned (complete with the comma if the original return value was of the form '10')

    If I add more REAL action of the JavaScript "alert (" HELLO "+ $v ("P1_MY_SELECT_LIST") .split (", ") [0] +" WORLD "+ $v("P1_MY_SELECT_LIST").split (", ") [1]" ") I * see two expected values.»

    Any ideas what I could do wrong?

    The action 'Set value' affects the value specified to all affected elements: a value to one or more items. To set a different value at different points, you need several actions "Set value", or simply use javascript to do it in one.

    Even if you use a javascript expression that corresponds to a table, the table is just being converted to a string again. It creates a mapping of some sort. That is why for example with '10', she also translated as such. Actually you set this value to these two elements: ' 10, ".split(",").toString () (implicit in the chain of course).

    The code makes it very obvious that it doesn't handle values, as described in the help of the element. Aid is not correct or is the implementation simply not here yet?

    Just look at the javascript for dynamic actions, images/libraries/apex/dynamic_actions.js, service da.setValue directory file:

        function _setValue( pValue ) {
            lAffectedElements$.each( function( i ) {
                // Set all affected elements to the value passed
                $s( this, pValue, null, lSuppressChangeEvent );
            });
            /* Resume execution of actions here and pass false to the callback, to indicate no
            error has occurred. */
            da.resume( lResumeCallback, false );
        }
    

    And when you use a javascript expression:

        } else if ( lSetType === "JAVASCRIPT_EXPRESSION" ) {
            _setValue( lJavaScriptExpression.call( this ));
    

    It's pretty simple. (and this is checked on apex 5. It's the same on 4.2)

  • BlackBerry Smartphones Blackberry Desktop Software freezes with the message "Action Engine loading Configuration.

    I have Windows 7 Professional. My Outlook profile is stored on an Exchange Server and my Blackberry had previously beeng synchronization with Outlook in this configuration for nearly a year without problem.

    Recently, the software freezes the message 'Engine Action loading configuration' and is unrecoverable. I tried the following things to remedy the situation:

    (1) adjust the settings Organizer not to synchronize anything except the date & time. Still happens

    (2) remove all data from the device using Desktop software and try to resynchronize. Same problem

    (3) uninstall and reinstall Blackberry Desktop Software and try to sync with all of the original data and the empty deleted data Blackberry. The same problem.

    (4) tried to wipe off the full blackberry using Cmdr of JL, reinstalling the operating system. In this scenario, I can synchronize addresses, but once I sync calendar problems from ever happening and I can't ever sync it again (including later by deselecting the option of calendar.

    At that time I spent hours scouring Google for help and try the above items. This was a disaster for me because I rely on synchronization had given for work and have already from lack of things.

    I do not think there is something wrong with the Blackberry, because it works very well and works perfectly well after re - charging a fee, OS, etc.

    I tried to play with the balls of support, but because the software freezes before can synchronize calendar, there is nothing in the log that indicates if there is a file corrupted in the event calendar. Nothing won't change significantly in my calendar between synchronization worked and the day that he didn't.

    I tried searching the Blackberry forums and have found some info, but nothing useful. RIM does not provide phone numbers and support AT & T has continually demonstrated himself as worthless during my time with them.

    Are there resources left at all that I could try to move beyond this issue, don't waste any more time and be able to solve the problem?

    Thanks for reading and for any input that you are willing to offer.

    Although no one helped me with this I could help I put the steps that I followed down here so that if someone comes on this page of our friend Google, they will be able to try the same thing:

    I ran 'Fix' on the memory card in the Blackberry
    Ran CCleaner on my PC to clean the registry
    Reset synchronization in the Desktop Manager settings

    Finally finally I'm the synchronization again.

  • The dynamic action of javascript

    Hello

    Good evening.

    I am aware, that we can trigger dynamic actions in multiple ways, based on events of the DOM.

    can someone help me triggering a dynamic javascript action.

    But not based on events.

    Ex: name action dynamic, based on its name or sequence or in any other way.

    There are situations where I have to call dynamic measures to avoid hand-written Ajax calls.

    Thanks in advance

    Hello

    The correct answer to this post:

    Not sure why the following code lines failed to trigger a dynamic action

    $("#P0_SIGNAL").val (123) .changes (); --Also failed
    $("#P0_SIGNAL").trigger ("change");  --Also failed

    This line would trigger a dynamic javascript action.
    Apex. Event.Trigger ($("#P3_TEST_ID"), "change","" ");


    Steps to make it work.


    I need to trigger a dynamic action when a value is set to hidden JavaScript element


    P3_TEST_ID is a hidden item.

    Create a dynamic action to shoot the P3_TEST_ID change event.

    Setting the value of p3_test_id of javascript wouldn't trigger a dynamic action.

    Run the following code to fire the javascript DA

    Apex. Event.Trigger ($("#P3_TEST_ID"), "change","" ");

  • Problem with the stop action

    Hello...

    I have a prblem makes me Mad... not really professional to the whip, I'm just beginning so I guess it's normal... Here's my number...

    I have the timeline with an animation, what I do is an entire website with pages on different frameworks... So far I put to the top of the intro page, everything works fine... I started to make buttons for navigation, the problem is, when I put a stop on the 1st action framework... the introduction clip no longer plays, but the button works fine and takes me to framework x with different content, so I tried to change and put the stop at the end of the opening sequence action What then happens is the introduction plays ok and stops but the button does not take me more search framework...

    I don't know if it can be of any help, but in case here is the action script that I use:

    btn_home.addEventListener (MouseEvent.CLICK, accueilliens);
    function accueilliens (e:MouseEvent): void
    {gotoAndStop (65);}
    }

    Could someone please help me understand what I am doing wrong? Thanks in advance

    Looks like you have more than one keyframe for the keys.  When you have a new keyframe, any code that has been assigned to the buttons must be reallocated.  If you have buttons on their own layer and not interrupt that their with new images keys, then you don't have to assign a code for them once.

  • Validation against the dynamic Action

    Hi all

    I have a Submit button which is dynamic in Action, when we click on this button, that pl/sql code is executed.

    Also, I wrote a validation on text box saying that it can not be null. But when I press Submit button dynamic action only to run but not Validation.

    Here is the page, it includes two regions, first region button does not have a dynamic Action, so it is prompting validation error, where, as the second region button is not. Help, please

    https://Apex.Oracle.com/pls/Apex/f?p=9055:2:3349793619276:

    Workspace: KUMAR82

    User: Kumar62

    Pass: Kumar #1

    Thank you

    Kumar.

    Hi Kumar62,

    Kumar62 wrote:

    I have a Submit button which is dynamic in Action, when we click on this button, that pl/sql code is executed.

    Also, I wrote a validation on text box saying that it can not be null. But when I press Submit button dynamic action only to run but not Validation.

    Here is the page, it includes two regions, first region button does not have a dynamic Action, so it is prompting validation error, where, as the second region button is not. Help, please

    Check your 9055 Application-> Page 2. Your problem is solved for the button 'submit for approval '.

    Here are the changes made on page 2:

    • Added real action in your dynamic action to send the page with the query 'SUBMIT' with the following settings:

    Action: Send the Page

    Application/button name: SUBMIT

    See the process facility: No.

    Note: Postings are only performed after the page. The release of DA button was running just your logic, but in order to process the postings you submit page.

    • Changed condition for validations:

    Condition of removed the "when Button Pressed" and game

    Condition type: request = Expression 1

    Expression 1: SUBMIT

    Kind regards

    Kiran

  • Show / hide the dynamic Actions does not work in Windows 7 IE10 and APEX 4.2.1

    Hello

    I have a page in the APEX 4.2.1 reactive Blue theme, where show or hide page elements based on changes to other page elements and their values, in terms of JavaScript expression.

    It's that everything works well in Chrome 31.0.1650.63 m and 25.0.1, Firefox but not Internet Explorer 10. I thought it might be linked to this solution to the problem of Ajax IE10 | Code of Jason and tried their recommendation, but appears not to have contributed.

    Help please!

    Thank you

    Alex.

    I found the problem and it was my fault. One of my dynamic actions using JavaScript expression conditions was missing quotes in $v ("P1_ITEM1"), breaking the rest of the related JavaScript code. Chrome and Firefox did not care, but IE seems to be less tolerant of mistakes like that.

    Scott, thanks anyway. It is useful to know that I have that option as well.

Maybe you are looking for