LOV with YEARS
I want to display in any way (LOV or DATE PICKER) on a numeric field which should have years from 1950 to 2006.
Is there any predefined way (PICKER) or have to make a function and put result in LOV?
THX!
One option is to create a table with the years in it combined with a scheduled DBMS_JOB to add another year record at the appropriate time.
Another thing to look into s the use of the TABLE function. I cannot get HTML DB to accept the SELECT statement for the LOV.
CREATE OR REPLACE TYPE num_table IS TABLE OF NUMBER;
CREATE OR REPLACE FUNCTION f_table RETURN num_table
IS
v_numarray num_table := num_table();
BEGIN
FOR i IN 1 .. To_Number(To_Char(SYSDATE,'YYYY')) - (1950-1) LOOP
v_numarray.EXTEND;
v_numarray(i) := 1950+i-1;
END LOOP;
RETURN(v_numarray);
END;
/The problem is I cannot get HTML DB to allow an LOV of
SELECT column_value r, column_value d
FROM TABLE(f_table)HTML DB (PL/SQL) is seeing the TABLE cast operator as an in-line query. I event create a view over this query and still had the error message
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.Maybe one of the HTLM DB support people can help with the use of the TABLE cast operator in an HTML DB LOV SELECT statement?
Mike
Similar Messages
-
Using LOV with Validation on the Numeric Fields results in Error
Dear JHeadstart Team,
During my work with lov I encountered another problem. I defined a lov and attached the lov to a numeric field and check the LOV for validation. Now when I use LOV using the LOV button it works fine but when I enter some numbers and then press tab the LOV was not shown correctly and resulted in the following errors and the worst thing is that you can not navigate to any other pages and all try to navigate to other pages results in errors too. When we put the same LOV on a string field (which is not desirable for us) it worked fine.
It seems to me like a bug. Am I right? Is ther any solution or workaround for this problem?
Thanks in advance,
Navid
16:31:29 DEBUG (LovItemBean) -Cleared value of item HrTrainingCourseSchedulesTitle
16:31:29 DEBUG (LovItemBean) -Cleared value binding #{bindings.HrTrainingCourseSchedulesTitle.inputValue} of item HrTrainingCourseSchedulesTitle
16:31:29 ERROR (ApplyRequestValuesPhase) -java.lang.ClassCastException: java.lang.Long
javax.faces.el.EvaluationException: java.lang.ClassCastException: java.lang.Long
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
at oracle.adf.view.faces.component.UIXComponentBase.__broadcast(UIXComponentBase.java:1079)
at oracle.adf.view.faces.component.UIXEditableValue.broadcast(UIXEditableValue.java:247)
at oracle.adf.view.faces.component.UIXSelectInput.broadcast(UIXSelectInput.java:215)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:249)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:307)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at com.pooya.controller.jsf.PooyaAuthenticationFilter.doFilter(PooyaAuthenticationFilter.java:256)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassCastException: java.lang.Long
at oracle.jheadstart.controller.jsf.bean.LovItemBean.validateWithLov(LovItemBean.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
... 31 moreHi Navid,
We ran into the same bug and have the next workaround for it:
We extended the JHeadstart class 'LovItemBean' and we have overridden the method 'validateWithLov(...)' with:
public void validateWithLov(ValueChangeEvent valueChangeEvent)
Object newValue = valueChangeEvent.getNewValue();
if(newValue != null && !(newValue instanceof String))
newValue = newValue.toString();
ValueChangeEvent newEvent = new ValueChangeEvent(valueChangeEvent.getComponent(), valueChangeEvent.getOldValue(), newValue);
newEvent.setPhaseId(valueChangeEvent.getPhaseId());
super.validateWithLov(newEvent);
else
super.validateWithLov(valueChangeEvent);
}Next step is to use a custom template in your JHeaedstart Application Structure file for 'LOV_ITEM_BEAN'. In this custom template you should use your own class as 'managed-bean-class' instead of the default JHeadstart one.
Now you can safely generate LOV with validation of number fields.
Maybe something the JHeadstart can pcik up in the next release of JHeadstart :-)
Hope this helps.
Pascal -
Using LOV with bind var as custom attribute?
I have an Portal LOV which uses a bind variable.
Can I use this LOV as a custom attribute? If so, how do I specific the bind variable value?
In the display option of the attribute I tried LOV_NAME(LOV_Bind => 'value'), but the LOV is not applied.It's been quite a while, but I think I remember trying this and not being able to achieve it. You can use a LOV with a bind variable in a report or in a form, or similar, but there is no way in an item to from specify where to get the bind variable. My suggestion if this is a requirement would be to use a portal form which submits to a stored procedure or pl/sql generated form to gather the attributes and then programmatically create the item using the APIs. Takes a bit of work, but gets you exactly what you described above.
Rgds/Mark M. -
LOV with subselect shows return_value instead of display_value
Hi,
I have the following dynamic SQL based LOV with a union in it that does not display correctly in the application.
SELECT role_name d, role_seq r
FROM apex_app_roles ar
WHERE security_level = 1
AND :F2500_APP_USER in
(SELECT au.user_id FROM
apex_app_user au,
apex_app_user_roles auar
WHERE ar.role_seq = auar.role_seq
AND auar.user_seq = au.user_seq)
UNION
SELECT role_name d, role_seq r
FROM APEX_APP_ROLES ar
WHERE security_level = 0
ORDER BY 1
The problem I have is the first part of the SQL is displaying the return_value instead of the display_value. If I comment out the following the proper value is displayed in the application.
AND :F2500_APP_USER in
(SELECT au.user_id FROM
apex_app_user au,
apex_app_user_roles auar
WHERE ar.role_seq = auar.role_seq
AND auar.user_seq = au.user_seq)
We currently have version 4.0.1.00.03 installed.
Is there an issue with this version and what I am trying to do or is there something wrong with what I'm doing? The SQL returns the proper results if I run it in the SQL workshop so I'm at a loss here and if anyone can help it would be greatly appreciated.
Thanks,
BruceThe value is correct. I can run the entire SQL in workshop using parameter substitutions and it returns all the values correctly. So running this
SELECT role_name d, role_seq r
FROM apex_app_roles ar
WHERE security_level = 1
AND :F2500_APP_USER in
(SELECT au.user_id FROM
apex_app_user au,
apex_app_user_roles auar
WHERE ar.role_seq = auar.role_seq
AND auar.user_seq = au.user_seq)
UNION
SELECT role_name d, role_seq r
FROM APEX_APP_ROLES ar
WHERE security_level = 0
ORDER BY 1
returns all the rows and looks like this.
D R
ACP_ADMIN 3
READ_ONLY 2
READ_WRITE_ALL 1
SERVICE_DESK_ADMIN 4 -
How Get the column name of LOV with code??
Hi i now that exist a SET_COLUMN and i cant change the value the any column, now i want to know the value column in the LOV in any moment. Somebody us made that? i contact a metalink and their tell me that is not possible that not exist a GET....
Thanks.yea but i am not used record group only a LOV with values static. you thiks that i know the values is true but i need with code change the values but before i need know the value.
-
LOV with custom popup in af:query
Hi,
We have a use case where we need to display an LOV field in Search Panel (af:query). But, the LOV in Search Panel should be displayed with a custom popup.
Is it possible display a field in Search Panel as input LOV with custom popup ?Hi,
Is it possible display a field in Search Panel as input LOV with custom popup ?
Yes. You assign a LOV definition to the attribute that then you display in the af:query component. You can also have dependnet LOV implemented this way. However, you cannot have a custom (your own) list of value popup dialog used
See page 8 and following in http://www.oracle.com/technetwork/developer-tools/adf/learnmore/jan2011-otn-harvest-300940.pdf
Frank
Edited by: Frank Nimphius on Jun 29, 2011 11:36 AM -
Creating LOV with Where clause
I'm trying to create a list of values from a select statementsomething like this
select customer_name, customer_number from customer
where Region = 'WEST';
I'm able to create a list of values of all the customers and numbers, but I could not
create a lov for a specific subset of that data, such as in the where clause.
Is it possible to create a LOV with a where clause?Use bind variables to accept the region parameter. Also, it is good practice to accept a null parameter value. If your parameter is null, display the entire list of values. Your query would look something like this:
select customer_name, customer_number from customer
where Region = :region_name or
:region_name is null;
Regards,
Jay Mason -
Fill the LOV with data during the execution
Hi
I am using Oracle 10g
I want to ask please if there is a way to fill the LOV with data during the execution
so can I change the query specified in LOV wizard during the execution and get a new record set according to the value in the text boxes
thank you for helpYou can use the SET_LOV_PROPERTY built-in to change the record group of the LOV and to create a new record group you can use the CREATE_GROUP_FROM_QUERY built-in.
it will be something like this.
RG_ID := FIND_GROUP('<record group name>');
IF NOT ID_NULL(RG_ID) THEN
DELETE_GROUP(RG_ID);
END IF ;
RG_ID := CREATE_GROUP_FROM_QUERY('<record group name>', '<your SQL statement here>');
POP_GROUP := POPULATE_GROUP('<record group name>');
SET_LOV_PROPERTY('<LOV name>', GROUP_NAME, '<record group name>');Use the online help for more information about these built-ins.
Tony -
LIST MANAGER - Replace popup lov - with stationary scrollable box
Sorry... I thought this was Oracle 10g XE form...could you direct me to right form.
LIST MANAGER - Replace popup lov - with stationary scrollable box...
The end result would be: 2 scrollable list boxes separated by the word ADD / REMOVE. One to select from and the other box to act as collection box
The popup LOV is quick and fast ..but is a little time consuming
Oracle 10g XE
Message was edited by:
user518110Hi user518110,
1) please update your forum handler to a more friendlier name.
2) I think your are looking for the Shuttle component in Oracle APEX, like on the following page http://apex.oracle.com/pls/otn/f?p=2672:2
If you are using Oracle XE you are probably using Oracle APEX 2.1, you have to upgrade this version to Oracle APEX 3.0 which contains this new control. See http://www.oracle.com/technology/products/database/application_express/html/3.0.1_and_xe.html for details.
Patrick
My APEX Blog: http://www.inside-oracle-apex.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://apexplugin.sourceforge.net/ New! -
Very Urgent!! Static LOV with Sort by Option with column names
Hi All,
Can we have am Static LOV with an order by option according to the column names in an Report..
If so can you share with me, waiting for your reply and thanks in Advance..
Select
name,
creator,
date_created,
NVL(Comp_type,Del_TYPE) FORMAT,
from Table_name
So i want to order by the following columns wrt Static Lov both Assending and Descending Order by
like Name(Asc), Name(Desc),Creator(Asc),Creator(Desc) and so on for other columns
Thanks and Regards,
Suriwhere u are callling perform field_cat in ur program ?
flow will be like this
perform fcat.
perform alv_display.
form fcat.
add code here for fcat.
endform.
form alv_display.
call alv here
endform.
Regards
Peram -
How To Replace LOVs With Buttons
Hi all,
can someone please advise if it is possible to replace LOVs with Buttons? Customer has a requirement to replace the LOVs with buttons in Compensation Manager to approve/reject the paysheet. This is for R12.1.3.
Many thanks
AmandaHi,
1) First create a new region of LOV type.
2) Then under flowlayout region, add lov action button. On its 'External LOV' property, give the path of lov region created in step1.
3) Right click on 'lov action button' to add 'lovActionMappings'.
--Sushant -
I have two LOV s one in the mainform and one in the subform. If I select one category from the list in the mainform LOV. In the subform LOV has to change it's record group (3 record groups) depending on the category selected in the mainform LOV. Please help. I am pasting the code I wrote. I tried it in the NEW ITEM INSTANCE TRIGGER, NEW BLOCK INSTANCE TRIGGER (datablock for the 2nd LOV with 3 record groups) and in the NEW FORM INSTANCE TRIGGER. Please help. Thank you.
DECLARE
lov_id1 LOV;
--val boolean;
rg_id1 RECORDGROUP;
rg_id2 RECORDGROUP;
rg_id3 RECORDGROUP;
BEGIN
lov_id1 := FIND_LOV ('ACTIVITYTYPE_LOV');
rg_id1 := FIND_GROUP('ACTIVITYTYPE_RG1');
rg_id2 := FIND_GROUP('ACTIVITYTYPE_RG2');
rg_id3 := FIND_GROUP('ACTIVITYTYPE_RG3');
-- val := SHOW_LOV(lov_id1, 32, 48);
IF
GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1' AND :YOUTH_GOALS.GOAL_TYPE = 'EXIT COUNSELING'
THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id1');
ELSIF
GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1' AND :YOUTH_GOALS.GOAL_TYPE = 'COMPLETE TRAINING'
THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id1');
ELSIF
GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1' AND :YOUTH_GOALS.GOAL_TYPE = 'VOCATIONAL TRAINING'
THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id2');
ELSIF
:YOUTH_GOALS.GOAL_TYPE = 'GRADUATE FROM HIGH SCHOOL'AND GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1'
THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id2');
ELSIF
:YOUTH_GOALS.GOAL_TYPE = 'IMPROVE ACADEMIC PERFORMANCE'AND GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1'
THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id2');
ELSIF
:YOUTH_GOALS.GOAL_TYPE = 'OBTAIN GED'AND GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1'
THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id2');
ELSIF
:YOUTH_GOALS.GOAL_TYPE = 'NON-ACADEMIC'AND GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1'
THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id3');
END IF;
end;try on when-validate-item or on POST-CHANGE
Regards,
Danish Hayder -
Hi,
I am able to show the LOV and the description, but the parameter will be like this
state code state name
MD Maryland
SELECT ...
From ...
WHERE state_code = 'MD Maryland'
Is there any way to display the LOV with description, but only the selected LOV will be used for the parameter? For example,
SELECT ...
From ...
WHERE state_code = 'MD'
Thanks,You can accomplish this by doing the following:
(1) Create a Calculation of the field .. example..if the column name is StateDescription, then create a calculation called StateID where the formula is SUBSTR(StateDescription,1,2). Be sure to have StateID clicked off so that it won't display on the worksheet.
(2) Under Parameters, create the parameter based on the column StateID (which (1) above makes only the first 2 characters of StateDescription).
Is this what you were wanting?
Kerry Brannen -
Hello,
i am very much New to Forms 6i
Please tell me that, can we attach a LOV with a 'Display Item' ..??1) Create a display item named DISPLAY_EMPID and set the data type according to EMPLOYEE_ID.
2) Create LOV using LOV wizard and include any columns you want to see in the list. You may use query like below.
SELECT employee_id, name FROM YourTable3) In LOV wizard, click the "Lookup Return Item" button and select :YourBlock.DISPLAY_EMPID and FINISH.
4) Create a button just beside the text item.
5) Write below code behind the WHEN-BUTTON-PRESSED trigger.
DECLARE
vtemp BOOLEAN;
BEGIN
vtemp := SHOW_LOV('NAME_OF_YOUR_LOV');
END;It should return the selected value from LOV to the DISPLAY_EMPID. -
Hi,
I would like to create a dynamic LOV with all the colors in it (return value should be the color-code).
One can create a small table with all color-codes, but that's the easy part.
What would be the syntax of the dynamic LOV?
reg.
ChrisHi Todd,
Working from Apex 3.0 there is also a item-type "color picker" wich also solves the problem (as mentioned in your link from Andy).
Thanx.
reg.
Chris
Maybe you are looking for
-
I have the macbook pro early 2011 15inch. i7 processor, 500gb hard drive, and 4gb ram and have Moutain lion installed. The computer takes a good minute to boot to the login screen and then probably another 30 - 45 seconds to actually login and be abl
-
I think xslt has some bugs. The "value-of" statement in stylesheet does'nt seem to work properly. I tried to execute the same things(with same stylesheet and xml document) outside oracle, and it is working perfectly fine. So I've created a simple-to-
-
Hi i was updating to ios 6 but my phone looks locked it is giving me a pic for us pointing to iTunes , what this means ?>??
-
I have an old Mac G4 with 3 120G internal drives installed. One of them is failing and needs to be removed from the machine. Here's the dumb question... how can I tell which one it is? Disk Utility and Disk Warrior report the same (serial?) number fo
-
Tns_alias: ODI can not establish connection to DB with tns_alias
Hello everyone I have a question again. Problem: ODI can not establish connection to DB with <tns_alias> Envirionment: there is remote computer with Oracle DB (tns_alias) (connection works - tested) there is another remote computer with Oracle DB (si