Application Express :: Updating APEX Collection Via JavaScript?
Aug 1, 2012
Note, I'm using APEX 4.1.1
The scenario is that I have tabular form that was manually created from a collection; the collection name is "COMPANY"
Within this tabular form, I have number of selection lists (apex_item.select_list) and for each, I fire off a JavaScript based on the "onchange" event (e.g.,'onchange="updateCollection(' || seq_id || ', 10, this.value)"'); updateCollection is a custom function I created. Right now, all it does is alert me with the specifics of the of the selection list. As a further example, if I select "Google" from the selection list, sequence id would be "1", attribute number would be "10" and attribute value would be "Google"
Within this JavaScript, I would like to update the value of this associated element in the "COMPANY" collection. Ideally, I would like to directly call this:
APEX_COLLECTION.UPDATE_MEMBER_ATTRIBUTE(p_collection_name => "COMPANY", p_seq => 1, p_attr_number => 10, p_attr_value => 'Google') but I could not figure out how to do this.
I've created a system for managing football within APEX and it is at a stage now whereby the user can view any number of the tables through Reports and insert data into these tables through Tabular Forms. Its using triggers and sequences to allow for new primary keys to be generated each time within these Tabular Forms so I'm at a stage now where I'm really quite pleased with it..
The last thing I'm needing to do now is have it update certain fields when certain records are entered.
club1 (clubId foreign key from clubs table) club2 (clubId foreign key from clubs table) club1goals (the amount of goals, type Number) club2goals (the amount of goals, type Number) club1points (points earned, Type Number) club2points (points earned, Type Number)
When filling out a result, the user will enter the following (as an example):
club1 - 1 (club with ID, 1) club2 - 12 (club with ID, 12) club1goals - 2 (the first club scored 2 goals) club2goals - 0 (the second club scored 0 goals) club1points - 3 (the first club picked up 3 points) club2points - 0 (the second club picked up 0 points)
The result is then entered into the results table and what I am hoping to achieve at this stage is the following:
1) in the clubs table, the gamesplayed is incremented by 1 for both clubs as a result of playing this fixture
2) club1 has however many goals club1 scored added to its current clubtotalgoals field (in this case, it is of course 2)
3) club1 has however many points club1 earned to its current clubPoints field. (In this case it would be 3)
I use APEX 4.2.2 and in my page I call a Modal Region to insert a new customer using AIAX and OnDemand PL/SQL process, then I need to set the inserted value into the Popup LOV from javascript. I used the code
where P20_CUSTOMER is the Popup LOV, ajaxResult is the PK returning from the OnDemand PL/SQL process and P20_DESCRIPTION is an APEX Item of the Modal Region. The new customer is inserted successfully into the table and the PK value returned to javascript code, but the new value is not displayed into the LOV.
I got a long string (length exceeds 32512) from Javascript, and want to pass the sting to a variable to a item called P_SQL
I use *$x("P_SQL").value* in javascript to set the value, but my process couldn't get the value before I submit, however, when I do submit it reports an error like this : Bad Request
Your browser sent a request that this server could not understand.mod_plsql: /pls/alq/wwv_flow.accept HTTP-400 Value param too long. Length is 216343. Upper limit is 32512
<html> <head> <title>Report</title> </head> <script language="JavaScript1.2"> function items()
[code]...
I have a text box item "BINDTEST" that has html element set to:onchange="items();"
I have a button with a url redirect of:
javascriptopon[URL}...
When I click on the button, popup window opens with test url but bindtest1 variable is not appended. What is proper form for trying to get value of bind variable in the url.
I have javascript code i want to move from standard report page to page zero, well page 0 doesn't have html header/page attribute section so how to i achieve this?
In a normal tabular form, with the add, delete, submit option, Under the add button we have the javascript.addrow() call which creates a new row. However, in my case the rows in the tabular form have some columns as display type. So when the user clicks on the add button, he cannot enter all the fields. Is there a way
1. Either to enable all columns of a new row only so that users can add all values and save
2. Or atleast open a new page where the new row is open with all editable fields?
How to check off checkbox with JavaScript. I tried
1) $("#checkboxID").prop('checked' , false) (jQuery) 2) $("#checkboxID").attr('checked' , false) (jQuery)2) document.getElementById("checkboxID").checked = false;Checkbox's list of values: STATIC:;1
Checkbox always states checked. When I append 'checked="checked" ' attribute (or simply checked) to this unchecked checkbox in Firebug nothing happens. Why ? I execute JavaScript code in Dynamic Action on button click. All other controls (textareas and textfields) are cleaned successfully except this checkbox. "Effected elements" property includes all needed items.
Apex version 4.1.1.00.23IE8 (8.0.7601.17514)Firefox 25.0
I have a tabbed form that I need to conditionally disable rows (making them read only). I'm using Javascript to set the attributes of the fields that need to be set.A request was made to make the font color of the read only fields black so that they're easier to read.I'm not able to get the font changed to black on the fields that are Select Lists in Internet Explorer. They are staying gray, however, they are set to black in Firefox. The JavaScript code for one of the Select List is:
and then there is the actual pl/sql process which has a cursor
{code} declareflg varchar2(1); ..begin selectflag into v_flagfrom table where rownum = 1; -- actual conditions are different but this returns one value.
Then below using htp package I had html table with something like
For some reason the script function is not called if I use onload. If I change the onload to onclick it works. Also, if I pass check(flg) it does not work. If I use check(''N'') then is works fine. question is how do I pass a pl/sql variable flg in this case to a javascript function as a parameter? I basically, want the value of flg checked on page load and then if it is N then disable the button. Or else keep it enabled.
I need some functionality in current (4.2.2) APEX websheet which seems not possible out of the box.Therefore I'd like to ad a javascript to my websheet application.
<script language="JavaScript" type="text/javascript"> function f_setglp(pThis,p_app_item,p_other_record_level_item) { var curr_id = $x(pThis).id; // OK ! var curr_glp = $x(p_app_item).id; // returns undefined var curr_orli = $x(p_other_record_level_item).id; // returns undefined
[Code]...
The Javasxcript function fires OK on click in the "Product" attribute but: PMO_GLP_PK is an Application Item that Javascript can´t reference as I called YES_NO is another tabular form attribute and the reference returns also "undefined"
I have a tabular form with a few columns. THey are ID, date1, date2 and task_name. The task_name is a drop down list of tasks. Upon selecting a specific task, I want the date1 and/or date2 columns to become read only (voided out) so users cannot enter in data. I am working with a tabular form, so I figured I need a javascript function to handle the logic and to call the function in the html elements of the column in the apex environment. This will need to happen dynamically (on click) before the page is submitted. I am more lost/confused on syntax. I know I will need to know the actual column name (coo1, coo2, something like that) of my columns that I will be refering to when I use javascript.
I had a complex drill-down dashboard where I was setting page items through $s(Page Item, value) from the Chart Links. But when I did the same thing in APEX 4.2 EA on [URL]...it is simply opening a blank page. whether in 4.2 that Java API has been removed?
We have many many APEX applications in APEX 3.0 running on a 10.2.0.4 database that needs desperately to be upgraded. As a test, I've set up a clean 11gR2 database and copied the production APEX database into it via datapump. I set up APEX Listener, as I don't have any OAS sitting around and the EPG doesn't seem to be supported for APEX 3.0... the Listener doesn't say one way or the other.
When trying to log in, I get the login page, but it tries to reference files such as apex_get_3_1.js while I only have files such as htmldb_get.js in my images directory in production. I noticed it is looking for what appears to be 3.1 files instead of 3.0 files... which concerns me.
The APEX listener appears to be more than just a Java PL/SQL gateway.
Is there a minimum version of APEX the APEX Listener supports?
I am using APEX 4.1 to build the application. I have 2 select list region in the page where one region consist of certain values.On calling a javascript function it is able to move the value from one select region to another. After this I click on the modify button where in the value move out of the first select list region to the second will be updated in the table.
Although I could see the values are not being updates. On putting alerts after the value being fetched in the javascript function and clicking the Modify button I can see that no data is being reflected in the alert. Hence the data is not being passed from the second select list APEX item to the javascript function.
Had some issues with a page on which i changed the value of an item using javascript and added a dynamic action (dummy pl-sql) that submitted the item. The problem was that if i also used $x_disableItem to disable the item in the function that set the value , the value submitted was always null. However if i used the "Disabled" attribute from the item Settings and remove the calling $x_disableItem in the function, the value submitted is correct.
To reproduce , create these objects on a page (default everything not specified):
I have a page (16) and a tabular form when the user select the check box I update the zero page item
$x('P0_REPORT_REFNO').value=l_value;
this works fine till this point now i have a button will calls page 8 and pass the parameter to page 8 P0_REPORT_REFNO is displaying the selected value but passing null to page 8.I am running the application on apex.oracle.com
Application Express 4.1.1.00.23 Internet Explorer - 8 Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
I am about to embark on my first APEX development and have got far as the login screen. I disabled JavaScript just to see what would happen if someone had it disable, it turned out by disabling javascript the whole login region dissapeared. I am wondering how to develop the application so it works when javascript is disabled. I am using the cloudy theme. Not sure how to develop the application as its got to work with JavaScript disabled.
I want to use java-script to open a prompt to see if the user wants to change the date of a work order (Located in Work_order_info called "opened_date")
What I have so far:
var n = prompt("Is the checklist starting now? (Type either y or n)", "y or n"); if (n == "y" || n == "Y"){ alert("The opened date has now been changed!"); }else if (n = "n" || n == "N"){ alert("The opened date has not been changed!"); }else{ alert("You needed to type either n or y, nothing else!"); }
I'm not entirely sure how to tell the table to change the opened_date to sysdate. I'm sure it's really simple >.
We have integrated Oracle Access Manager 11gR1 with Oracle Apex 4.1. The OAM-Apex integration is working fine. Now we want an additional header variable to be passed from OAM to the Apex application. This new header variable will be user's sAMAccountName in Active Directory. OAM is integrated with AD and the AD users are successfully able to access the Apex applications.
The three header variables which are configure in OAM right now are: Header variable name Value 1. OAM_REMOTE_USER $user.userid 2. OAM_REMOTE_USER_EMAIL $user.attr.mail 3. OAM_REMOTE_USER_GROUPS $user.groups
We need an additional header variable as mentioned below: Header variable name: OAM_SAMACCOUNTNAME Value: $user.attr.samaccountname
The new header variable was added in the OHS server's dads.conf file like shown below: =========== dads.conf ============= ... PlsqlCGIEnvironmentList HTTP_OAM_REMOTE_USER PlsqlCGIEnvironmentList HTTP_OAM_REMOTE_USER_GROUPS PlsqlCGIEnvironmentList HTTP_OAM_REMOTE_USER_EMAIL PlsqlCGIEnvironmentList HTTP_OAM_SAMACCOUNTNAME
But we are not able to read the value of this attribute in the Apex application.On the Apex application, we have a text box which shows the value of this header variable. This textbox is attached with the following stored procedure call to fetch the header variable: =================== begin :P1_HEADER_VALUE := owa_util.get_cgi_env( 'HTTP_OAM_SAMACCOUNTNAME' ); end;
The textbox shows the correct value if HTTP_OAM_REMOTE_USER is passed to the get_cgi_env method but does not shows anything when HTTP_OAM_SAMACCOUNTNAME is passed to the same method. if I am missing some configuration to pass the HTTP_OAM_SAMACCOUNTNAME haeder variable from OAM to Apex.
How do I center a button within a region? I tried 'align="center"' but this seemed to be ignored. The button is at the left of the screen. Also, what are the 'display points' (Page Template Region Position 1-8) used for, and why is there a specification for column position of 1-9? Could these be attributes that will allow my button to be centered on the window instead of on the left?
I'm editing, say, list of my employees in a tabular form opened in Skillbuilders Modal Page. I have to execute same javascript code after the changes in the tabular form have been submitted.
I've tried using a Dynamic Action fired on Page Load, but that gets executed before the update is completed.