Obtain / use value radio in Apex plugin for dynamic action button

Apex 4.2

I'm working on a plugin that you run a dynamic action based on the value of a selected option button. I think its more so the syntax that is causing me problems.

I have a point page (P127_DISPOSITION) reprsented as a group of radio buttons. There are three cases for the Group of radio buttons: CREATE, update, and THROW. The LOV source for the element on the page is:

STATIC2: create new Inspection; CREATE, update of existing Inspection; Updated, throw; IGNORE

I have a plugin that displays a map and a few other neat, tools and toolbars other clever tricks. When a user clicks on the radio button under the UPDATE, the card must hide some of these tools. This part is not so bad that I have the code for this. Here's what I or tried so far:

$("#P127_DISPOSITION").change(function() {
if ( $("#P127_DISPOSITION").val == 'UPDATE' )
$("#draw_point").hide();
$("label[for=\draw_point\"]").hide();
} else if ( $("#P127_DISPOSITION").val == 'CREATE')
$("#draw_point").show();
$("label[for=\draw_point\"]").show();
} else {
$("#draw_point").show();
$("label[for=\draw_point\"]").show();
}
});

The statements in the IF statements are not the problem. I tested and been using these statements in my plugin for other reasons. These statements just to show or hide the toolbar. But I'm doing this action happens dynamically on a radio button is selected. So I know there must be some problems in the way I use the onChange function or the statement real himself.

Any help on this would be greatly appreciated. Thanks in advance.

NewApexCoder

I don't think that your problem is with dynamic action, but how the html code that is generated when the plugin looks like.

If the generated html code is not a type of entry right front, you need to write your own javascript code that overrights the apex.item () .getValue (default).

To explain what I mean lets take a look at the native radiogroup and popup lov.

A radiogroup of point P40_DISPLAY_RETURN of the page html code looks like

Different display and return value


As you can see the element with the id P40_DISPLAY_RETURN is the set of fields. Because the set of fields is not a value attribute neiter $x('P40_DISPLAY_RETURN').value and $('P40_DISPLAY_RETURN').val)

the value will give you. Apex. Item ('P40_DISPLAY_RETURN'). GetValue() will return the C.

And for the lov contextual element P40_POPUP_LOV of the HTML page looks like


Now the P40_POPUP_LOV element is an input element, but the value is the value to display. So $x('P40_POPUP_LOV').value and $('P40_POPUP_LOV').val () will give you the display value ' OHare, Edward "Butch" While apex.item('P40_POPUP_LOV').getValue () returns the return value 4.

Take a look at the getValue for both javascript code, you see that the functions are actually different and depend on the widget that is the element.

getValue : function() {
  // get checked input value, in the context of the fieldset
  // note: can't use $lRadios here because this is a reference
  // to the initial state
  var lReturn, $lRadio;
  if ( pType === "checkbox" ) {
      // checkbox will return an array
      lReturn = [];
      $( ":checked", lFieldset).each( function() {
          lReturn[ lReturn.length ] = this.value;
      });
  } else {
      // radio group should return a single value
      $lRadio = $( pSelector + " :checked", apex.gPageContext$ );
      if ($lRadio.length === 0) {
      // check if the length of the jQuery object is zero (nothing checked)
      // if so return an empty string.
          lReturn = "";
      } else {
          // otherwise return the value
          lReturn = $lRadio.val();
      }
  }
  return lReturn;
}

Tags: Database

