Set value of a display only item using javascript
I was trying to find an answer in the forum but my searches gave me no results. How do
I set a value of a display only item using javascript (ajax)?
Denes Kubicek
http://deneskubicek.blogspot.com/
http://htmldb.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------
Vikas,
Thanks for a fast responding. The type is Saves State. However, I tried to set the value
of a display only item using:
<script>
function f_setDisplayOnly ()
{$x('P80_X').parentNode.childNodes[4].nodeValue = 1;
</script>without a result (or error). What am I doing wrong?
Denes Kubicek
http://deneskubicek.blogspot.com/
http://htmldb.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------
Similar Messages
-
Why cannot I use hidden or display only item to store value for insert?
hi, Gurus:
I have a question:
I implemented a form with report region in a page, the update works OK, but the add function has a problem:
There is a column, offender_ID, which is a foreign key for another table, it should not be null during insert. However, even I pass the offender ID from master page when user click the create button, and it did shows in the form, it must be a text filed to insert successfully, why cannot I use hidden or display only item to store this value for insert? (If I use hidden or display only item, insert won't be successful, apex reports I tried to insert a null value to offender_ID column.)
Many Thanks in advance.
SamHi,
There is a column, offender_ID, which is a foreign key for another table, it should not be null during insert. However, even I pass the offender ID from master page when user click the create button, and it did shows in the form, it must be a text filed to insert successfully, why cannot I use hidden or display only item to store this value for insert? (If I use hidden or display only item, insert won't be successful, apex reports I tried to insert a null value to offender_ID column.)I think both hidden and display items have attributes that can cause problems because of different ways these items function than non-hidden and non-display-only items function. Display Only items have a "Setting" of "Save Session State" Yes/No? That can be a problem.
Would you do this? Make these items regular items instead and see if you can get those working. Then, we will try to change the fields back to hidden or display only.
Howard
Congratulations. Glad you found the solution.
Edited by: Howard (... in Training) on Apr 11, 2013 10:26 AM -
Displaying diff dates using PL/SQL expression for 'display only' item ?
Hi ,
I am having a display only item -- :P2_FROM_Date . If its Thu,Fri,Sat or Sun I want to set the date as the last Monday's date . If its Mon,Tue or Wed then it should be the present Monday's date .
E.g: Today is Friday and the last Monday was on 18th .
So for yesterday , today,tomorrow and Sunday , the date should be displayed as 18-JUN-2012.
From the coming Monday to Wednesday , the date should of be the coming Monday i.e , 24-JUN-2012
I tried it doing under 'Source ' of item using PL/SQL expression and PL/SQL function body. Not working
Can someone help ?
Thanks & Regards
UmerNice1 wrote:
declare
lv_date number;
begin
select to_char(sysdate,'D') into lv_date from dual;
if lv_date=2 then
:P2_FROM_DATE := to_char(sysdate-1);
end if;
end;I tried this under " PL/SQL function body " in "Source " tab of the item P2_FROM_DATE
When I run this , nothing is displayed corresponding to the item P2_FROM_DATEExactly as expected. This code will only set a value for <tt>P2_FROM_DATE</tt> when run on Mondays in territories where the first day of the week is Sunday, and when run on Tuesdays where Monday is the first day of of the week:
SQL> var P2_FROM_DATE varchar2(30)
SQL> alter session set nls_date_format='Dy DD-MON-YYYY';
Session altered.
SQL> select sysdate from dual
SYSDATE
Mon 25-JUN-2012
SQL> alter session set nls_territory='AMERICA';
Session altered.
SQL> declare
2 lv_date number;
3 begin
4 select to_char(sysdate,'D') into lv_date from dual;
5 if lv_date=2 then
6 :P2_FROM_DATE := to_char(sysdate-1);
7 end if;
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> print p2_from_date
P2_FROM_DATE
Sun 24-JUN-2012
SQL> alter session set nls_territory='UNITED KINGDOM';
Session altered.
SQL> exec :p2_from_date := null
SQL> declare
2 lv_date number;
3 begin
4 select to_char(sysdate,'D') into lv_date from dual;
5 if lv_date=2 then
6 :P2_FROM_DATE := to_char(sysdate-1);
7 end if;
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> print p2_from_date
P2_FROM_DATE
SQL>Hence the questions about language above.
>
I am having a display only item -- :P2_FROM_Date . If its Thu,Fri,Sat or Sun I want to set the date as the last Monday's date . If its Mon,Tue or Wed then it should be the present Monday's date .
E.g: Today is Friday and the last Monday was on 18th .
So for yesterday , today,tomorrow and Sunday , the date should be displayed as 18-JUN-2012.
From the coming Monday to Wednesday , the date should of be the coming Monday i.e , 24-JUN-2012
>
The coming Monday is 25-JUN-2012.
Aren't these rules equivalent to "Monday this week, where Monday is the first day of the week"? In which case the PL/SQL Expression you require is:
trunc(sysdate, 'iw')For example:
SQL> with t as (
2 select date '2012-06-21' + level d from dual connect by level <= 17)
3 select
4 d
5 , trunc(d, 'iw') monday
6 from
7 t;
D MONDAY
Fri 22-JUN-2012 Mon 18-JUN-2012
Sat 23-JUN-2012 Mon 18-JUN-2012
Sun 24-JUN-2012 Mon 18-JUN-2012
Mon 25-JUN-2012 Mon 25-JUN-2012
Tue 26-JUN-2012 Mon 25-JUN-2012
Wed 27-JUN-2012 Mon 25-JUN-2012
Thu 28-JUN-2012 Mon 25-JUN-2012
Fri 29-JUN-2012 Mon 25-JUN-2012
Sat 30-JUN-2012 Mon 25-JUN-2012
Sun 01-JUL-2012 Mon 25-JUN-2012
Mon 02-JUL-2012 Mon 02-JUL-2012
Tue 03-JUL-2012 Mon 02-JUL-2012
Wed 04-JUL-2012 Mon 02-JUL-2012
Thu 05-JUL-2012 Mon 02-JUL-2012
Fri 06-JUL-2012 Mon 02-JUL-2012
Sat 07-JUL-2012 Mon 02-JUL-2012
Sun 08-JUL-2012 Mon 02-JUL-2012
17 rows selected.
SQL> alter session set nls_territory='AMERICA';
Session altered.
SQL> alter session set nls_date_format='Dy DD-MON-YYYY';
Session altered.
SQL> with t as (
2 select date '2012-06-21' + level d from dual connect by level <= 17)
3 select
4 d
5 , trunc(d, 'iw') monday
6 from
7 t;
D MONDAY
Fri 22-JUN-2012 Mon 18-JUN-2012
Sat 23-JUN-2012 Mon 18-JUN-2012
Sun 24-JUN-2012 Mon 18-JUN-2012
Mon 25-JUN-2012 Mon 25-JUN-2012
Tue 26-JUN-2012 Mon 25-JUN-2012
Wed 27-JUN-2012 Mon 25-JUN-2012
Thu 28-JUN-2012 Mon 25-JUN-2012
Fri 29-JUN-2012 Mon 25-JUN-2012
Sat 30-JUN-2012 Mon 25-JUN-2012
Sun 01-JUL-2012 Mon 25-JUN-2012
Mon 02-JUL-2012 Mon 02-JUL-2012
Tue 03-JUL-2012 Mon 02-JUL-2012
Wed 04-JUL-2012 Mon 02-JUL-2012
Thu 05-JUL-2012 Mon 02-JUL-2012
Fri 06-JUL-2012 Mon 02-JUL-2012
Sat 07-JUL-2012 Mon 02-JUL-2012
Sun 08-JUL-2012 Mon 02-JUL-2012
17 rows selected.Also note that using the item source properties will only set the <tt>P2_FROM_DATE</tt> in the rendered page, not in session state. -
Dynamic hyperlinks as Display Only item?
Hi, I need to add a hyperlink on a page, and the hyperlink will partially be derived from a page item on that page.
When I put a Display Only item on that page, with the source type as Static Assignment and set to something like:
<a href="http://webserver/page.html?number=:P2_NUMBER">blah</a>It displays exactly that, ignoring the HTML, and doesn't display it as a link.
Simple I'm sure, but what am I doing wrong?What you set for the item would be its value (of an input HTML item)
Try adding it to post or pre-element text of the item as
<a href="http://webserver/page.html?number=&P2_NUMBER.">blah</a> -
Mapping display only item to three output parameters from a procedure?
Hi all
I have a procedure with three output parameters, which I would like to map the three output parameters to three display only items on the page.
there is a page process called the procedure, which output statement1,statement2,statement3 parameters.
I have three items on the page which I would like to map them to the three parameters respectively,
how can I achieve this?
thanksRajesh,
please check if this following proposal could serve you.
Define the Query with mode FixedQueryWithOutput. In the package define a ref cursor as IN OUT parameter. To get your 3 values back, open the cursor in your procedure like "Select val1, val2, val3 from dual". Then the values should get into your query.
Here is an example how this could be defined.
Package:
type return_cur IS ref CURSOR;
Procedure:
PROCEDURE myProc(myReturnCur IN OUT return_cur) ...
OPEN myReturnCur FOR SELECT val1, val2, val3 FROM dual;
Query:
DECLARE
MYRETURNCUR myPackage.return_cur;
BEGIN
myPackage.myProc(
MYRETURNCUR => ?
END;
Good luck.
Michael -
Setting values for non-displayed fields on a Tabular Form
I'm having a problem setting non-displayed fields on the same table as displayed fields like last_update_date, last_updated_by, id's and other fields when creating new records or updating existing records in a Tabular form.
What is the best and easiest way to set these values without using database triggers?Hi Jes,
I'm a little reluctant to use database triggers as I used this product a couple of years ago and I'm fairly sure I handled this problem in HTML DB without the use of triggers. I am therefore I'm getting a touch frustrated that I can't remember how to do it now !!
Do you know of any way of setting values for non-displayed fields on a Tabular Form without using database triggers?
Also, you seem to be suggesting that database triggers is the best way to do this?
Thanks -
How to set one layout to display only?
Hello, Expers,
I want to display only one layout. The scenario is: when the user input some data in a layout and click on one 'input finish' function button which means that the user has finished input data in that layout, then the system will set that layout to display only. I don't want to use the variable with comparion column because that will also cause all the layout to display only. What I want to do is just set only one layout to display only. Anyone know how to do?Dear guqing,
please take a look at
http://help.sap.com/saphelp_nw70/helpdata/en/45/9d0fbe42c40063e10000000a11466f/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/en/43/174720c5dd3db4e10000000a422035/frameset.htm
You can use the command SET_INPUT_MODE or SET_DATA_ENTRY_MODE
Regards
Matthias Nutt
SAP Consulting Switzerland -
How to validate an text field item using javascript for numbers only.
hi,
how to validate an text field item using javascript for numbers only.please help me on this urgent
please mail me solun if posible on [email protected]Hi,
Page HTML header
<script>
function onlyNum(evt) {
// Usage: onKeyPress="return onlyNum(event)"
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
var status = 'This field accepts numbers only!';
alert(status);
return false;
var status = '';
return true;
</script>Item HTML Form Element Attributes
onKeyPress="return onlyNum(event)"Br,Jari -
How to force carraige return in display-only item
Can I somehow force a carraige return in the text for a display only item? Aesthetically, I'd would like to have strategically-placed line breaks.
Thanks,
CScott -- Sorry, I posted the wrong example entirely. Here's the assignment statement. If it isn't clear I'll try to put an example on apex.oracle.com... which I've not done before, so would be another learning experience :)
:P1_MESSAGE_1 := 'my display text line1< br>my display text line2';
My assignment statement is exactly the same format as what you posted on
Jul 29, 2008 2:51 PM, with the space after the opening bracket removed, as you
indicated it should be.
:P1_MESSAGE_1 is a display only, saves state item. After the assignment
statement (and submit), what is displayed is exactly what's in the single quotes, including the brackets and the "br" -- the html doesn't appear to be recognized as such:
Item display is: my display text line1< br>my display text line2
Does this clarify what I'm doing?
Thanks,
C -
Overwriting the value of an html:hidden tag using javascript
Hi!
Can somebody help me with my problem?
I need to overwrite the value of my html:hidden tag using javascript, but I dont know how?
Any help?
Thankswhat are you talking about :x
thats a webapplication question, wrong forum..
But you are using STRUTS I would say...
<html:hidden property="hiddenfield"/>This is the proper way of doing it.. but overrighting it
I don't think you understand why we use that?
It is only for forms.... we use that for hidden input ... It is common sence not to overrde that value. -
Setting values to Display Only item during AJAX request
Hello,
Good Morning!
In a master-detail form, in the detail report, I am populating two columns SERVICE_TAX_PCT and SERVICE_TAX_AMOUNT by making an AJAX request after selection of ACCOUNT_CODE. Values are populated with out any issue.
However, as soon as I make those two fields as Display Only, the values are not getting set. Is there a way to set the values to a field in the same time it should be restricted for user to change it?
(APEX 4.2.6)
Thanks,
-AnandHi Anand,
anand_gp wrote:
Hello,
Good Morning!
In a master-detail form, in the detail report, I am populating two columns SERVICE_TAX_PCT and SERVICE_TAX_AMOUNT by making an AJAX request after selection of ACCOUNT_CODE. Values are populated with out any issue.
However, as soon as I make those two fields as Display Only, the values are not getting set. Is there a way to set the values to a field in the same time it should be restricted for user to change it?
(APEX 4.2.6)
check the example
Step 1: Edit your page
under CSS->Inline put the code given below
.row_item_disabled {
cursor: default;
opacity: 0.5;
filter: alpha(opacity=50);
pointer-events: none;
Step 2 : I guess you have Javascript function similar like given below
you have to extract rowid first, for which you want to set the percentage , see line 6
and see line 18, for disabling the column of that row.
<script type="text/javascript">
function f_fetch_tax_percentage(pThis) {
var ajaxRequest;
var ajaxResult;
var row_id = pThis.id.substr(4);
var percentage = 'f05_' + row_id; // replace f05 with the rowid of percentage column
ajaxRequest = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=TAX_DTLS',0);
ajaxRequest.addParam('x01',$v(pThis));
ajaxResult = ajaxRequest.get();
if ( ajaxResult.length > 0 ) {
// set percentage
$('#'+percentage).val(parseFloat(ajaxResult));
// disable percentage column
$("#f05_" + row_id).attr("readonly", true).addClass('row_item_disabled');
</script>
Hope this helps you,
Regards,
Jitendra -
How to display Session value of an item using Javascript?
Hello All,
I have a file browse item and I browse some file and click on upload, i run this javascript :
function passBack()
javascript:doSubmit('UPLOAD');
alert('hi');
var var_flag = $x('P91_FILE');
alert(var_flag.value);
opener.document.forms["wwv_flow"].f05[3].value = var_flag.value;
close();
</script>
It dispalys 'hi ' as per the first alert.
For the second alert it shows the file path value . ( C:\test\test1.sql).
I need the file session value to be displayed here
Like the following :
F477093380/test1.sql
and then I need to pass that value to parent page. and close the child page.
Any idea?
Thanks in advance.
Regards,
ArchanaArchana,
I'm not sure about javascript, but u can use a sql query on the "APEX_APPLICATION_FILES" view to obtain that.
Something like:
SELECT id,NAME
FROM APEX_APPLICATION_FILES; -
Example of setting page item using javascript
Does anyone have an example of setting the value of a page item (hidden) using javascript? I have seen the following in the Forum but I am having trouble implementing it. If someone could show an example of a region it is called from, and the javascript (and where it is placed), that would be great.
I have tried something similar to this without luck so far:
function setValue(){
$x('P1_FIELD').value = 'Oracle';
Thanks!
JohnHi VS,
you should really use a "Set Value" dynamic action for that, that's much more transparent than using the onclick definition in the button attributes.
Regards
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 -
Setting value in the detail level field using hdr level lov
i try to set value in the detail table using hdr LOV , at that time some fields value are set and some are not set. i don't understand why this happens, please give me the solution
huh?
You provide nowhere near enough information for us to even understand what you want to do, let alone to answer.
John -
How to display "All Items" using a "Filtered Rows" Combo Box
Hi
How do I make a Combo Box with "Filtered Rows" show "All Values" by default, AND have the option to select individual filters?
If my data was
North
South
East
West
I would want the Combo box to display
ALL
North
South
East
West
When the user selected:
North, they should see just the filtered rows with North
South, they should see just the filtered rows with South
ALL should be the default, and it should ifilter/include North, Soutn, East and West (i.e. showing all the rows)
I need to use a Combo box and Filtered Rows, because I actually want to filter my dataset using multiple columns:
Company, Region, District, Sector, Value
My current method is to:
use a Combo to filter the RawData on Company into an Intermediate_Company worksheet
use another Combo to filter the Intermediate_Company worksheet on Region into an Intermediate_Region worksheet
use another Combo to filter the Intermediate_Region worksheet on District into an Intermediate_District worksheet
use another Combo to filter the Intermediate_District worksheet on Sector into an Intermediate_Sector worksheet
then display in a List View from the Intermediate_Sector worksheet.
Any comments on this method would also be welcome.
Thanks for your help
StuartThanks Muwa
I've uploaded a non-working version here: http://www.teradepot.com/ntxgoo6629zi/Simple_All_Combo.xlf.html
I've figured out how to use tthe filter to copy a subset of the rows in the source date to the destination are of the worksheet.
I can't figure out how to use a filter to copy ALL the rows in the source to the destination.
I've seen hints about using hidden filters, but I can't make this work, either. It's quite depressing, really
I'm very grateful for any help you can give.
Thanks in advance
Stuart
Maybe you are looking for
-
how i can run web videos in my 303 nokia
-
Sending to printer- are these requests the usual?
Hello, I've worked my way through my first big InDesign project thanks to this forum, now I have a question about the final processes. I know about checking pre-flight and using the package function (I'm working on a Mac 10.4 with CS3) to send my lin
-
After the instalation on the ADD-ON XL Report, i click in Report composer and it´s goes fine, then i click in IX Report Organizer and appears a window with the Error "Run-Time Error '0'" .. Then the XL Reporter Stops...
-
Enterprise Link with external JMS queue
We have an external Non-Oracle JMS server and queue setup on a different box. How do I use Architect/Admin to configure it and then use it as an Enterprise Message Source? I followed the guide , but when I run the Plan in Elink Studio, I get java.lan
-
Installing a older version to a new computer
I have bought elements 11 and want to install it on a new laptop. How do I do this?