Dynamically change the value of a select list in form based on a table
Hi Friends,
I am using a form based on a table. I want to display two fields as select lists instead of text boxes and when a value
in a select list is selected, the corresponding values will be listed in the next select list. For example if department
value is selected in a select list the employees in that department will be listed in the employee select list. I saw a
metthod using ajax for achieving this in tabular form in Denes's sample application[Click Here| http://apex.oracle.com/pls/otn/f?p=31517:176:462842537250908::NO] .
Is there any way to achieve the same for a form based on a table,
Thanks,
Tj
Hi Andy,
Could you tell me how I could use your example with multiple Application Items?
My page has 3 cascading select lists. The second is dependent on the first and the third is dependent on both the first and second. I thought I would just need to add the second application item as a get, but not sure what the syntax would be. I have troubleshooted to the point where my select list refreshes when I have one in the javascript...just not sure how to add the additional one?
Here's what I have (I have been referencing your 'Get Employees' page)
My Page Items:
P0_VENDOR_ID
P0_VENDOR_SITE_ID
P0_INVENTORY_ITEM_ID
My Application Items:
F_VDR_ID
F_VDR_SITE_ID
My query in the application process has both F_VDR_SITE_ID and F_VDR_ID in it.
My javascript function...this worked OK until I added the additional get.add('F_VDR_SITE_ID')
function getItems(filter, listName)
var xml = null;
var list = document.getElementById(listName);
var listvalue = list.value;
var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=Set_Items',4);
get.add('F_VDR_ID', filter.value);
get.add('F_VDR_SITE_ID', filter.value);
ret = get.get('XML');
if(ret)
var s = ret.getElementsByTagName("select");
if(s){
var o = ret.getElementsByTagName("option");
var oCount = o.length;
list.options.length = 0;
for(var i = 0; i < oCount; i++){
var l_Opt_Xml = o;
appendToSelect(list, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue);
list.value = listvalue;
if (list.selectedIndex == -1)
list.selectedIndex = 0;
get = null;
Thanks,
Janel
Similar Messages
-
Change the value of a SharePoint List lookup control value using javascript
hi,
could you please help in changing the value of a SharePoint List lookup control value using javascript.
Please note that i have to change the lookup value which is in the form of a drop down from the infopath form.
Thankshttps://stackoverflow.com/questions/5678210/select-dropdown-menu-option-with-javascript
Does that help? -
How do i change the size of a select list?
Hello everyone,
I know this is probably a newbie questiopn but i spent some time trying and already browsed for the forum to look and found nothing related to it.
I m using apex 3.1, and i would like to know in what part of the item i define it's size, in the case of a select list where do i put it's size?
In html i would do it like this:
-----------------HTML CODE--------------------------
<select size="18" class="bigselect">
<option>Mapa 1</option>
<option>Mapa 2</option>
<option>Mapa 3</option>
<option>Mapa 4</option>
</select>
-----------------HTML CODE--------------------------
i already tried these and nothing:
HTML Table Cell Attributes
HTML Form Element Attributes <--- this one says i can t define id and size in it
Form Element Option Attributes
thanks and best regardsHi,
I misunderstood you the first time :)
It seems like APEX is automatically setting the SIZE attribute to 1 when you create a Select List. I'm not sure if you'll manage to change this value before the page is rendered. But if it is really important to you, maybe you can change this attribute after the page is rendered using javascript.
Add this function to the page header section:
<script type="text/javascript">
function setLovSize(){
var x=document.getElementById("PX_MY_SELECTLIST")
x.size="18"
</script>Then on the same page, put the following code into Page HTML Body Attribute:
onLoad="setLovSize();"Hope this helps.
Paulo Vale
http://apex-notes.blogspot.com -
How to access the value of fiedl ( select list with redirect )
WE created one report and form. When i click in the edit button of the report
for the specific record ; the system go automatically in the form
and show me all the information. In my form ia have some fields ( select list with redirect ) in this way i store the key but i can see the description.
I want to control the delete operation in checking the value of some field
in my form. How can i do that. When i verfy the content with SESSION
my variable are empty
Thanks
Marc FortinHello Larry,
You can use a select list with submit and create a branch to the page you want to go to.
Hope that helps.
Regards,
Dimitri
http://dgielis.blogspot.com/
http://www.apex-evangelists.com/
http://www.apexblogs.info/ -
Change the value of a field in a form when the form is displayed
Hello
I have a report which has a link to a form for updating the records. I have used a link to the form from report which displays the the record to be updated i.e it gets default values from the report. I need to change one of these values at the time of displaying the form. The set_value in the 'before displaying the page' section doesn't change the vaue displayed in the form. I tried in other 'Advanced pl/sql' sections provided but didn't succeed.
Thank you
Jayasreehi,
let's call the new value u want to set "NewValue"
insert this code in the before displayin' the page
htp.p('<script language="Javascript1.1">
function defaultValue(fieldname)
var thefield;
for( var v=0; v < document.forms[0].elements.length; v++)
// get the right field
if (document.forms[0].elements[v].name.indexOf(fieldname) >= 0 )
thefield = document.forms[0].elements[v];
thefield.value='''||NewValue||''';
break;
</script>');
in the after displaying the page section call the function above with the appropriate field:
htp.p('<script language=javascript1.1>
defaultValue(''Field_Name'');
</script>');
where Field_name is the name of the field u want to change the value!
Mohamed -
How do you get the value of a selected list item?
I have a drop-down list that the user can choose from. How do I get the value of what they selected? I thought I could do this by using the NAME_IN function, but I'm getting FRM-40105 Unable to resolve reference to item X. I don't know what I'm doing wrong.
Thanks!Hi,
You can use an WHEN-LIST-CHANGED trigger, attached to the list-item itself. And, in this trigger, you can use the name of the item to refer its value.
For example:
:block_name.list_item_name
John -
Dynamically change the value in order by clause (urgent)
Could any one help atall with this.
I have a cursor within a procedure and i want to be able to pass parameter into the procedure so that the record fetched by the cursor can be ordered by the parameter passed in.
For instance
create or replace procedure select_all(p_order_by in varchar2) is
cursor r_cur (c_order_by in varchar2) is
select empno,empname,job,manager,salary
from emp
ordry by c_order_by;
r_rec r_cur%rowtype;
lv_order_by varchar2(30);
begin
lv_order_by := p_order_by;
for r_rec in r_cur(lv_order_by) loop
dbms_output.put_line(empno||empname||job||manager||salary);
end loop;
end;
I have obviously done it as written above but the output is not ordered by the value i passed into the procedure when ran. Is the a better way to achieve the desired result?I handle dynamic order by using dynamic sql
create or replace procedure select_all
(p_order_by in varchar2) is
TYPE RefCurTyp is REF CURSOR;
CV REFCURTYP;
v_sql_stmt VARCHAR2(4000) ;
r_rec r_cur%rowtype;
BEGIN
v_sql_stmt := 'select empno,empname,job,manager,salary '||
' from emp ' ||
' ORDER BY '||p_order_by ;
open CV for v_sql_stmt;
loop
fetch CV into r_rec ;
exit when CV%NotFound;
dbms_output.put_line(r_rec.empno||' '||r_rec.empname||' '||r_rec.job||' '||r_rec.manager||' '||r_rec.salary);
end loop;
close CV;
end; -
Dynamically changing the value in table control
Hello Every one,
In MD61 transaction table control am trying to change value dynamicaly i.e am trying to change value in table control automaticaly tht value to be captured and i need to show in status bar...
Ex table control field is number: am giving 10,20,30 tht should show in status bar by adding if u enter 10 at status bar it show 10 then when u enter 20 it should add with 10 and give 30 ..
in this way when ever u enter value in filed it should add with the status bar value.Hi!
For conversion you can use the function module
data : w_amt TYPE cms_dte_original_amt,
" Amount
w_conv_amt TYPE cms_dte_conv_amt,
" Converted amount
w_kmein TYPE cms_dte_original_curr,
CALL FUNCTION 'CMS_API_CURR_CONV'
EXPORTING
i_original_curr = w_kmein
i_original_amt = w_amt
i_result_curr = 'INR'
i_rate_type = 'M'
i_conv_date = sy-datum
IMPORTING
e_conv_amt = w_conv_amt.
now accordingly you can move the currency and amount that is changed....
here as you were saying that on f4 after selecting you want the other field to get the value on that currency.....
this work can be done as here....
in this the next field gets populated as the first field gets the value......
refer to it.....
https://wiki.sdn.sap.com/wiki/display/ABAP/GettingainputfieldpopulatedonenteringthevalueinoneInputfield
Regards. -
Dynamically change the value in standard text
Hi all,
I have created standard text using SO10 transaction. I have included the text id in SAP FORM. My requirement is some text need to change dynamically in the text when printing the form.Is there any way to do it.
Thanks
SuadrsanaHi .. Here is the solution ...
Hi &V_NAME&
Thanks
XXXXXXXX
U need to get the value of
V_NAME
from the SF.
If u have the value of the variable in an internal table, then
LOOP AT ITAB INTO WA.
V_NAME = WA-NAME.
ENDLOOP.
I think this will be useful.
Suhas
Message was edited by:
Suhas Saha -
How to trace the value passed by select list
Hi,
Is it possible to know what value is passed by the select list.
eg:
:p1_testid -- is the select list name .
if select list contains 3 values ... value1, value2, and value3. and I select value2 from the select list.
I want to confirm it that the value I selected is the same value passed to the query.
- select * from Test where Testid=:p1_testid;
How to trace the value of :p1_testid before query execution.
Thanks.check your session state to see what value the select list has..
From developer tools at bottom of running page, select session, then look for the value associated with your select list..
Thank you,
Tony Miller
UTMB/EHN -
BAdi HRPAD00INFTY - Dynamically change the value of Wage amount in Infotype
Hello all,
I am implementing BAdi HRPAD00INFTY for infotype 0008.
The requirement is, whenever user checks/saves Infotype 8, System should look out FTE wage type exists or not. If it exists then amount should be calculated and get updates for that wage type. If wage type not found insert wagetype FTE and amount in the infotype for the employee.
I have calculated amount in method AFTER_INPUT of the BAdi. I am trying to reflect the updated amount on the screen using method CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP. but it is not working.
I also tried to use the same method CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP in BEFORE_OUTPUT method.
Can somebody help me on this?
Any pointer would be helpful and appreciated.
Thanks in advance.
Best Regards,
DharitreeAdded by Jeyhun Hajiyev - Azerbaijan Baku DemirBank 05.04.2010
Function EXIT_SAPFP50M_001 INCLUDE ZXPADU01
DATA : lv_message_handler TYPE REF TO if_hrpa_message_handler
, wa_0008 LIKE p0008
FIELD-SYMBOLS: <fs_p0008> TYPE ANY.
IF innnn-infty = '0008'.
CLEAR : lv_plans
, ls_hrp1005
, lv_result
Transfer the structure p0008 from INNNN
ASSIGN ('INNNN') TO <fs_p0008> CASTING TYPE p0008.
CHECK sy-subrc = 0.
MOVE <fs_p0008> TO wa_0008.
u201COR
CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN
EXPORTING
PRELP = INNNN
IMPORTING
PNNNN = WA_0008.
u201CChanging in Infotype 0008
wa_0008-trfst = '01'.
wa_0008-lga01 = '1000'. "FOR SEE RESULT YOU MUST ADD THAT LINE
wa_0008-bet01 = 100. " $ Amount for Q0008-BETRG
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = wa_0008
IMPORTING
prelp = innnn.
ENDIF. -
How to Refer the Selected value in a Select List
I have a page item which is a select list. I have a button in my region which when clicked will call a process. This process takes the current value of my page item as a parameter. However, when I select a value from the Select list and click on the button, the page item is still submitting the earlier value, it is not getting updated with the value I selected in the select list. Can someone tell me how I can get the page item value to be updated with the value I selected from the choice list? I tried calling a javascript function from the element attribute of this select list onchange="javascript:setValue(this);") and was trying to set the value of another hidden page item with the value of this select list but then the function is not getting called as well. My function code is something like
function setValue(pThis)
for (var i = 0; i < pThis.options.length; i++) {
if (pThis.options[ i ].selected){
result= pThis.options;
html_GetElement('P2_HIDDEN').value = result;
P2_HIDDEN is my hidden page item970829 wrote:
I have a page item which is a select list. I have a button in my region which when clicked will call a process. This process takes the current value of my page item as a parameter. However, when I select a value from the Select list and click on the button, the page item is still submitting the earlier value, it is not getting updated with the value I selected in the select list.
How do you know this? Have you used Debug mode to track what is happening when the button is pressed? This will show any changes to item values in session state during page submit and page show processing.
Can someone tell me how I can get the page item value to be updated with the value I selected from the choice list?
This should happen automatically with a select list item, if the button is correctly defined to perform a page submit. It will not happen if the button performs a redirect. What action is defined to occur when the button is pressed?
I tried calling a javascript function from the element attribute of this select list onchange="javascript:setValue(this);") and was trying to set the value of another hidden page item with the value of this select list but then the function is not getting called as well. My function code is something like
function setValue(pThis)
for (var i = 0; i < pThis.options.length; i++) {
if (pThis.options[ i ].selected){
result= pThis.options;
html_GetElement('P2_HIDDEN').value = result;
P2_HIDDEN is my hidden page item
As detailed above, this should be completely unnecessary, however as an aside, html_GetElement is a very out of date method of accessing an item. What version of APEX are you using? (Always specify which version you're using when you ask a question, to allow us to determine the most appropriate solution to the problem.) -
Dynamic values of a select list based on a column
Is there an easy way to build the values of a select list from a column that contains 'Red,Green,Blue" where Red, Green, Blue will be the values of the select list?
Bob,
Next time you could try this for a one row table:
WITH DATA AS
(SELECT SUBSTR (txt
, INSTR (txt, ',', 1, LEVEL) + 1
, INSTR (txt, ',', 1, LEVEL + 1)
- INSTR (txt, ',', 1, LEVEL)
- 1
) AS token
FROM (SELECT ',' || YOUR_COLUMN || ',' txt FROM YOUR_TABLE)
CONNECT BY LEVEL <=
LENGTH (txt)
- LENGTH (REPLACE (txt, ',', ''))
+ 1)
SELECT *
FROM DATAOr use this if your comma separated values are in more than one row:
http://blogs.ittoolbox.com/oracle/guide/archives/sql-question-pivots-analytics-and-the-judicious-use-of-row_number-10156 -
OBIEE 10g AGO Function Dynamically Change the Heading
I created columns in my rpd named Sales Previous Month, Sales 2 months ago and Sales 3 months ago using the AGO Function. This is working fine.
My problem is when displaying these headings the users would like to see the Month Name instead of the Headings I created. For example if looking at a report for January the users would like to see:
Sales Previous Month = December
Sales 2 Months ago = November
Sales 3 Months ago = October
Is there any way to dynamically change the value of the column header to show the name of the month?Hi SriniVEERAVALLI,
Thanks for the reply. I have found that I might haven't created the relationship between dimension and fact tables correctly.
I initially created the foreign key relationship (instead of creating complex join) in physical diagram between the dimension and fact table. And the relationship type is hence greyed out.
I have deleted the foreign key relationship in physical diagram. Then
1. In physical diagram, create complex join between dimension and fact . The relationship is 'inner' and can't be changed.
2. In Logical table diagram, create foreign key between dimension and fact . The relationship can be changed (inner, outer, etc).
Is this the correct way?
I tried these on two newly created dummy tables and it worked. -
Regarding dynamically assigning the where clause to select query
hi,
Please send the code regarding how to dynamically assign the where clause to select query.
thanks in advanceSELECT <fileds>
INTO TABLE itab
FROM dbase
WHERE condition.
Maybe you are looking for
-
Please help with Mac Mail freezing
Everytime I go to mac mail I get the spinning beach ball forever and then eventually have to force-quit. I have 10.4.11 on a G4 Powerbook 1.67. Is there a way to trash my mail program and download a new one?
-
Integration with PeopleSoft Applications Using Oracle SOA Suite 11g BPEL
Hi, I'm integrating BPEL with Peoplesoft FSCM 9.0 Application on tools 8.49 using Oracle SOA Suite 11g. The BPEL invokes the web service method generated from Peoplesoft Component Interface in a synchronuos manner. I have deployed the BPEL in Oracle
-
Installation Error for NW2004s Java SP9 Trial
Hello, I tried to install trial version on XP professional as well as Windows 2003 server (separate computers). Every time I get error exactly at the same place. I go through first 3 / 4 screens, when I specify correct JCE zip file. It fails with fol
-
Hi all. When I'm using set_table_for_first_display method how can implement refreshing option after the user had pressed a button and activated a process ? Thanks all, Rebeka
-
NOW WHAT? I already tried uninstall / reinstall.