Similar Questions

  • APEX 5. Dynamic action on the CHANGE event does not work after applying the filter on IR.

    APEX 5.

    Dynamic action for the CHANGE event does not work after applying the filter on IR.

    Event: Change, selection Type: jQuery Selector, jQuery Selector: td [header = 'abc'] entry

    Real action

    Selection type: jQuery Selector, jQuery Selector: td [header = 'abc'] entry, Action: run the Javascript Code

    Is TI WHEREAS behavior?

    I know, I can work around this problem by using the Refresh event and javascript, but I prefer DA and if possible Change event.

    Concerning

    mdyla

    mdyla wrote:

    It is, how to force them reallocate dynamic Action in the event of CHANGE of the input elements after refresh of IR region.

    Set the dynamic scope of the event action to Dynamics.

  • Consult the Page element values in the dialog box confirm dynamic action

    Hello

    I can return values to the Page item in the dialog box confirm dynamic action.

    I have a dynamic Action and I using the Action - confirm to display the confirmation message. I'm trying to refer point Page P1_EMP_NO say in the Confirmation box as shown below.

    Action - confirm
    Text - * & P1_EMP_NO.* "test123".

    When I have to run so that a dynamic action, confirmation shows only 'test123', the value for P1_EMP_NO is not displayed.

    My question is that we can refer such values as described above OR is there any other way to do it.

    ----
    Thank you
    Deepak

    Hi Deepak,

    You can see no elements in the confirm dialog box.
    You will need to write your own javascript and refer to elements such as dialog box

    $v('P1_EMP_NO') 
    

    Kind regards
    Kees Vlek
    -----
    Company: http://www.orcado.nl
    Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
    Twitter: http://www.twitter.com/skier66
    If the answer to question please change replied and mark the appropriate post as correct / helpful.

  • Call for dynamic action of an interactive report

    Hello
    I'm on APEX 4.1, 11 GR 2, Windows 7 and the latest version of Firefox.
    I have an interactive report. I want the end user to have the ability to click on a link to line level and launch a modal pop up on another page. Ideally, I would like to be able to use the Skillbuilders plug-in. I can make it work if I just go the road full page but I can't find a way to make it work like a modal pop up.
    I have tried different methods, which work, but I think that I should follow that is using a page-level dynamic action that fires when a found JQuery element selector is selected.
    The problem I have is that I can't find the proper JQuery selector syntax for the column. My report has a static ID of the IDN and my column a header of PARTS.
    The best I can manage is not to see something happen as a page refresh (if the link is on the same page). I don't see no errors in console and firebug.

    I replaced the dynamic action modal page appeal by an alert, which is not displayed, to make sure that it is not the configuration of the plug-in which is the cause of the problem.

    Someone would be kind to give me an idea of what I should be completed in the JQuery selector field of the DA and what should be the attributes of link? Because I want to redirect from page 1 to page 2, what should I put in the other fields in link?
    I've been chasing my tail with this for hours and read all the posts in this area, I could find, but I can't make it work. Any help would be much appreciated.
    Kind regards

    Danny

    That's what I did on my column link of an international registration:

    Link icon: (choose something)
    Link attributes: class = "btndetails" onclick = "return false;"

    (the onclick is vital, it prevents the default anchoring action does not happen)
    Implement the details of the target page that you want in your popup modal

    Create a dynamic action

    Event: click on
    Selection type: jQuery Selector
    jQuery Selector: .btndetails

    Advanced > scope of the event: live

    Real action:

    Modal Skillbuilders page:
    Location of the URL: attribute of the triggering element
    Attribute name: href

    Who should appear in the page without problem. The onclick is the key here, and probably why you were chasing your tail so far.

  • APEX 4.0: Dynamic action problem when hiding point page

    Hello world

    I created a dynamic Action that shows/hides a page element.
    When hide it, if this page is a text box, object, which resizes texarea is still visible... as well as quickpicks (as appropriate).
    If point page corresponds to a date, and quickpicks, quickpick labels are invisible, but the commas that separate them are still visible. Fortunately, date picker icon is hidden.

    I hope this helps
    Oscar

    PS: Tested on apex.oracle.com using IE8

    Hi Oscar,.

    Thanks for this posting. This is a known bug (#9811411) with dynamic stock control show or hide an element of the page currently only the following:

    • The item itself (the input, textarea, etc.).

    • Any other standard compound element (datepicker, color picker icon, all the list items Manager, shuttle elements, etc.).

    • An element label, if defined in the standard way (tag with an attribute 'for' corresponding to the attribute 'id' elements).

    We do control however no other currently defined attributes in the element definition (pre / post text, quick pick item controls, control center, etc.).

    There is a fairly simple solution, and it is to check the box 'Yes' to the ' show / hide all elements of the page on the same line "in the"Setting"region in the actions of 'Show' and 'Hide '. This will control everything, but the limit that you should not have any other elements on page displayed on the same line, because these will be also shown / hidden by doing this.

    Sorry for this current issue, I hope that the workaround can be useful until we can fix.

    Kind regards
    Anthony.

  • APEX 3.2 - Dynamic Actions

    Hello

    I know that we can apply actions dynamic apex 4... can we do something similar in 3.2... Otherwise, what is the alternative...?

    Thank you

    Hello

    Dynamic actions are introduced on Apex 4 and there not something similar on Apex 3.2.

    But you can write your own JavaScripts. See for example this
    Apex 3.2 hook javascripts for IR and run the when the report is refreshed

    Kind regards
    Jari

  • Using libraries in BB Java plugin for Eclipse Java

    Hello

    I try to use the packages;

    java.awt.image.BufferedImage

    javax.imageio. *.

    in my BB program, but an error message says "import cannot be resolved. I tried to import files sourse JDK such as libraries, but rest the prblem and none of the objects of these classes work in my program.

    Help, please! Thanks in advance.

    With a quick Google, it seems to me that java.awt.image.BufferedImage is a java 2 Platform SE 5.0 (and above) class and javax.imageio is java 2 SE 6.0 and therefore they are available, or will be usable in a BlackBerry project java j2me.

  • How to forget the values of database in condition of dynamic action

    Hi all
    In my request for leave.
    Emp_name
    From_date
    To_date
    No_of_days
    Status
    I have two fields Date From_date and To_date in my form.
    I want to display the error if someone selected the From_date and To_date that has already been applied.
    For example,.
    If the employee employee already applied the leave.
    From_date: June 12, 2012 and To_date: June 15, 2012 and if it is stored in the database.

    If there still Ih tries to apply the dates between June 12, 2012 and June 15, 2012 I want to show the error message that are already applied in the selected dates, or alert

    For this, I tried action dynamic, is - it possible to the dates mentioned in a State of DA (in the list or not list) the dates of from_date and to_date the database?

    or what idea I can follow to verify this. ?
    Can someone give an idea?
    Thank you.

    Hello

    How can I insert the authorization information in your table? using process page?

    If this is the case, add a page-level validation. posting type must be 'function body of PL/SQl returning a Boolean.

    in the body of PL/SQL

    DECLARE
    
    ROW_COUNT NUMBER(1,0);
    
    BEGIN
    
    SELECT COUNT(*) INTO ROW_COUNT
    FROM TABLE_NAME
    WHERE FROM_DATE = :from_date AND TO_DATE = :to_date AND USER_NAME = :APP_USER;
    
    IF(ROW_COUNT >0)THEN
    RETURN FALSE;
    
    END IF;
    
    END;
    

    in the validation process, you can specify the error message to be displayed when validation fails.there you give the message that you want to.

    Published by: Apex-EPA on June 11, 2012 22:27

  • Management of errors for dynamic Actions (4.1.1)

    Hello

    I'm trying to create a function to handle all possible errors, but errors generated by DA are not fished.
    Is it possible to caught? How?

    My function is based on:
    http://www.inside-Oracle-apex.com/Apex-4-1-error-handling-improvements-part-1/
    http://docs.Oracle.com/CD/E23903_01/doc/ doc.41 /e21676/apex_error.htm#autoId4

    and I'm doing my tests in apex.oracle.com


    Thank you

    Hello

    Unfortunately this is currently not passing through the central error handling. It's something that we intend to set at the APEX 4.2.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

    Published by: Patrick Wolf on April 24, 2012 18:30

  • Several plugins using the same JS file dynamic action

    Hello

    (Apex 4.0.2)

    I created two plugins for dynamic action, say Plugin1 and Plugin2. These two plugins are most of the time used together, so to keep things simple and ease of maintenance that all the JS need to the code specific to each plugin as well as of the common code is in a single file, for example plugins.js. So I download the same JS file to each plugin.

    In the generated page, using two plugins the JS file is loaded twice, as planned. Of course, at Apex, they are two different files even if their content is exactly the same.

    This is not ideal for me. What is the approach suggested in this case? Always keep the JS separate files for each plugin? And on any common code plugins share, duplicate in each JS file?

    Thank you
    Luis

    Hi Luis,.

    apex_javascript.add_library currently does not allow to specify p_key as for example apex_javascript.add_on_load_code is. It automatically calculates the value of 'key' based on the directory and name. I'll add an enhancement request to allow to override this default that will allow both plug-ins use the same 'key' to just load the file once.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • 4.2: disorders plugin dynamic action

    I'm running into some problems with some plugins for dynamic action, I have created and are on apex.oracle.com and has stopped working since the 4.2 update.

    Here a small example configuration for a very simple example:
    < ul >
    < li > create new plugin, give it a name. Type: dynamic action < /li >
    < li > sources > PL/SQL Code
    FUNCTION test_render(
        p_dynamic_action IN apex_plugin.t_dynamic_action,
        p_plugin         IN apex_plugin.t_plugin )
    RETURN apex_plugin.t_dynamic_action_render_result
    IS
       l_retval APEX_PLUGIN.T_DYNAMIC_ACTION_RENDER_RESULT;
       l_crlf        CHAR(2)      := CHR(13)||CHR(10);
       l_fetch_delay INTEGER      := p_dynamic_action.attribute_02;
       l_char_amount INTEGER      := p_dynamic_action.attribute_03;
    BEGIN
       IF apex_application.g_debug
       THEN
          apex_plugin_util.debug_dynamic_action(
             p_plugin         => p_plugin,
             p_dynamic_action => p_dynamic_action 
          );
       END IF;
       
       apex_javascript.add_library(
          p_name      => 'init_test_script',
          p_directory => p_plugin.file_prefix,
          p_version   => NULL
       );
    
       l_retval.javascript_function := 'function(){init_test();}';
       
       RETURN l_retval;
    END;
    < /li >
    < Li > reminders > make the name of the function
    test_render
    < /li >
    < li > no attributes Standard only checked < /li >
    < li > no custom attribute defined < /li >
    < li > a file, "init_test_script.js".
    function init_test(){
       //creating of the date filter fields
       var l_table = 
       $('<table id="testtable">' +
         '   <tr>' +
         '      <td align="right"><label for="test_item_1">Test Item 1</label></td>' +
         '      <td align="left"><input type="text" id="test_item_1" /></td>' +
         '   </tr>' +
         '   <tr>' +
         '      <td align="right"><label for="test_item_2">Test Item 2</label></td>' +
         '      <td align="left"><input type="text" id="test_item_2" /></td>' +
         '   </tr>' +
         '</table>'     
         );     
         $("div#appendsomethinghere").html(l_table);
    };
    (Not the material code much.)
    < /li >
    < /ul >

    < ul >
    < li > now create a new blank page. < /li >
    < li > creates a region HTML, source:
    <div id="appendsomethinghere"></div>
    < /li >
    < li > create a new dynamic action, event: the Page's Load
    Real Action: the test plugin < /li >
    < /ul >

    Now, I expect to have the html code inserted into the dom when loading the page. However, I'm getting errors (surprise), and on the line that includes my action dynamic javascript_function.
    Line: 96
    Error: Object expected
    opening in the console
    object expected f? p = 4000:RUN_PAGE:10169672371307:BRANCH_TO_PAGE_ACCEPT:NO:FB_FLOW_ID, FB_FLOW_PAGE_ID, F4000_P1_FLOW:54687, 55, 54687, character of the 96 142 line
    is here:
    93   <script type="text/javascript">
    94   apex.da.initDaEventList = function(){
    95   apex.da.gEventList = [
    96   {"bindEventType":"ready",actionList:[{"eventResult":true,"executeOnPageInit":false,"stopExecutionOnError":true,javascriptFunction:function(){init_test();},"action":"PLUGIN_TESTPLUGIN"}]}];
    97   }
    98   </script>
    It seems as if the javascript file isn't there, even though I see the inclusion in the html code:
    <script type="text/javascript" src="wwv_flow_file_mgr.get_file?p_plugin_id=940791031207478253&p_security_group_id=27000294100083787867&p_file_name=init_test_script.js"></script>
    Even when I try to call
    init_test();
    from the console, I get the same error.

    When the same configuration is created in 4.1.0 it all works as I'd expect.

    Anyone with any ideas or light on this?

    Hi Tom,

    It was actually the error of interest

    Uncaught SyntaxError: Unexpected token ( /pls/apex/wwv_flow_file_mgr.get_file?p_plugin_id=940791031207478253&p_security_group_id=27000294100083787867&p_file_name=init_test_script.js:1
    

    that was displayed in the Chrome developer tools.

    The reason was the function declaration

    function() init_test{
    
    -> Uncaught SyntaxError: Unexpected token (
    

    It should be

    function init_test() {
    

    I have fixed your plugin init_test_script.js JavaScript file and now everything works fine. Are you sure who has worked at the APEX 4.1? Because it is a JavaScript error and has nothing to do with the APEX.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • using s condition for the execution of a java script with dynamic action

    I use the universal theme of apex 5 I have a form and I needed his label to be changed dynamically

    I used the following code to change the name of the field.

    $('label[for="P458_COMPANY"]').html('INSTITUTE/SCHOOL/COLLEGE');

    I used the loading of the page as dynamic action.

    the two mvisible and mid are oracle functions. .mvisible returns a Boolean result.

    And I need JavaScript to be triggered when the following function returns true...

    If mvisible (mid ()) = true then

    $('label[for="P458_COMPANY"]').html('INSTITUTE/SCHOOL/COLLEGE');

    end if;

    How can I get this done... In page load status?

    Or should I change the java script code.

    All information must be assessed

    Tell you that mvisible (mid ()) is a javasript function?

    Where it is then please try this:

    The status of PL/SQL can be deleted.

    The event is not what is important in this regard.

    Kind regards

    Tobias

  • ORA-01461: can bind to a LONG value only for insert into a LONG column of dynamic Action

    I try to apply the condition to display items in a table with the following error code.its dynamic action when him save the day.

    event: click on

    Selection type: button

    name of the button: P23_ADD_MORE_ROW

    condition: no strings attached

    //P23_NAME_BY_CAT,P23_HOW_MANY as LOV  in apex form
    var l_no_rows;
    l_no_rows = apex.item("P23_HOW_MANY").getValue();
    for (var i=0; i<l_no_rows; i++){
      apex.widget.tabular.addRow();
    
    if  ($v("P23_NAME_BY_CAT")==1) {
    $("#WORK_QTY").show();
    $('td[headers=WORK_QTY]').show();
    $("#WORK_LOCTION").hide();
    $('td[headers=WORK_LOCTION]').hide();
    $("#MY_LOCTION").hide();
    $('td[headers=MY_LOCTION]').hide();
    //with morethan 25+ entry
    }
    else if ($v("P23_NAME_BY_CAT")==2) {
    $("#WORK_QTY").hide();
    $('td[headers=WORK_QTY]').hide();
    
    $("#WORK_LOCTION").show();
    $('td[headers=WORK_LOCTION]').show();
    
    $("#MY_LOCTION").hide();
    $('td[headers=MY_LOCTION]').hide();
    //with morethan 25+ entry
    }
    else if ($v("P23_NAME_BY_CAT")==2) {
    $("#WORK_QTY").hide();
    $('td[headers=WORK_QTY]').hide();
    $("#WORK_LOCTION").hide();
    $('td[headers=WORK_LOCTION]').hide();
    
    $("#MY_LOCTION").show();
    $('td[headers=MY_LOCTION]').show();
    //with morethan 25+ entry
    }
    else {
    alert("no  count");
    }
    };
    
    

    dynamic action above can ignite if you level column, it means when I choose LOV value so that specified columns will show only rest in a column will be hidden. up to 10 input works fine.

    Hi Ramani_apex,

    Is the action of javascript executed in the dynamic action of the code you posted above or more code?

    You seem to have exceeded a 4000 or 32 K bytes on a column of metadata for dynamic action when you set the dynamic action.

    function f_mybuttonAction () {
    //P23_NAME_BY_CAT,P23_HOW_MANY as LOV  in apex form
    var l_no_rows;
    l_no_rows = apex.item("P23_HOW_MANY").getValue();
    for (var i=0; i
    
    • Call the action javascript function run the dynamic action javascript code:
    //mybutton action
    f_mybuttonAction();
    

    Reference:

    I hope this helps!

    Kind regards

    Kiran

  • dynamic action sets the value of the element, but not save to DB on submit

    I'm working on a page where the value of several to show only the page elements are defined using a dynamic Action.  They are set when the user selects a value in a list of selection (and is based on the value of the selection list).  Dynamic action is triggered on a list selection change event and then runs the real action "set the value.  The selection list displays the names of sales representative.  The three fields dynamically filled are the org structure (that is, their chain management).

    For the action to set the value, I use a defined Type of SQL statement:

    Select VP, DIR, MGR

    of SALES_ORG where SSR =: P20_SSR

    In the affected elements, I have fixed Type of selection to the 'item (s)"and the value of the Item (s) for 'P20_GVP, P20_DIR, P20_MGR.

    Dynamic action works fine for the display of the page (that is, when I select a sales representative in the selection list dynamic action properly updated only display value fields three).  This page is a form in which the user submits information relating to the rep.  When the page is sent, all fields are filled in a new record of DB with the exception of three that were populated dynamically above.  These fields get the values NULL.

    When the dynamic action updates the values in the three fields is - it does not set the value of session?  Why these fields don't are not taken into account in the submit other ideas > process Page?

    I use 5 APEX with Chrome on Mac (Yosemite).

    Thanks for the note.  I didn't only display the items could not be used in this way.  I think I'll take a different approach with the design; given that the org structure is in another table that I can simply refer to that by rep when necessary rather than saving the information uploaded to the page of the form.  The reason why I have not fill the screen only the points of loading the page is because I don't know what the values should be until the user selects a sales representative in the selection list.

    I'll change the design to one of the following:

    1) change the display only items of standard text field.  NOTE: if I make the text read-only field that causes other problems when loading (I get the message "violation of protection Session state").

    OR

    2) do not include org structure in the download folder and just refer to table org Rep when necessary.

    Thank you!

    Steve

  • Dynamic action based on the value in a table

    Greetings,

    I would like to use a dynamic action to disable a button depending on the value selected/entry in a field in tabular form. Thus, for example, if someone enters the value "LKSG", then a button is disabled (in this case, the 'Add Row' button).

    How I would do this using the tools of dynamic measurements? When I create a dynamic action, I see that my choice of Type 'selection' for dynamic action of shooting is point, area, button, object DOM, jQuery Selector. I don't know how to use a field in a presentation of tabular to firing. Or if it is possible.

    I use APEX version 4.1.1.00.23

    Thanks in advance!

    John

    jfosteroracle wrote:
    Tom - it's very useful! A few questions:

    -J' use a 'button of the model '. To use the static code for the button, I see that the model must include the #BUTTON_ID # in the model. I added the #BUTTON_ID # in the template like this:

    #LABEL#

    Where is the the BUTTON_ID should go, in the

    ?

    After adding this, it does not for a button of the model. But if I change the touch of a button HTML, your method works great!

    It is of course the difference between the two buttons: how they react and, above all, how they are marked upward. An HTML button is a real