SelectInputDate component in a search form - JDev 10.1.3.0.4

Cheers to all of you buddies in this valley of tears, have a good day
I have a table that contains a date column, and a search form to do "query by example" and its date field is a "selectInputDate" with its date chooser.
The date column in the table is formatted as yyyy-MM-dd (assigned in the underlying BO).
I assigned a "convertDateTime" with a pattern yyyy-MM-dd to the selectInputDate component.
At this point, the page works correctly. I select a date and get the appropiate results.
The problem rised when adding a validator to the "selectInputDate" component.
I added a "validateDatatimeRange" validator and binded the Maximum and Minimum values to two java.util.Date fields (minDate and maxDate) defined in a session managed bean named depSessionBean. The binding was done using EL as #{depSessionBean.minDate} and #{depSessionBean.maxDate}. The effect is that the date chooser only enables dates within the range (good).
The problem arises when I click on the "Execute" action button. All I get is a lovely error complaining about date conversions.
The attached converter returns a String that is correctly used to query the data but the validator expects a java.util.Date (it does not accept String values).
So, am I missing something? How can I get the converter and validator to work together?
Thanks a heap for any help.
A.Gurisatti
This is the error I get when executing the query (2006-08-14 is the chosen date):
500 Internal Server Error
oracle.adfinternal.view.faces.convert.ConvertException: Could not convert instance:2006-08-14 of type:class java.lang.String into type:class java.util.Date
     at oracle.adfinternal.view.faces.convert.GenericConverterFactory.convert(GenericConverterFactory.java:189)
     at oracle.adfinternal.view.faces.validator.DateTimeRangeValidator.validate(DateTimeRangeValidator.java:27)
     at oracle.adf.view.faces.component.UIXEditableValue.validateValue(UIXEditableValue.java:378)
     at oracle.adf.view.faces.component.UIXEditableValue.validate(UIXEditableValue.java:206)
     at oracle.adf.view.faces.component.UIXEditableValue._executeValidate(UIXEditableValue.java:522)
     at oracle.adf.view.faces.component.UIXEditableValue.processValidators(UIXEditableValue.java:302)
     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)
     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)
     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)
     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)
     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)
     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)
     at javax.faces.component.UIForm.processValidators(UIForm.java:170)
     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)
     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)
     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)
     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)
     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)
     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)
     at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:912)
     at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:342)
     at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:78)
     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[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
     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[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].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[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
     at java.lang.Thread.run(Thread.java:595)

Frank,
Thanks for your reply and yes I'm using BC (I allways forget that important piece of information).
Unfortunatelly I still have a few doubts:
- I suppose that assigning a pattern to a date column in a BO is for display purposes and in some cases to have the right conversions in where clauses. In this case, choosing yyyy-MM-dd (that is the default) is a coincidence and in this case, you are right it is superfluous. But suppose we use dd/MM/yyyy. In this case, the date will be rendered with this new pattern. Even more, I suppose that in a query by example, when building the where clause, JDev expects the given date to be a string with that same pattern (dd/MM/yyyy). So, we have the first conclusion: The selected date must be a String with the given pattern. That is why I assigned a converter to the selectInputDate component.
I did some tests and concluded: The patterns in the BO and in the converter assigned to the selectInputDate component must match or the query won't work.
The second step is to narrow the date range. The way I found to do it is by assigning a datetime validator to the selectInputDate component. This validator expects java.util.Date values for its min and max dates, and the date chooser works well (by enabling only dates between the given range).
The problem rises when you submit the form. At validation time you have: a date expressed as a formatted String (needed for the query) and a validator expecting a java.util.Date to perform the validation. So, you get a casting error.
All this is what I understood and concluded about the situation and, of course I could be completelly wrong.
If my steps for configuring the search parameters are correct, there must be a way to do the String - Date casting and avoid the error.
If my approach is wrong then there must be a correct approach for this kind of situation.
Thanks a lot for your help,
A. Gurisatti

Similar Messages

  • How to create a search form? - Jdev TP4 11.1.1.0.0

    Hi,
    I am using Jdev TP4 11.1.1.0.0.
    I have a af:table which is based on a view. I want to have a search form on top of this af:table to query based on the selection in the search form. I have 15 columns in the view. When I drag and drop the "All queriable attributes" from the named criteria I get all these columns in the search form. I need only 3 of the columns in the search form and the af:table should query based on the selection. How can I achieve this? Any help. Thanks in advance.

    You can create a new named query with only these three columns in the where clause and use that.
    Or you can drag the VO as a search form and remove the columns you don't need.

  • Jdev 10.1.13 EA1 - search form (BC + ADF faces) with date field

    Did anyone tried to make a simple search form with BC,( just draging view form control palette to faces page?)
    Because when i did it and tried to search by one date field (for example orderDate) i got exception:
    oracle.adfinternal.view.faces.convert.ConvertException: Could not convert instance:Wed Sep 07 00:00:00 CEST 2005 of type:class java.util.Date into type:class java.lang.String
    Is it a bug?
    I tried to use converDateTime component but it haven't fixed the problem.
    Bart.

    Hi,
    Business Components doesn't perform type conversion. This is the problem I see. Basicaly the expected format is String
    Could not convert instance:Wed Sep 07 00:00:00 CEST 2005 of type:class java.util.Date into type:class java.lang.String
    Is you date field really a date field ?
    Frank

  • ADF UIX Search Form - Is this a bug?

    I created a JDev 9.0.5.2 ADF UIX Search form from the component palette. I ran the page without making any changes. I chose the Find button which displayed the search criteria. I selected the delete button and then the create button, which created 2 blank records (possible bug?) in the search criteria table at the top. I selected one of the blank records and entered search criteria. I chose the submit button which changed the data in the search criteria table as it is supposed to do. I selected the other blank record, entered search criteria and submitted it. Again the data in the search criteria table was changed appropriately. I selected the delete button and the wrong record was deleted (bug?).
    Are these bugs?

    Hello,
    a similar sort of situation is created if you have a Read-only table on a page which drills down to an edit/create input form page. If you enable a create functionality you need to enable some way for the user to back out of the created record and clean up the newly created row. On the detail page (JobsEdit.do) i created a link to a custom event on the master page action (JobsView.do) like this:
    <button text="Cancel" destination="JobsView.do?event=cancelinput"/> In the Data Action class for the JobsView page i have a method defined as follows:
    public void onCancelinput(DataActionContext ctx)
        Row row = ctx.getBindingContainer().getApplicationModule().findViewObject("JobsView1").getCurrentRow();
        row.refresh(row.REFRESH_REMOVE_NEW_ROWS );
    }as a workaround, it sounds like you may need put some manual controls in place to tightly control any newly created rows which have/will not been used. I don't know if this will resolve the deleting wrong record problem...
    regards,
    Brenden

  • How to Enable the LOV to query for partial user entries in af:query in an ADF search form

    Hi guys,
    I have faced one issue in creating a search form in ADF, in that I have used af:query and table region. and I have attached an lov vo to the base vo for the list of values and given UI hint as Input values with List of values. Now the issue is that I have given auto submit property as true so when I give some value suppose "Jan-14" and tab out it gives me all the correct results. but if I give like "Jan%" and then tab out then it does not give me any value. Could you kindly help me with some solution. I am using Jdev 11.1.1.6.0.
    Thanks,
    Tanmoy

    To enable the LOV to query for partial user entries, we can trap the 'LaunchPopupListener' event and add custom code there. Within the af:query component, just wondering how can we set property the 'LaunchPopupListener' for the search criteria ?

  • How To create ADF Search form in JDeveloper 11g 11.1.1.0.1

    Hi,
    I am using JDeveloper 11g 11.1.1.0.1 , in which i tried creating an ADF search form that has Find and Execute Buttons.
    I created the same ADF search form using JDeveloper 11g TP3 and TP4 wherein it works fine but not in JDeveloper 11g 11.1.1.0.1.
    Scenario....
    I dragged a read only view object on to the jspx page as ADF Search Form and dragged the same as Read only table.
    After doing this if i run the application the search functionality does not happen .
    ( I click on the find button and enter the condition and then click on the execute button. records does not get filtered based on that condition specified.)
    But when the same steps is done in 11g TP3 and TP4 the search functionalty works fine.
    Can someone suggest me what is the issue.
    Is this a bug in the new release.
    regards
    vinitha

    reply is in this id
    ADF Searchform with find and execute buttons in JDev 11.1.1.0.1 studio edi.

  • List Of Value in search forms

    Hello,
    I am using ADF 11g
    I am trying to prepare a custom search form (not af:query component). I dragged and dropped a view object in data control to create a select one choice component. It is working good.
    But i am not able to have the LOV to have an empty item in the beginning.
    I already tried to edit the View definition, and selected "Include no selection item" in List UI Hints section, but in the page, select one choice still does not have an empty item in the beginning.
    What is missing here or what am i doing wrong ?
    Thanks

    List of values in 11 does not work as in 10.
    They need to be binded in model in specific view attribute.
    You can create a transient view object (i.e. select null as list_attr from dual)
    then you need to add to the attribute the list of value,
    then drag and drop ListAttr to the page

  • How can I show Search Form parameter values in URI of Results page?

    I have searched through these pages for posts relating to caching but haven't seen any that relate to my issue.
    We run a website that accesses data through search forms and returns matching data to the requester in a results page. The search criteria are entered in a form and the results page is generated by a servlet that gets the search parameter values that the user entered using the GET method.
    I would like rewrite this Search page using JDeveloper to bring our old code up to date and take advantage of new features that should help performance. In particular, I want to utilise the WebCache.
    To use the WebCache effectively, the cache needs to know what the search criteria were when it delivers a page so that repeated requests using the same criteria can be served directly from the cache.
    The data retrieved by a query may change from one search to to the next so I can't use time-based caching. But, I can use the WebCache Invalidation interface from the back-end DB server to flush old data out of the WebCache when it is changed, but to flush out the correct pages I need to know the parameter values passed.
    If I just follow the demos, it seems like the search parameters are all hidden in beans or something which means that the Web Cache can't be used for what I want. The parameter values are important.
    So my question is: is there a way of showing the search parameters used in the URI to the Results page? Can the old GET method of parameter passing be used (or can I somehow just put the old style parameters onto the URI?)
    Alternatively, is there a simple How To or Demo on how to use the Web Caching facility with JSF?
    (ADF Caching and Java Object caching do not seem appropriate for my needs. ADF caching seems to be limited to having fragments cached for fixed periods of time and Java Object caching is orders of magnitude slower and involves the Application Server.)
    Thanks for any advice,
    Andy

    Sorry - should have said I'm using JDev 10.1.3.0.4 with JSF & ADF BC.

  • Problems with custom search form in adf

    Hi,
    I am using JDeveloper 11.1.2.4. please can you help with this issue?
    I've created a custom search form with the help from this link.
    Jdeveloper,Oracle ADF &amp;amp; Java: Implementing custom search form in ADF programmatically (Without using af:query)
    I've created two bind variables SkuBind & ImperfectBind and a View Criteria.
    My problem is when I press Search button, it does not filter based on values of the bind variables in the View Criteria.
    I rightly get bind variable values in the System output though
    Skubind = 1000
    Imperfectbind = N
    but there is no where clause
    where clause = null
    public void SearchOddShoes(ActionEvent actionEvent) {
    AppModuleImpl am = (AppModuleImpl)resolvElDC("AppModuleDataControl");
    ViewObject oddShoeVo = am.getRtnOddShoesVO1();
    oddShoeVo.setNamedWhereClauseParam("SkuBind", skuPgBind.getValue());
    oddShoeVo.setNamedWhereClauseParam("ImperfectBind", imperfectPgBind.getValue());
    System.out.print("Named Skubind = " + oddShoeVo.getNamedWhereClauseParam("SkuBind") +"\n");
    System.out.print("Named Imperfectbind = " + oddShoeVo.getNamedWhereClauseParam("ImperfectBind") +"\n");
    System.out.print("where clause = " + oddShoeVo.getWhereClause()+"\n");
    System.out.print("where clause params= " + oddShoeVo.getWhereClauseParams()+"\n");
    System.out.print("Sql is " + oddShoeVo.getQuery()+"\n");
    oddShoeVo.executeQuery();
    public Object resolvElDC(String data) {
               FacesContext fc = FacesContext.getCurrentInstance();
               Application app = fc.getApplication();
               ExpressionFactory elFactory = app.getExpressionFactory();
               ELContext elContext = fc.getELContext();
               ValueExpression valueExp =
                       elFactory.createValueExpression(elContext, "#{data." + data + ".dataProvider}", Object.class);
               return valueExp.getValue(elContext);
    thanks

    Not clear what part of the code doesn't work. Assuming that you did check that the code you wrote executed
    the problem may be the following.
    You need to add partial trigger on the destination component.
    Add ...
    oddShoeVo.executeQuery();
    AdfFacesContext.getCurrentInstance().addPartialTarget(HERE_THE_BIND_NAME_OF_YOUR_TABLE);
    Also I don't see that you acctually use View Criteria. There are specific way to apply View Criteria programatically and I don't see that you use it.
    The simpliest way is just to change the VO query to embed bind variables into the query
    E.G.
    select 1
    from dual
    where some_column= :P_PARAM1

  • Non database related search form. How to achieve it?

    Hi,
    I am using JDev 11.1.1.2.0 with ADF 11g.
    I have a requirement. I have to how multiple search forms with various fileds. Each search form will pertain to set of business needs. And these business data is present in 15- 20+ tables.
    Each search form should have fields that can be a LOV field, Date field, drop downs and radio. I can also have cascading LOVs in a search form.
    The LOVs and drop downs will be definitely fetched from one single table with named queries.
    On click of search I will show a pdf report.
    Can anyone address this issue on
    1. How can I achieve such a search form? (Since the fields I want to show can be from any of the 15-20 tables)
    2. How can I decide on runtime what should be my where clause (Note: empty field does not mean NULL in search criteria)
    Thanks in advance.

    Can someone pls address this?

  • Doubt in WebStyle search form in ADF

    Hi,
    I do have a search form as in the following url.
    http://www.oracle.com/technology/products/jdev/tips/muench/screencasts/threesearchpages/threesearchforms_partone.html?_template=/ocom/technology/content/print
    The 'SearchView' has three entity objects in it. One entity is the main table with a primary key. And the other two has the foreign key of the main table and it has multiple records for the same primary key of the main table. So now if I drag and drop this 'SearchView' as a adf search form, the result shows multiple results for the same primary key of the main table as it has multiple occurence in the other two tables.
    So in this scenario, is it possible for me to display the results only from the main table? That is I want to see only one result for the primary key. But at the same time I need other entity objects also in the search view.
    Or can you suggest me any other way to do this? Please help me.
    Thanks,
    Priya.S

    Jan and Steve,
    Thanks so much for the reply. But I am still confused with my case.
    There are three entities.
    1. Bill info (All main info with a request Id as a primary key, with the final status )
    2. Bill status history (Different status history for the same request id)
    3. Bill items (Different items to be billed for the same request id)
    My requirement is that I need to have a search page to find the requests using the request id and other criteria. The result(billInfoviewresult) is a adf table with the request ids which is given with a command link. So using the link, I can navigate to the actual request. This result page should have all the above three entities. i.e. a read and write table for the item entity with the old values and a adf creation form for the 'Status history' so that the user can change the status (the status should be inserted as a new row. The DB should have all the status history from 'new' to 'completed').Everything should be for that particular request id.
    I had a viewobject only for the bill info entity so that the result was a single occurence for a requestid. But I find difficulty in creating a status and item table as it always points to the first record in the data base. And when I manually change the data to set to this particular request, I do get null values. Because of this I wanted to add all these entities into a single viewobject. But getting multiple occurence for the same id in the result.
    Can you please give me any suggestion in building the correct viewobject to acheive this?
    Thanks,
    Priya

  • Dates in ADF Search Form

    Hi,
    I have implemented a search form where i query the set of entries and display the results below in a table.
    The problem that i am facing is that when i query the set using the "Created by" column of my table i do not get any results. The date format in my database is in the form of dd-MMM-yy and i have set the control hint of the attribute in the entity but with no luck.
    Please someone help me.
    Thanks
    Antonis

    Can you double-check with a SQL example? Often create-date is something people populate with the SYSDATE or the current machine time that has both a date and a time component.
    I tried this test with the SCOTT schema:
    SQL> update emp set hiredate = to_date('17-NOV-1981 10:41:22','DD-MON-YYYY HH24:MI:SS') where empno = 7839;
    1 row updated.
    SQL> select empno, to_char(hiredate,'DD-MON-YYYY HH24:MI:SS') as hiredate from emp where empno in (7839, 7369);
         EMPNO HIREDATE
          7369 17-DEC-1980 00:00:00
          7839 17-NOV-1981 10:41:22If formatted as above at the SQL level to show the full HH24:MI:SS time component, do your created date values have all 00:00:00 for the time, or some non-zero time?
    If you try a query like:
    select count(*) from your_table where trunc(created_date) = created_datedo you get a count that is the same as all rows in the table, or some number that is less than all the rows?

  • Search Form in Jdeveloper 10.1.3

    Can any body help me how to create search from in Jdeveloper 10.1.3?
    Because I found search form in 11g by using view criteria, but this is not available in 10.1.3 version
    Thank you

    Correct, there's no such component in 10.1.3.
    Instead look to the ExecuteWithParams option in the 10.1.3 Fusion Dev Guide.
    CM.

  • 11G: Search form always in Find Mode?

    Hi,
    We are trying to re-do a search form that is always in Find mode. Shoud we follow what we do for 10.1.3 or there is new document we should follow?
    Thanks,
    Annie

    Neelmani,
    Thank you for pointing out the PDF file. I was wondering if you know oracle has any sample application talks about how to create a "Search Form" using named view criteria. I've read the PDF file chapter 25 and chapter 5.10. They only talk about it in general - meaning no detailed steps on how to do it. This 11G is a brand new product. I am no stranger to Jdev since I've been working with Jdeveloper for a couple of years. But still this version is a complete different version. A detailed step by step instruction would be really helpful at this point.
    Best regards,
    Annie

  • CANNOT USE "Advanced Custom Search Form For ADF"

    Hi,
    I have tried the application on this old post but it doesnt work on jdev 11g even after migrating.
    Can some body tell me whats wrong and / or post a working application here.
    Need to use this functionality urgently.
    the original post is here.
    http://my.opera.com/dominionspy/blog/2007/02/26/an-advanced-custom-search-form-for-adf
    Any help is really appreciated.

    Thanks for your reply.
    Could you tell me where can i find example implementations of the query model classes.
    they have mentioned it to be found in "For an example implementations of the different model classes for a query, see the classes located in the oracle.adfdemo.view.query.rich package of the ADF Faces sample application."
    Also where can i get the source code for this http://jdevadf.oracle.com/adf-richclient-demo/faces/components/query.jspx
    thanks in advance

Maybe you are looking for