Question For Vikas: Select List Colors
Vikas,
I've seen somewhere
you posted a site:
http://htmldb.oracle.com/pls/otn/f?p=24317:104
Can you still do that with an htmldb_item.select_list?
If yes how can you do that because I've been struggling
for weeks to find this answer and all of a sudden now
I've seen your example
Thank you
My example is a variant of the master's example (Carl Backstrom) of a similar nature.
Basically, the styling is done with a Javascript in the region footer, so you can apply it to anything. The code is
var pThis = document.getElementById('P104_SELECT');
var pThose = pThis.getElementsByTagName('OPTION');
for(var j=0;j < pThose.length;j++){
pThose[j].style.background = pThose[j].value;
}Basically, the select list option value itself is the color name.
Things get a little trickier in a tabular form because you have many select lists, but I think the basic concept should hold good. The above code just grabs a specific select list and loops over its options. You would need to wrap it in another loop to grab all the select lists in your tabular form and do the same thing.
Hope this helps.
Similar Messages
-
Security Questions from a Select List or Drop down Service Provider Edition
Hello,
Can we fetch security questions from the drop down or a select list in Service Provider Edition. We have a requirement to select multiple security questions during registration.
Please advise.
Regards
VinodHI
Welcome to the Forum...
You cannot put all the values in a single parameter field so you need to select each field for each parameter...
Better you post it in this link for more reponses:
Reporting and Printing -
Question on Dynamic Select Lists and Checkboxes
Hello,
I am new to APEX, and this is my first posting, I have a question about how to implement dynamic checkboxes from a select list.
Basically I would have a select list, and based on what item is selected a set of checkboxes would appear.
I was originally using the Select and Submit property on the select box, which works fine, all of the checkboxes appear appropriately. But the thing is, APEX refreshes the page each time, and since this select box is lower in the page, the user would have to scroll all the way down to where they were before.
The main requirement is so that the user won't have to scroll down the that position where the select box is each time they select a new option.
So a work around attempt is to create a javascript that will automatically scroll down to that position on page load ...
i.e.
function pageScroll() {
window.scrollBy(0,50);
But that didn't work, because for some reason the javascript wasn't appearing.
Is there a way to either:
1. Have a dynamic checkbox appear using ajax? -or-
2. Have the javascript scrolling effect
Sorry if this is a confusing question, I was wondering if anyone else came across this issue.
Thanks in advance!!Since this Select List plays such an important role on the page, why not create a side-region and put that select list there so you don't have to overwhelm the user and his 'persistence of vision ' with a page that scrolls all by itself to the 1000th line to, then , change the options ?
just an idea. -
Ajax code help for conditional select list.
Hi,
I am using AJAX code for the first time, I dont have knowledge in java, I just grabbed the code from this forum and trying to manipulate to my requirement.
My Requirement is I have two select lists, 1) host_name and 2) database_name.
As soon as I pick/choose the value in host_name select list, I need to populate only those databases on that particular host. I dont want to submit the page for this action.
Here is the code, I appreciate if some one can help.
On demand Application Process code:
declare
l_counter number;
l_o_name varchar2(2000);
begin
owa_util.mime_header('text/xml', FALSE );
htp.p('Cache-Control: no-cache');
htp.p('Pragma: no-cache');
owa_util.http_header_close;
htp.prn('<select>');
for rec in (select "ORA_DATABASES_VW"."DATABASE_NAME" as "DATABASE_NAME",
"ORA_DATABASES_VW"."DB_ID" as "DB_ID"
from "ORA_DATABASES_VW"
where "ORA_DATABASES_VW"."HOST_NAME" = :TEMP_ITEM)
loop
htp.prn('<option value="' || rec.db_id || '">' || rec.database_name || '</option>');
end loop;
htp.prn('</select>');
end;
HTML Header on that page:
=================
<script language="JavaScript1.1" type="text/javascript">
function get_List_XML (source_item,target_item){
var v_Target = html_GetElement(target_item);
var v_Source = html_GetElement(source_item);
var ajaxResult = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=POPULATE_LIST_XML',0);
ajaxResult.add('TEMP_ITEM',source_item.value);
var v_result_xml = ajaxResult.get('XML');
if(v_result_xml && v_Target)
var options_Contents = v_result_xml.getElementsByTagName("option");
v_Count = options_Contents.length;
v_Target.length = 0;
for(var i=0;i<v_Count;i++)
var v_opt_xml = v_result_xml.getElementsByTagName("option");
appendToSelect(v_Target, v_opt_xml.getAttribute ('value'),v_opt_xml.firstChild.nodeValue)
function appendToSelect(target_item, option_val, option_content) {
var v_Opt = document.createElement("option");
v_Opt.option_value = option_val;
if(document.all){
target_item.options.add(v_Opt);
v_Opt.innerText = option_content;
}else{
v_Opt.appendChild(document.createTextNode(option_content));
target_item.appendChild(v_Opt);
</script>
Form element attribute in the host_name column. P935_INSTANCE_DB_NAME is my page item for database_name.
onchange="get_List_XML (this,'P935_INSTANCE_DB_NAME')"Here is the code, Hope I had put it correctly now.
This is fixed now. Thanks a lot for helping out this. I have two questions.
1) I am seeing very slowness when selecting the select list. Will these java code require much resource?
2) I need to put this logic in many screens for many columns. So having these many application process and application items and java code, will the application performance get a hit? I know that application process are on-demand and get called only when required.
declare
l_counter number;
l_o_name varchar2(2000);
begin
owa_util.mime_header('text/xml', FALSE );
htp.p('Cache-Control: no-cache');
htp.p('Pragma: no-cache');
owa_util.http_header_close;
htp.prn('<select>');
for rec in (select "ORA_DATABASES_VW"."DATABASE_NAME" as "DATABASE_NAME",
"ORA_DATABASES_VW"."DB_ID" as "DB_ID"
from "ORA_DATABASES_VW"
where "ORA_DATABASES_VW"."HOST_NAME" = :TEMP_ITEM)
loop
htp.prn('<option value="' || rec.db_id || '">' || rec.database_name || '</option>');
end loop;
htp.prn('</select>');
end;
HTML Header on that page:
=================
<script language="JavaScript1.1" type="text/javascript">
function get_List_XML (source_item,target_item){
var v_Target = html_GetElement(target_item);
var v_Source = html_GetElement(source_item);
var ajaxResult = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=POPULATE_LIST_XML',0);
ajaxResult.add('TEMP_ITEM',source_item.value);
var v_result_xml = ajaxResult.get('XML');
if(v_result_xml && v_Target)
var options_Contents = v_result_xml.getElementsByTagName("option");
v_Count = options_Contents.length;
v_Target.length = 0;
for(var i=0;i<v_Count;i++)
var v_opt_xml = v_result_xml.getElementsByTagName("option");
appendToSelect(v_Target, v_opt_xml.getAttribute ('value'),v_opt_xml.firstChild.nodeValue)
function appendToSelect(target_item, option_val, option_content) {
var v_Opt = document.createElement("option");
v_Opt.option_value = option_val;
if(document.all){
target_item.options.add(v_Opt);
v_Opt.innerText = option_content;
}else{
v_Opt.appendChild(document.createTextNode(option_content));
target_item.appendChild(v_Opt);
</script>
Form element attribute in the host_name column. P935_INSTANCE_DB_NAME is my page item for database_name.
onchange="get_List_XML (this,'P935_INSTANCE_DB_NAME')"
} -
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 -
What is Maximum size for Multi select list?
Hi,
We are using the select_list_from_query given " size=10 attribute " so getting as multiselect list ,but there is a constraint for multiselect list where we can display only 1000 values max i guess,I have around 10,000values to display in list but getting error as given below , how can i overcome this problem in apex?? please suggest me..
getting error saying : ORA-06502: PL/SQL numeric or value error: character string buffer too small
Thanks
Anoo
Edited by: Anoo on Sep 2, 2009 8:00 AM
Edited by: Anoo on Sep 2, 2009 8:06 AMFirst of all, I wouldn't use a multiselect list but a shuttle item since this is much better from the handling point of view. Second, the Patrick's comment is valid. You could use the filetering on the shuttle like in this example
http://apex.oracle.com/pls/otn/f?p=31517:166
where your approach would be to show no results by default and give a user a chance to reduce the nubmer of options by choosing some groups from a select list or by typing in some sting.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
I need a recommendation for a selectable list/webrowser
Ok, so I'm trying to make a swing object that has a selectable list...so when you select an item, it will copy some text to a text box, but if you double click it, it will go to a web page. I also need a back button that goes back to the list...does anyone have any recommendations?
does anyone have any recommendations?1. [Learn Java|http://java.sun.com/docs/books/tutorial/index.html]
2. [Learn Swing|http://java.sun.com/docs/books/tutorial/uiswing/index.html]
3. [Learn to ask questions the smart way|http://catb.org/~esr/faqs/smart-questions.html]
db -
Scripting Question for Remote & Command list
There must be some info on the commands / functions allowed for DVDSP scripting. For instance, how does one know ran = random. div = divide. Can you please point me in that direction. Note: already looked at the 2 tutorial sites suggested and the book authors mentioned, and while those were helpful looking for a comprehensive list, or at least some list like so many of my other programming books contain.
More advanced question: Does anyone know the scripting conversion for the remote control. For example
if remote = play jump end....
or
if controller = next jump start...
Not sure what the code would look like, but it must be fairly simple, and someone must know the answer:)
Thanks!!!No probs. If you're more specific we could maybe help more. I mean you could write a script and then make the button target that script, or make all buttons target a script and make decisions based on which button was pressed... but there isn't always much point cause you dont have the interactivity level you do with Flash/Director,
-jake
P.S Thanks for coming back to the thread. To help the new system, when you feel the question has been answered can you mark it answered/helpful etc, cheers. -
How do I get the list index for the selected list item
How can I obtain the list index for the currently selected
element in a list item? I'm trying to move the label and value
from on list box to another by using the add_list_element built-
in and it requires the list index.
Thanks for your help...Hi,
You can`t get the Index for the selected item..
you can get the Value of then Tlist using :Block.ListName .
maybe theis code will help you..
PROCEDURE pr_PasarElementos(ls_Origen varchar2, ls_destino varchar2, cValor varchar2 default null) IS
nCont_Orig number := 0;
nCont_Dest number := 0;
begin
nCont_Orig := GET_LIST_ELEMENT_COUNT(ls_Origen); nCont_Dest := GET_LIST_ELEMENT_COUNT(ls_destino);
Add_List_Element(ls_destino,nCont_Dest+1,cValor,cValor);
for rec_Orig in 1..nCont_Orig loop
if GET_LIST_ELEMENT_VALUE(ls_Origen,rec_Orig) = cValor then
delete_list_element(ls_Origen,rec_Orig);
end if;
end loop;
end;
you can call the procedure with :
pr_pasarElementos('control.ls_activos','control.ls_inactivos',:CONTROL.ls_activos);
here I`m working with the Value equal to the Label... you would need to look for the Label of the origin (ls_Origen) list using the Value (cValor) you already have.
I hope this help you. -
Generic solution for cascading select lists/lovs
After implementing several times a select list/lov, which is depending on another item on the same page (see the AJAX example from Carl Backstrom), I thought that it was time to come up with a more generic solution where I don't have to implement javascript code and on-demand processes for each lov anymore.
I want to contribute my findings to the APEX community. More details about my solution can be found at
http://inside-apex.blogspot.com/2006/11/generic-solution-for-depending-select.html
Any feedback is welcome!
Patrick
My APEX blog http://inside-apex.blogspot.comHi Bjorn,
the "First schema provisioned" property is just available in "normal" workspaces, not in the "internal" workspace. But it's just the schema-name where the tables/... of your application are stored.
About your problem. Which version do you use? V2.0?
V2.0 doesn't have the APEX dictionary views, I think they have been created in V2.2.
So the only way to use my solution is to use the version which is stored into the FLOWS_... schema. But it has to be modified before.
1.) In the ApexLib.js file, all ocurrences of $x have to be replaced by html_GetElement => $x doesn't exist in V2.0
2.) Replace the FLOWS_020200 thru FLOWS_020000 in the header of the package (ApexLib_for_flows_020200.pks and .pkb)
3) Maybe you have to remove the where-clause restriction NVL(UPPER(ITEM_COMMENT), '@') NOT LIKE '%$APEXLIB_IGNORE_LOV$%', I'm not sure if the comment column exists in V2.0. Don't have a possibility to check that now.
I will come up with a solution on sunday or monday.
Patrick -
Question for Vikas re. row higlight en click on row
Hello Vikas,
<br>I liked the options I noticed on some of your reports where the rows get a different colour when you mouseover them and also the possibility to click anywhere in a row.
<br>Can you please explain me in detail (step by step) how these functions work? I noticed you use javascript with mouseover, but I am not a programming wizzard in javascript. I also have no idea how to get this function in HTMLDB (I am still mastering this). <br>
Can you help me please?
<br><br>
Thanks,
<br>Jan Hulsing.You dont have to be a Javascript wizard for any of this, I certainly am not!
The row highlight on mouseover is a built-in feature of HTML DB that just has to be enabled by going to the Report Template page. For example:
1. Go to the Page Definition screen
2. In the right hand column (Shared Components), under Templates, all the templates used by various components on your page are listed.
3. Click on the Report template that you are interested in
4. Go to the Row Highlighting section on that page
5. Specify colors for the Background color for Checked row and Current row in #RRGGBB format
Thats it!
To click anywhere on the row, just follow the instructions I had in that other thread
Clicking anywhere on report row
Hope this helps. -
Question for the new List component
hello
I work with Oracle BI Publisher 11.1.1.5 anf firefox 3.6.17
I have a problem with the new component LIST.
i open the report SFO Passenger Count Report in the samples/11G overview/
I choose the tab named insight tab
i select Air china in the Air lines List
i select 2006 in the time list, ok for the report
if i select 2007, all the companies are deselected, i need to reselect air china.
How to avoid this behaviour ?
best regards
jean marchello
I work with Oracle BI Publisher 11.1.1.5 anf firefox 3.6.17
I have a problem with the new component LIST.
i open the report SFO Passenger Count Report in the samples/11G overview/
I choose the tab named insight tab
i select Air china in the Air lines List
i select 2006 in the time list, ok for the report
if i select 2007, all the companies are deselected, i need to reselect air china.
How to avoid this behaviour ?
best regards
jean marc -
Hi Vikas,
I am trying to replicate what you suggested at Re: Clicking anywhere on report row
for clicking anywhere on report row, but when I click on the row it does not seem to work.
this is how it looks like :-
http://htmldb.oracle.com/pls/otn/f?p=34936:1:2637298191314115544:::::
my query is :-
select
htmldb_item.radiogroup(1,deptno,:P1_DEPTNO,null,'onClick="location.href= ''f?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.::::P1_DEPTNO:'|| deptno ||''';" ') radio,
"DEPTNO",
"DNAME",
"LOC"
from "DEPT"
where
instr(upper("DNAME"),upper(nvl(:P1_REPORT_SEARCH,"DNAME"))) > 0 or
instr(upper("LOC"),upper(nvl(:P1_REPORT_SEARCH,"LOC"))) > 0
and the query which displays emp data is simply :
select *
from emp
where deptno = :P1_DEPTNO
It all seems to work fine if I do not use the click_Radio script.
thanks in advance for your help
VishalHow does this line build up the complete f?p type URL
and auto-magically copies all my parameters which I
setup for my EDIT button. ?As I said, the HTML DB engine generates the full f?p= URL with all your parameters and all for that Edit button. It renders the link as a clickable image with your choice of the Edit icon. I just piggybacked on to that generated URL (i.e. picked it up from the DOM)
Did you just see the source code for what the EDIT
button is doing and basically copied that ? I myself
could not find anything like that when I looked at
the HTML source code of the page.Sure you did. Just look at the HTML source of the page and see how the Edit link is rendered. Actually, you dont even have to View source, you can just hover your mouse over the Edit button and see the link.
What is the relevance of ('a')[0] in the command
above ?getElementsByTagName('a') returns an array (collection). In this case, there is only 1 A tag in the first column (pThis.firstChild). But since it returns an array, you need to reference the first element in the array [0].
So getElementsByTagName('a')[0] gives you the A node. Just pick the HREF attribute of this node to get your link. Voila! -
Question about multiple selection list
I can choose more than one item in my list by using the control key and then clicking on the items. The data is successfully stored in the SQL database separated by commas. If I then want to display the data to the user in the same list format, it doesn't highlight the selected items. I can of course show the selections in a text box, but that defeats the purpose of the list display since I would like users to be able to make changes to the list - and then do an update for example. Any suggestions? Is this supposed to work?
If it were PHP, I could help, but my knowledge of ASP is minimal.
Dreamweaver server behaviors can't do this for you. Basically, what you need to do is this:
The result from your database will be a comma-separated string containing the selected values.
You need to split that string into an array of individual values.
For each <option> tag, you check the values in the array against the current value. If there's a match, you insert selected="selected" into the <option> tag. -
How to make a fix width for a select list
APEX 4
good day everyone I have an apex_item selectlist. My question is How do I make a fix width on it?http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_item.htm#CHDHJJAB
APEX_ITEM.SELECT_LIST(
p_idx IN NUMBER,
p_value IN VARCHAR2 DEFAULT NULL,
p_list_values IN VARCHAR2 DEFAULT NULL,
p_attributes IN VARCHAR2 DEFAULT NULL,
p_show_null IN VARCHAR2 DEFAULT 'NO',
p_null_value IN VARCHAR2 DEFAULT '%NULL%',
p_null_text IN VARCHAR2 DEFAULT '%',
p_item_id IN VARCHAR2 DEFAULT NULL,
p_item_label IN VARCHAR2 DEFAULT NULL,
p_show_extra IN VARCHAR2 DEFAULT 'YES')
RETURN VARCHAR2;Specify
p_attributes => 'style="width: 200px;"'for a width of 200px.
Ta,
Trent
Maybe you are looking for
-
Job Cancelled with an error "Data does not match the job def: Job terminat"
Dear Friends, The following job is with respect to an inbound interface that transfers data into SAP. The file mist.txt is picked from the /FI/in directory of the application server and is moved to the /FI/work directory of application server for pro
-
Error in mail box work item not executable
HI, i build simple WF for approve and reject that send for user to sap inbox some decision ,when i check the inbox of the user and double click on the line i get some red triangle in the status Colman with error work item not executable, what can
-
Full Optimize Error - OutOfMemmory in SAP BPC
Hello Has anyone come across the following error when running a full Optimize from SAP BPC Administration. Error Message: Exception of type system OutOfMemoryException was thrown. I've raised a support call but would appreciate any help on knowing wh
-
How to display data in different xl sheets-urgent
hi all, i have an urgent requirement. any body can send me the sample code to display the data in different xlsheets. thanks, maheedhar.t
-
RFFOAVIS_FPAYM - assign to F110
Hi Gurus Please let me know how do we assign the RFFOAVIS _FPAYM to the F110 print out/ data medium tab for running the vendor payments through APP in a certain company code? Is there any limit in number of programs to be assigned to the F110 - print