Dynamic Select List based on TextField data
Hi,
I like to dynamically display the select list based on the value in the textfield, the data in the textfield is of character type.
Thanks
Hello,
Well as you now know HTML based select lists don't work like that, that widget is called a combo box and there will be built in combo boxes in APEX 3.0, it's a fairly complex dhtml widget.
What you might want to do is provide a text item next to your select box and an Add New Value Option in your select list.
Carl
Similar Messages
-
Creating a dynamic Selection List based on a View Object
Hello,
I'm new to JDeveloper and I would like to create a JSP Page with dynamic Selection List based on a runtime query or based on a view object (BC4J). The selection made by an user should serve another dynamic query with the necessary parameters that I built using createViewObjectFromQueryStmt(). By now I tried this using the InputSelectLOV from the Component Palette in JDeveloper. But without success. By the way: the selection list is not very large (5 values), so it's not necessary to have a form finding the desired value.
Maybe someone had experience about creating this already. Please give me a tip or a little example.
Thanks.http://otn.oracle.com/products/jdev/howtos/jsp/renderers.html
-
Newbie: how to create a dynamic select list of the current date + 5 years
Hi - I'm a JSP newbie (coming from a PHP background), and am trying to create a select list that contains the current year, plus 5 years. So, the list when generated (today), would display:
2007
2008
2009
2010
2011
2012
Obviously, the code would need to generate inside the option tags, as well as in the value property of the option tag.function addit(){
var val = 2012; //you can take this from js date object and strip it off
for (var i=2007; i <= val;++i){
addOption(document.getElementById("mycombo"), i, i);
function addOption(selectbox,text,value)
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}without hardcoding:
function addit(){
var dd = new Date();
var yearnow = dd.getFullYear();
for (var i=yearnow; i <= yearnow + 5 ;++i){
addOption(document.getElementById("mycombo"), i, i);
function addOption(selectbox,text,value)
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
in your jsp:
<body onload="addit();">
<form>
<select name="mycombo">
<option> Select year</option>
</select>
</form>
</body>
Message was edited by:
skp71
Message was edited by:
skp71 -
Dynamic selection list based on selection screen values ?
I have a requirement which I can't solve in one step in a selection screen
first field I have to select the contract like you do with me33k
in the second field I have to select the position of the contract filled in at the first field ?
if the position is selected I have to fill other fields in the selection screen and block them for altering the information entered by the position selected
anybody got some sample on how to do this ??
kind regards
arthur de smidtI really don't understand why it's not working. after input of the parameter field debugging doesn't start when is it evaluated ??
I want the screen modified at every change of p_contr.
SELECTION-SCREEN: BEGIN OF BLOCK s01 WITH FRAME TITLE text-s01.
parameters: p_bukrs like ekko-bukrs MEMORY ID BUK obligatory,
P_WERKS like EKPO-WERKS MEMORY ID WRK OBLIGATORY,
p_ekorg like ekko-ekorg MEMORY ID EKO obligatory,
P_EKGRP like EKKO-EKGRP MEMORY ID EKG OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK s01.
SELECTION-SCREEN: BEGIN OF BLOCK s05 WITH FRAME TITLE text-s05.
parameters: p_contr AS CHECKBOX USER-COMMAND contr,
p_konnr like EKKO-ebeln MATCHCODE OBJECT MEKK ,
P_KTPNR like EKPO-ktpnr.
SELECTION-SCREEN: END OF BLOCK s05.
SELECTION-SCREEN: BEGIN OF BLOCK s02 WITH FRAME TITLE text-s02.
parameters: p_lifnr like ekko-lifnr modif id CTR,
p_EVERK like EKKO-VERKF," obligatory,
p_afnam type zafnam,
p_uwkenm like EKPO-TXZ01,
P_IHRAN like EKKO-IHRAN DEFAULT SY-DATUM,
P_KDATB like EKKO-KDATB," obligatory,
P_KDATE like EKKO-KDATE," obligatory,
p_cntVU LIKE RP50G-PERNR OBLIGATORY
MATCHCODE OBJECT PREM,
p_advies type lifnr.
SELECTION-SCREEN: END OF BLOCK s02.
SELECTION-SCREEN: BEGIN OF BLOCK s03 WITH FRAME TITLE text-s03.
SELECTION-SCREEN PUSHBUTTON /1(17) WERK USER-COMMAND WERK.
parameters: P_TXZ01 like EKPO-TXZ01 obligatory,
* p_txt9 type tline,
P_MATKL like EKPO-MATKL DEFAULT 'DNST-02' OBLIGATORY.
selection-screen begin of line.
SELECTION-SCREEN COMMENT 1(31) TEXT-001 FOR FIELD p_menge.
parameters: P_MENGE like EKPO-MENGE DEFAULT '1' OBLIGATORY,
P_MEINS like EKPO-MEINS DEFAULT 'ST' OBLIGATORY.
selection-screen end of line.
selection-screen begin of line.
SELECTION-SCREEN COMMENT 1(31) TEXT-002 FOR FIELD p_netpr.
parameters: P_NETPR like EKPO-NETPR obligatory,
P_EPEIN like EKPO-BPRME DEFAULT 'ST' OBLIGATORY.
SELECTION-SCREEN POSITION 55.
parameters: p_schpr like ekpo-schpr.
selection-screen end of line.
parameters: p_saknr like mepoaccounting-sakto obligatory,
p_aufnr like mepoaccounting-aufnr obligatory.
SELECTION-SCREEN: END OF BLOCK s03.
initialization.
clear h_exit.
set pf-status 'STANDAARD'.
move 'Werkomschrijving' to WERK.
at selection-screen on p_contr.
loop at screen.
if p_contr = 'X'.
if screen-group1 = 'CTR'.
screen-input = 0.
screen-active = 0.
screen-required = 0.
modify screen.
else.
screen-input = 0.
screen-active = 1.
screen-required = 1.
modify screen.
endif.
endif.
endloop.
at selection-screen on exit-command.
case sy-ucomm.
when '&F03' or '&F015' or '&F12'.
leave program.
endcase.
at selection-screen on block S01.
case sy-ucomm.
when 'ONLI'.
type_doc = 'B'.
when 'ONLI1'.
type_doc = 'O'.
endcase.
perform checks_org.
at selection-screen on block S02.
perform checks_lev.
at selection-screen on block s03.
check sy-ucomm(4) eq 'ONLI'.
perform checks_werk.
at selection-screen.
case sy-ucomm.
when 'WERK'.
perform lange_omschrijving.
when 'SPOS'.
CALL FUNCTION 'RS_VARIANT_SAVE_FROM_SELSCREEN'
EXPORTING
CURR_REPORT = 'ZBESTELLING'.
endcase.
start-of-selection. -
Problem writing a sql query for a select list based on a static LOV
Hi,
I have the following table...
VALIDATIONS
ID Number (PK)
APP_ID Number
REQUESTED Date
APPROVED Date
VALID_TIL Date
DEPT_ID Number (FK)
I have a search form with the following field item variables...
P11_DEPT_ID (select list based on dynamic LOV from depts table)
P11_VALID (select list based on static Yes/No LOV)
A report on the columns of the Validations table is shown based on the values in the search form. So far, my sql query for the report is...
SELECT v.APP_ID,
v.REQUESTED,
v.APPROVED,
v.VALID_TIL,
d.DEPT
FROM DEPTS d, VALIDATIONS v
WHERE d.DEPT_ID = v.DEPT_ID(+)
AND (d.DEPT_ID = :P11_DEPT_ID OR :P11_DEPT_ID = -1)
This query works so far. My problem is that I don't know how to do a search based on the P11_VALID item - if 'yes' is selected, then the VALID_TIL date is still valid. If 'no' is selected then the VALID_TIL date has passed.
Can anyone help me to extend my query to include this situation?
Thanks.Hello !
Let's have a look at my example:create table test
id number
,valid_til date
insert into test values( 1, sysdate-3 );
insert into test values( 2, sysdate-2 );
insert into test values( 3, sysdate-1 );
insert into test values( 4, sysdate );
insert into test values( 5, sysdate+1 );
insert into test values( 6, sysdate+2 );
commit;
select * from test;
def til=yes
select *
from test
where decode(sign(trunc(valid_til)-trunc(sysdate)),1,1,0,1,-1)
=decode('&til','yes',1,-1);
def til=no
select *
from test
where decode(sign(trunc(valid_til)-trunc(sysdate)),1,1,0,1,-1)
=decode('&til','yes',1,-1);
drop table test; It's working fine, I've tested it.
The above changes to my first idea I did because of time portion of the DATE datatype in Oracle and therefore the wrong result for today.
For understandings:
1.) TRUNC removes the time part of DATE
2.) The difference of to date-values is the number of days between.
3.) SIGN is the mathematical function and gives -1,0 or +1 according to an negative, zero or positiv argument.
4.) DECODE is like an IF.
Inspect your LOV for the returning values. According to my example they shoul be 'yes' and 'no'. If your values are different, you may have to modify the DECODE.
Good luck,
Heinz -
Hi,
I got a requirement as below
I am having five columns in my table as below
1) Det_ref (Primary Key Column)
1) Ord_Ref (Master table foreign key)
2) Function Type (Select list based on a dynamic query)
3) Function Code (Select list should be populated based on Function Type selected above)
4) Cost (Readonly Text box -- Based on the Function Code selected this cost should be shown)
5) Special Requirement (Text box to enter any special requirements)
These last 4 columns should be shown in a tabular way and I have a Button to add a row using java script (The page should not get refreshed)
and finally I have Submit button which saves the data to the database at the end.
The problem I am facing is the function code select list is not getting generated dynamically based on function type. I am calling the javascript to populate but it is always populating the first row only as there will be no reference from the second row.
Can anyone kindly provide me the code if already done. Please help me in this issue.
Thank you
Regards
Dev
Edited by: [email protected] on 03-Nov-2008 08:24Hi Andy,
Thankyou so much..
It is working perfectly as I require.
I need to place a text box after my second LOV. But this textbox is not based on the table. When I select a value from my second LOV it should populate the cost of that particular value selected in the second LOV. But if I keep a text box it is giving a error as below
Error in mru internal routine: ORA-20001: Error in MRU: row= 0, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "C189DDAFB90EAC4A835B4E8C05284AEA", item checksum = "B7D3B67F53FB31BD9764FC325E9A9A91".,
Please help me in this issue.
Thankyou
Regards
Dev -
Select list based on LOV - and allowing new values
Hi All,
I have a page that has a select list based on a dynamic list of values. I wanted to test out how the system was working, so I truncated all of my tables, and now my select list is blank (which makes sense). The problem is that I can't type anything into the select list. How can I make it so that if there isn't a value returned from the query that populates the LOV, I can just type one in? This also goes further in that if the value I wanted isn't already in the db, how does the user add in another value?
Thanks in advance,
CoreyHello,
Well as you now know HTML based select lists don't work like that, that widget is called a combo box and there will be built in combo boxes in APEX 3.0, it's a fairly complex dhtml widget.
What you might want to do is provide a text item next to your select box and an Add New Value Option in your select list.
Carl -
Default value dynamic select list
Hi everybody,
I have a question concerning dynamic select lists.
I have a report of a table that shows some records. Each record has different versions of data. So when you click on a record you get to another page where you get some information about this record and where you can select the version of this information (with the help of a select list).
The select list works fine and is defined dynamically as follows:
select distinct a.name display_value,
a.version_id return_value
from cn_pl_version a,
cn_pl_std_peplanung b
WHERE a.version_ID = b.version_id AND
b.pe_id = '&P6_HELP_PRODET.'
order by a.version_id desc
My problem is that when I click on a record I always get the report filled with the oldest version of the current record, so I always have to choose the newest version in the select list manually. I would prefer always to have the newest version in the report.
The query for the report is as follows:
select
(select sum(stunden) from cn_pl_std_peplanung t02
where abt_id = '10'
and t02.pe_id = t1.pe_id
and t02.version_id = t1.version_id
and t02.idee_id = t1.idee_id) stunden_ir,
(select name from cn_pl_version u01
where u01.version_id = t1.version_id) Version
from cn_pl_std_peplanung t1, cn_pl_projektelemente z1, cn_pl_version u1, cn_pl_projektidee s1
where t1.version_id = '&P6_VERSION_WAHL.'
and t1.pe_id = z1.pe_id
and z1.pe_id='&P6_HELP_PRODET.'
group by t1.pe_id, t1.version_id, t1.idee_id
'&P6_VERSION_WAHL.' is the item of the select list
'&P6_HELP_PRODET.' is the ID of the current record
I'm not sure if you understood my problem, my english isn't the best...
Thanks for any kind of help!!
PatrickHi Patrick,
what value does you select list show, when you branch to the page? Is it the correct one?
If not you should change your select list, that the correct version is selected as default. You can define a "default value" when you set the source of the element.
Otherwise you can maybe set up an example application at http://apex.oracle.com.
Best Regards
chrissy -
Select List (based on LOV) query problem
Hello experts! I have a small problem here, which I can't seem to overcome.
I have a page item (select list based on LOV), which is based on a query. The query returns all potential employees of a department that are responsible for a certain duty. So far so good!
The problem is that there are two departments, which should not only see there own employees but also the name of the employee that has carried out a certain task. However, due to my query, the name of that person is not displayed - only the pk is returned.
Do you have a recommendation how I display all employees of a specific department and have additional values translated as well?
My query is as follows: select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter where cnt_bearbeiter in (SELECT
CNT_REGIERUNGSBEZIRK FROM TBL_REGIERUNGSBEZIRK) union select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter where int_behoerde in (SELECT
CNT_REGIERUNGSBEZIRK FROM TBL_REGIERUNGSBEZIRK where STR_REGIERUNGSBEZIRK = lower (:app_user)) whereas :app_user holds the information of the department.
Any hint is appreciated!
Many thanks,
SebOkay, I just had the right idea and it's working well! Sorry for posting!
I return the name of the employee that has edited a dataset and simply add all others of the logged on department! Really easy! Should have thought of that before posting! ;-(
The correct code is select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter a, vt_tbl_punktdaten b where a.cnt_bearbeiter = b.int_bearbeiter and
inv_pt_id_sub = :P4_PTIDS
union select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter where int_behoerde in (SELECT
CNT_REGIERUNGSBEZIRK FROM TBL_REGIERUNGSBEZIRK where STR_REGIERUNGSBEZIRK = lower (:app_user))Bye,
Seb -
Order in a Select List based in a LOV is wrong
I have a select list based upon a LOV SQL Query.
Values in table are:
FIELD
001
002
003
AAA
when I make query in SQL Workshop:
select FIELD from TABLE order by FIELD;
I get
001
002
003
AAA
But when I make a similar query in LOV the result is in the select list
AAA
001
002
003
Someone knows what is happening?
Thank
Andermhichwa wrote:
It looks like your application is running a different sort / NLS preference then is the SQL workshop. Is there a chance your application identifies a language that sorts differently then default APEX. I am just guessing but it could explain this behavior.OK, I think something like this is happening because my Oracle instance have SPANISH like a NLS_LANG parameter, but why is different result between sql Workshop and LOV query, I have installed english and spanish languages in my apex instance, I get the same problem in both cases.
Other curious think is that my min and max values are OK,
for example
BETWEEN: <select list 1> AND <select list 2>
default value for <select list 1> is
DECLARE
exitvalue varchar2(10);
BEGIN
select min(FIELD) into exitvalue
from TABLE
return (exitvalue);
END;
I get 001
default value for <select list 2> is
DECLARE
exitvalue varchar2(10);
BEGIN
select max(FIELD) into exitvalue
from TABLE
return (exitvalue);
END;
I get AAA
But select list are ordered like
AAA
001
002
003
I have based select list in a lot of different sql ways
select FIELD from TABLE ORDER BY FIELD
select FIELD from TABLE ORDER BY 1
select FIELD from TABLE ORDER BY FIELD ASC
select FIELD from TABLE ORDER BY 1 ASC
Other extraneous think is that I use DESC order I get
003
002
001
AAA
Thanks
Edited by: user10999912 on 24-Jul-2010 08:07 -
Dynamic Select List - XML and umlaut
Hi, I've recently implement a dynamic select list as per [this thread|http://forums.oracle.com/forums/thread.jspa?threadID=327306], however it seems to break if I have any words containing an umlaut. I've tried setting the header on the Application Process to UTF-8 (OWA_UTIL.mime_header ('text/xml', FALSE, 'utf-8');) but it doesn't seem to make any difference. The word in particular giving me problems is Kühne - it's the only non english entry so far, but I would expect others in the future.
Does anyone have any ideas how to allow this character to be parsed correctly? Short of using replace to check for this and every other possible character I'm not sure what else to do.
ThanksPete88 wrote:
Hello
I would like to create a dynamic select list where you can start entering a name and select list reduces with each character entered.
E.g. A list of towns in the UK where you want to select London. This list is delay as normal and as start typing by the time you have entered “Lon” the list only has few names starting with “Lon”
I expect I need a JavaScript to active this?Not in APEX 4.x. Use a Text Field with autocomplete item. -
Dynamic Select List in Reports
Hi,
I have come across solutions to implement dynamic Select Lists. But can the same be implemented in a report.
I have a report of 2 columns which are select lists. The Value of one depends of the other.
Can this be done?
Thanks in AdvanceHi Abdullah,
Thanks for the Tip. However, couple of queries.
1) The first modification involves changing the query to : select lov_pkg.savekey() , colA, colB, ... But the function savekey takes a value.
Ideally, I need this function to be called while loading and when the first select list is changed. How can this be done.
2) Also, To make this change in query, I had to use (Use Generic Column Names (parse query at runtime only)) option. Now my Add Row button doesnt work? Can you tell me how that can be customized.
Thanks,
Sunil -
Dynamic select list crashes with php
HI All,
I can't seem to get a dynamic select list to work in
dreamweaver. It completly crashes everytime I try adding it to my
page. I found someone else in the forum who had the same problem
but no one ever responded. I've tried several things including
putting just the record set and dynamic select on it's own page
with no other code on it. It still crashes DW. I also tried coding
it myself by making a listmenu and modifying it so that the option
value equals a PHP echo of a value. It crashed there too. Does
anyone have a piece of code with a working dynamic select list that
uses a record set that I could look at? That way I can see where
I'm going wrong. All I'm trying to do is get a simple drop down
select list of employee names so someone can choose their name to
get commission. It's a one table, 2 fields (first & last name)
record set.
Using DW CS3, php & MySQL.,windows XP Pro
Any help would be really appreciated!AthroughZ wrote:
> I can't seem to get a dynamic select list to work in
dreamweaver. It
> completly crashes everytime I try adding it to my page.
It looks as though you have a corrupt cache file. Follow
troubleshooting
step 4 in the following technote:
http://www.adobe.com/go/tn_19105
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS4",
"PHP Solutions" & "PHP Object-Oriented Solutions"
http://foundationphp.com/ -
Dynamic select list with display,return val & join condition issue.
hello,
I am having a dynamic select list with display, return value
say for example my select statement is
select distinct dname d, deptno r
from dept dt
right join emp e on (e.deptno=dt.deptno)
where (condition)
when i tried this query for my select list, it is not working. It saying that
" LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query. "
I am not able to understand the problem. Can anyone help me out with this issue?
thanks.Shouldn't your join have dept as the driving table?
select distinct dname d, deptno r
from dept dt
right join emp e on (dt.deptno = e.deptno)
where (condition)
Or using older Oracle standard join
select distinct dname d, deptno r
from dept dt, emp e
where (dt.deptno (+) = e.deptno) AND (OTHER WHERE condition)
OR
(Since a right join is just getting the values from the driving table that are NOT in the associated table)
select distinct dname d, deptno r
from dept dt
WHERE dt deptno NOT IN (SELECT deptno FROM emp) AND (OTHER where condition)
Thank you,
Tony Miller
Webster, TX -
Dynamic select list: link to another page
Hi
Have following dynamic select list at the bottom in "product.php" page (www.dolls.com.sg)
<div id="selectcat">
<select name="Categories">
<?php
do {
?>
<option value="<?php echo $row_rsCategories['categoryName']?>"<?php if (!(strcmp($row_rsCategories['categoryName'], $row_rsCategories['categoryName']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsCategories['categoryName']?></option>
<?php
} while ($row_rsCategories = mysql_fetch_assoc($rsCategories));
$rows = mysql_num_rows($rsCategories);
if($rows > 0) {
mysql_data_seek($rsCategories, 0);
$row_rsCategories = mysql_fetch_assoc($rsCategories);
?>
</select>
My target is, whenever a visitor clicks on a category in the pull down menu, he is forwarded to the respective "categories.php" page.
How can I do that?
Thanks
HelmutChange your code to this:
<div id="selectcat">
<form method="get" action="categories.php">
<select name="Categories">
<?php
do {
?>
<option value="<?php echo $row_rsCategories['categoryName']?>">
<?php echo $row_rsCategories['categoryName']?></option>
<?php
} while ($row_rsCategories = mysql_fetch_assoc($rsCategories));
$rows = mysql_num_rows($rsCategories);
if($rows > 0) {
mysql_data_seek($rsCategories, 0);
$row_rsCategories = mysql_fetch_assoc($rsCategories);
?>
</select>
<input type="submit" value="View Dolls">
</form>
</div>
In categories.php, use $_GET['Categories'] to filter the recordset.
Maybe you are looking for
-
Adobe Photoshop CS5 Support is stonewalling me
They are saving a problem is on my machine my preferences corrupt they have me reset them and then they had me create a new user account with administrator authority and the bug is still solid. Noel if your reading this would you plaese make a simpl
-
LCD Displays for T20, T21, and T23
Have three T20 and T21 laptops with bad mother boards and good LCD displays. Have two T23 laptops with good motherboards and blank LCD displays (but work great with an external monitor). Can T20 and T21 LCD displays be removed and installed and oper
-
when i turn on my ipod on it says use itunes to restore, when i plug it into my comp. it goes through the steps to restore it and says it has been restored but does not disconnect from the computer, i left it hooked up for 12 hours and nothing happen
-
RFC function : passing a table as input
Hi, I have no trouble passing input values to an RFC model in web dynpro, but I have difficulties to pass an input table. By default, the input "it_table" node of the model I use, is defined like this : card 0..n, selec 0..1 Singleton True. Do I have
-
Photoshop CS5 installation problem
Hi there, I had PS4 and PS5 co-existing without problems on my system. Finally, I decided yesterday to uninstall PS CS4 since all my plug-ins are now available for CS5. I removed CS4 using CleanMyMac, which unfortunately also uninstalled CS5. No prob