JSP, View Object and ? parameter

I have a view object that uses a ? type parameter in its query. The use ? type parameter checkbox has been marked in the view and the view compiles successfully.
Now this view is being used by the Data Web bean JS Tree Browser in a JSP page.
The JSP code
<jsp:useBean class="oracle.jbo.html.databeans.JSTreeBrowser" id="roleMenuTree" scope="request" >
<%
roleMenuTree.setDepthLevel(6);
roleMenuTree.setReleaseApplicationResources(false);
roleMenuTree.setDisplayAttributes("Name");
roleMenuTree.initialize(pageContext,"Tasksys_TasksysAppModule.MenuTreeView");
Object x[] = new Object[1];
x[0] = "tasksys";
roleMenuTree.getRowSet().getViewObject().setWhereClauseParams(x);
roleMenuTree.getRowSet().getViewObject().executeQuery();
roleMenuTree.render();
%>
</jsp:useBean>
But I end up getting the following error. WHY ?
Error: 500
Location: /tasksys/jsp/login_submit.jsp
Internal Servlet Error:
javax.servlet.ServletException: JBO-27122: SQL error during statement preparation. Statement: SELECT Menus.ID, Menus.NAME, Menus.DESCRIPTION, Menus.MODULE, Menus.MEN_ID FROM MENUS Menus WHERE menu_allowed(?, to_char(id)) = 'Yes'
void org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
void org.apache.tomcat.core.ServletWrapper.doService(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response)
void org.apache.tomcat.core.Handler.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response)
void org.apache.tomcat.core.ServletWrapper.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response)
void org.apache.tomcat.core.ContextManager.internalService(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response)
void org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response)
void org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.apache.tomcat.service.TcpConnection, java.lang.Object[])
void org.apache.tomcat.service.TcpWorkerThread.runIt(java.lang.Object[])
void org.apache.tomcat.util.ThreadPool$ControlRunnable.run()
void java.lang.Thread.run()
null

You need to prepare the query using the setWhereClauseParams(x) call, before you initialize your data web bean. Otherwise, if you call the methods after you initialize your web bean, the context has already been set and the error occurs.
You should insert another data web bean into your page somewhere at the top and use it to setup your query and create a view object. You should remove this bean's Render() method since you are only interested in the Initialize() method here. Add your code to prepare the query and create the view object.
Then when your JS Tree Browser executes, it will be able to call getRowSet() on the View Object you created already.

Similar Messages

  • How to create dynamic View Object and Dynamic Table

    Dear ll
    I want to create a dynamic view object and display the output in a dynamic table on the page.
    I am using Jdeveloper 12c "Studio Edition Version 12.1.2.0.0"
    This what I did:
    1- I created a read only view object with this query "Select sysdate from dual"
    2- I added this View object to the application module
    3- I created a new method that change the query of this View object at runtime
        public void changeVoQuery(String dbViewName) {
            String sqlstm = "Select * From " + dbViewName;
            ViewObject dynamicVo = this.findViewObject("DynamicVo");
            if (dynamicVo != null) {
                dynamicVo.remove();
            dynamicVo = this.createViewObjectFromQueryStmt("DynamicVo", sqlstm);
            dynamicVo.executeQuery();
    4- I run the application module for testing the method and I passed "Scott.Emp" as a parameter and the result was Success
    5- Now I want to show the result of the view on the page, so I draged and dropped the method from the data control as a parameter form
    6- I dragged and dropped the view Object "DynamicVo" as a table and I choose "generate Column Dynamically at runtime". This is the page source
    <af:panelHeader text="#{viewcontrollerBundle.SELECT_DOCUMTN_TYPE}" id="ph1">
            <af:panelFormLayout id="pfl1">
                <af:inputText value="#{bindings.dbViewName.inputValue}" label="#{bindings.dbViewName.hints.label}"
                              required="#{bindings.dbViewName.hints.mandatory}"
                              columns="#{bindings.dbViewName.hints.displayWidth}"
                              maximumLength="#{bindings.dbViewName.hints.precision}"
                              shortDesc="#{bindings.dbViewName.hints.tooltip}" id="it1">
                    <f:validator binding="#{bindings.dbViewName.validator}"/>
                </af:inputText>
                <af:button actionListener="#{bindings.changeVoQuery.execute}" text="changeVoQuery"
                           disabled="#{!bindings.changeVoQuery.enabled}" id="b1"/>
            </af:panelFormLayout>
        </af:panelHeader>
        <af:table value="#{bindings.DynamicVo.collectionModel}" var="row" rows="#{bindings.DynamicVo.rangeSize}"
                  emptyText="#{bindings.DynamicVo.viewable ? 'No data to display.' : 'Access Denied.'}"
                  rowBandingInterval="0" selectedRowKeys="#{bindings.DynamicVo.collectionModel.selectedRow}"
                  selectionListener="#{bindings.DynamicVo.collectionModel.makeCurrent}" rowSelection="single"
                  fetchSize="#{bindings.DynamicVo.rangeSize}" filterModel="#{bindings.DynamicVoQuery.queryDescriptor}"
                  queryListener="#{bindings.DynamicVoQuery.processQuery}" filterVisible="true" varStatus="vs" id="t1"
                  partialTriggers="::b1">
            <af:iterator id="i1" value="#{bindings.DynamicVo.attributesModel.attributes}" var="column">
                <af:column headerText="#{column.label}" sortProperty="#{column.name}" sortable="true" filterable="true"
                           id="c1">
                    <af:dynamicComponent id="d1" attributeModel="#{column}"
                                         value="#{row.bindings[column.name].inputValue}"/>
                </af:column>
            </af:iterator>
        </af:table>
    when I run the page this error is occured
    <Nov 13, 2013 2:51:58 PM AST> <Error> <oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter> <BEA-000000> <ADF_FACES-60096:Server Exception during PPR, #1
    javax.el.ELException: java.lang.NullPointerException
    Caused By: java.lang.NullPointerException
    Can any body help me please
    thanks

    Have you seen Shay's video https://blogs.oracle.com/shay/entry/adf_faces_dynamic_tags_-_for_a
    All you have to do is to use the dynamic table to get your result.
    Timo

  • Can Designer generate ADF Entity Objects, View Objects and Apps Module ?

    Hi all,
    On what way can Designer integrate with JDeveloper (+ ADF) ?
    Can Designer generate ADF Entity Objects, View Objects and Apps Module ?
    Thank you for your help,
    xtanto

    Designer itself has no direct integration with JDeveloper. However, there are three options. First of all, you can get a JDeveloper extension (download this separately) that lets you create a Connection to a Designer repository. From that Connection you can find modules that you defined in Designer and generate Entity and View objects for the tables and columns that you used in those modules, and an Application Module. It does not create JSPs or other user interface objects.
    Another option is to buy JHeadstart from Oracle. This contains a set of code generators and ADF extensions that include an ability to get information from a Designer repository. JHeadstart works fine for non-Designer users too, but was built by the same people who wrote Designer Headstart - they know the repository API intimately.
    The third option is to download Oracle Designer Extension Builder (ODEB) which was just recently made available. This is a product of a collaboration between Designer users from the Oracle Development Tools Users Group (ODTUG) and Oracle to extend the capabilities of Designer with user written tools and utilities. You could use ODEB to write your own generators for ADF Business Components. Or you could wait and see if someone else in the user community does this. I hope that you or whoever does such a generator will be willing to share it with us all.

  • Iterating through master view objects and child view objects in same page

    I am working on a project using ADF UIX and Business Components.
    I have an application module with two view objects one the master view object and the second the detail object. They are related via a view link.
    I would like to iterate through the master view objects displaying a customer name as bold text and then below each customer name I'd like to display the detail records in a table via the detail view object i.e. a seprate table for each customer.
    Is this possible - I haven't had much luck!?
    Thanks in advance.

    That's because
    $(".ms-vb2 a").
    is bringing back all the pieces that have that class with an anchor on the whole page, not just the ones in the .ms-wpContentDivSpace
    I don't know the exact syntax, but I think you need to iterate through all the '.ms_vb2 a' items as well - there are multiple ones, and do something like this inside your other grouping
    $(".ms-vb2 a").each(function(index) {
        var val=$(this).html();
       var val2=val.replace(/_/g," ")
       $(this).html(val2);
    That's not quite right but maybe that will help.
    Robin

  • [SOLVED] Multiple Dynamic View Objects and View Links - ADF Tree Table

    Hi all,
    I've got a method that creates 3 dynamic viewobjects using this:
                ViewDefImpl Level1ViewDef = new ViewDefImpl("Level1View");
                Level1ViewDef.addViewAttribute("LevelDescription","LEVEL1_DESCRIPTION",String.class);
                Level1ViewDef.addViewAttribute("SetOfBooksId","SET_OF_BOOKS_ID",Number.class);
                Level1ViewDef.addViewAttribute("CodeCombinationId","CODE_COMBINATION_ID",Number.class);
                Level1ViewDef.addViewAttribute("Level1","LEVEL1",String.class);
                Level1ViewDef.addViewAttribute("AccountType","ACCOUNT_TYPE",String.class);
                Level1ViewDef.addViewAttribute("PeriodYear","PERIOD_YEAR",Number.class);
                Level1ViewDef.addViewAttribute("PeriodNum","PERIOD_NUM",Number.class);
                Level1ViewDef.addViewAttribute("PeriodName","PERIOD_NAME",String.class);
                Level1ViewDef.addViewAttribute("PtdActual","PTD_ACTUAL",Number.class);
                Level1ViewDef.addViewAttribute("YtdActual","YTD_ACTUAL",Number.class);
                Level1ViewDef.addViewAttribute("LtdActual","LTD_ACTUAL",Number.class);
                Level1ViewDef.addViewAttribute("BudgetName","BUDGET_NAME",String.class);
                Level1ViewDef.addViewAttribute("BudgetVersionId","BUDGET_VERSION_ID",Number.class);
                Level1ViewDef.addViewAttribute("PtdBudget","PTD_BUDGET",Number.class);
                Level1ViewDef.addViewAttribute("YtdBudget","YTD_BUDGET",Number.class);
                Level1ViewDef.addViewAttribute("LtdBudget","LTD_BUDGET",Number.class);
                Level1ViewDef.addViewAttribute("EncumbranceType","ENCUMBRANCE_TYPE",String.class);
                Level1ViewDef.addViewAttribute("EncumbranceTypeId","ENCUMBRANCE_TYPE_ID",Number.class);
                Level1ViewDef.addViewAttribute("PtdCommitment","PTD_COMMITMENT",Number.class);
                Level1ViewDef.addViewAttribute("YtdCommitment","YTD_COMMITMENT",Number.class);
                Level1ViewDef.addViewAttribute("LtdCommitment","LTD_COMMITMENT",Number.class);
                Level1ViewDef.setQuery(sql_level1);
                Level1ViewDef.setFullSql(true);
                Level1ViewDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
                Level1ViewDef.resolveDefObject();
                Level1ViewDef.registerDefObject();
                ViewObject vo1 = createViewObject("Level1View",Level1ViewDef);I can create the view objects fine and create a single viewlink between two of them, however i'm getting problems with 2 view links.
    This is how I'm creating a view link:
                ViewLink Level2Level1FKLink = createViewLinkBetweenViewObjects("Level2Level1FKLink1",
                                                        "Level2View",
                                                        vo1,
                                                        new AttributeDef[]{
                                                          vo1.findAttributeDef("Level1")
                                                        vo2,
                                                        new AttributeDef[]{
                                                          vo2.findAttributeDef("Level1")
                                                        "LEVEL1 = :Bind_Level1");
                ViewLink Level3Level2FKLink = createViewLinkBetweenViewObjects("Level3Level2FKLink1",
                                                        "Level3View",
                                                        vo2,
                                                        new AttributeDef[]{
                                                          vo2.findAttributeDef("Level2")
                                                        vo3,
                                                        new AttributeDef[]{
                                                          vo3.findAttributeDef("Level2")
                                                        "LEVEL2 = :Bind_Level2");I can get the data to display on an adf tree table if i'm only using a single view link, but when i try and implement 2 view link (for 3 levels on the adf tree table) i'm getting problems displaying the data.
    I'm getting the following error:
    Aug 10, 2007 2:44:39 PM oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer encodeAll
    SEVERE: Error during partial-page rendering
    oracle.jbo.NoDefException: JBO-25058: Definition Level3View of type Attribute not found in Level2View_Level2Level1FKLink1_Level2ViewThe thing is, Level3View isn't in the Level2Level1FKLink viewlink.
    I've been reading about something similar here
    BC4J Master-Detail-Detail
    but I am still unsure of what the problem is.
    Thanks in advance.

    I found the answer here:
    http://radio.weblogs.com/0118231/stories/2004/06/10/correctlyImplementingMultilevelDynamicMasterDetail.html

  • Crystal Reports Viewer 2008 and parameter fields

    Hello,
    I saw this product on the main Crystal Reports site this afternoon and decided to download it to try it out.  I have a number of users who would benefit from being able to preview their report results prior to actually running the report.  This seems like the perfect product.  I have a large number of Crystal Reports which were created in Crystal version XI.  I also downloaded the free 30 day version of Crystal Reports 2008 yesterday to see what new features are there.
    While testing Crystal Reports Viewer, I tried to run one of my reports which needs a parameter to run properly (account number).  This type of parameter is needed for probably 98% of this business' reports. 
    The problem: Crystal Reports Viewer does not prompt me to input the parameter.  In my actual Crystal Report, I had the box "Save Data with Report' left unchecked, as the account number frequently changes.  However, if that box is left unchecked, Crystal Reports Viewer will give me the error message "No Saved Data.  This report file does not contain saved data and cannot be viewed.  To get data into the report, please open and re-save it in the Crystal Reports designer application with the "Save Data with Report" option selected."
    Thinking that possibly it was the version of Crystal Reports in which the report was created (XI), I downloaded the free trial of Crystal 2008 and created a very simple test report with one parameter for account number where the account number is retrieved from our database.  And I am having the same trouble. 
    The "Help" section of Crystal Reports Viewer tells me that I can select my parameters in the parameter panel.  I do not see anything in my parameter panel other than the words "Current Data Set Last refreshed: 04/12/10 2:58 PM".  The help tells me that I can "select the parameter directly in this panel by entering a new value", but there is no option to do so.
    Any help would be appreciated.
    thanks,
    Noel

    What I've learned is that I was originally using Crystal Viewer XI and upon opening it I received a message indicating there was an update.
    I ran the update which put me on Crystal Viewer 2008.
    Since then I have not been able to refresh my screen to bring up the parameters.
    See the attached forum for another post concerning this same issue. 
    Paramter Prompts in Crystal Viewer

  • Dynamic view object and LOV

    Here's the problem I've encountered. I need to create an input LOV, where list is taken from dynamically created view object (it is created using createViewObjectFromQueryStmt; query may be different, but it always has 3 columns with fixed names - that's the rule). The problem is quite similar to that described here: {thread:id=935344}
    I've tried to create a "stub" LOV with a query like
    select 1 ID, 1 RESULTVALUE, 'dynamic' SNAME from dual(all the queries will have 3 columns with names ID, RESULTVALUE and SNAME) and then changing it's query by using something like this
        public void recreateDynamicViewObject(String newSQL) {
            ApplicationModule am = ADFUtils.getApplicationModuleForDataControl(DATACONTROL);               
            if (am.findViewObject(DYNAMIC_VO_NAME) != null)
                am.findViewObject(DYNAMIC_VO_NAME).remove();       
            ViewObject vo = am.createViewObjectFromQueryStmt(DYNAMIC_VO_NAME,newSQL);
            vo.executeQuery();               
        }but it didn't work (with the same results as it was mentioned in the post I've given reference to - the VO changes, but the new rows are not displayed).
    My question is almost the same: is it possible to use a dynamically created VO in LOV? The option of creating a VO for each query is unacceptable in my case, because these queries in fact are created by end users, and there can be any number of these queries.
    In case it is important - I use JDeveloper 11.1.1.2.0.

    I am also looking for a similar solution.
    Actually it works partially.
    I have a created a permanent View Object with a dummy query and in the run time I am replacing the View Object query in the ProcessRequest in CO.
    My problem is when you click on the LOV it works fine with the changed query results, but when I clicked again on the LOV, it shows the the dummy query results which I gave it in the VO.
    Here is my AM method which is called in the CO.
    BOSS_Parameter1_LOV_VOImpl parameterVO =
    getBOSS_Parameter1_LOV_VO1();
    parameterVO.clearCache();
    parameterVO.executeQuery();
    System.out.println(parameterVO.getQuery());
    parameterVO.setWhereClause(null);
    parameterVO.setWhereClauseParams(null);
    parameterVO.setQuery(lovQuery); // this the dynamic query
    parameterVO.setWhereClause(null);
    System.out.println(parameterVO.getQuery());
    Even though its showing the changed query in the getQuery, the LOV is not refreshed.
    I am also changing the Query of the View Object in the ProcessFormRequest
    if (pageContext.isLovEvent() || pageContext.getParameter(EVENT_PARAM).equals("lovPrepare")) {
    call the above mentioned method in the AM.
    But, still it doesn't work.
    Any tips will be appreciated.
    Thanks,

  • How to create a view object and attach with extended AM

    Hi,
    I tried to create new vo and attach this vo with the extended AM. But it is throwing error like 'PC.NAME : invalid identifier' (Actually this PC.NAME is exiting one).
    Now i want to know how to create a view object similar like seeded one but with one additional condition in the where clause.
    It is possible though extension, but i want to create two view object similar like seeded one, one with some other condition in the where clause
    and another one with some other condition.
    So for my requirement, i'll extend one VO and i'll add my condition but how to do it for second condition.
    But i want same seeded VO with two different condition.
    Any suggestions please,
    SAN

    SAN,
    There is no need to attach the newly created VO with extended AM. You need to attach the same with the standard AM.
    Regards,
    Gyan

  • How to retrieve rows in view object and display on UI

    Hi All,
    I am new to ADF. i am using jdeveloper11.1.1.5.0 . Here is my scenario.
    In my AM i have a view object say EmployeeVo. on empVo i am performing setRangeStart and setRangeSize.
    empVo .setRangeStart(2);
    empVo .setRangeSize(2);
    Rows[] rows=empVo .getAllRowsInRange();
    so from the above statement will get two rows from the empVo object. Now i have to display these rows in UI in the form of af:table.
    Can anyone suggest how to acheive this.
    Thanks in advance.

    <af:table value="#{Bean.listValue}" var="row" />
    //refer rows like
    <af:column>
    <af:inputText value="#{row.description}" />
    </af:column>
    List listValue = new ArrayList();
    //getter setter of listValue
    //bean constructor
    retrieve the rows from the AM methodthe above step is very crude hope you understand the steps

  • View link creation on two view objects, and both view objects are populated program(not from sql)

    I have master and detail VO , both views data is loaded in program. Now for show/hide feature, I create View Link Object and using one element from both child and master VO , View Link Object created properly.
    But I can not able to add that view link object into AM.
    Now because of that , I cannot say what is a instance name of that view link object.
    Hence getting following error  -- Invalid or missing view link. Please attach view link with the bean.
    Please can you provide some directions.

    I have master and detail VO , both views data is loaded in program. Now for show/hide feature, I create View Link Object and using one element from both child and master VO , View Link Object created properly.
    But I can not able to add that view link object into AM.
    Now because of that , I cannot say what is a instance name of that view link object.
    Hence getting following error  -- Invalid or missing view link. Please attach view link with the bean.
    Please can you provide some directions.

  • Expert mode query in View objects and appended where clause

    My company is Oracle Member Partner and we are developing enterprise web applications using Oracle database and BC4J.
    I have the following problem...
    When I enable EXPERT MODE option in View Object I have trouble appending to query statement in my client code.
    I need expert mode because I must use "SELECT DISTINCT" insted of "SELECT" in my query.
    It looks something like this:
    viewObject.setWhereClause("CLA_ID = " + claId);
    viewObject.executeQuery();
    SQL query from View Object becomes sub-query and fails to execute:
    select * from (original view object query) where (... appended where clause)
    Order by part of the query causes sql errors because original query is now sub-query.
    Is there any way around this?

    I tried creating an expert mode SQL query:
    SELECT DISTINCT EMPNO, ENAME FROM EMP.
    Then at runtime I do:
    vo.setWhereClause("ENAME LIKE '%'||?||'%');
    vo.setWhereClauseParam(0,'A');.
    and this works fine. The trick is that since expert-mode view objects get wrapped as inline views (to allow runtime appending of WHERE clause, actually), you need to select any column in the select statement to which you want to later refer in a dynamically-appended where clause.
    If you want to prevent the inline-view wrapping, you can write the following code in your view object's ViewObjectImpl subclass to force the VO to NOT be treated as an expert-mode SQL VO.
      // Goes in your view object impl subclass
      public void create() {
         // Force this VO to NOT be treated as an expert-mode SQL, so that
         // its query does not get wrapped as an inline view.
         getViewDef().setFullSql(false);
      }I used this trick above to create an expert mode query like:
    SELECT DISTINCT deptno FROM empand then at runtime I add a dynamic where clause that refers to a column
    in EMP that is not in the select list like this:
        ViewObject vo = am.findViewObject("View1");
        vo.setWhereClause("ename like '%A%'");
        vo.executeQuery();
        System.out.println(vo.first().getAttribute(0));and this causes the query to come out as:
    SELECT DISTINCT deptno FROM emp WHERE ename like '%A%'.
    instead of:
    SELECT * FROM (SELECT DISTINCT deptno FROM emp) QRSLT WHERE ename like '%A%'which would cause an error due to the fact that ename is not in the select list of the original (wrapped, inline) query.

  • ADF BC: LOV in view object and af:table

    Using JDev 11g PS2
    I have a few question about the use of LOV's in BC.
    Let's take the HR schema as an example.
    Suppose i am building a basic CRUD operation for the employee table. The employee has a FK to the department, job and manager table.
    I have build a view that only uses the Employee entity. I have also defined a LOV for the departmentId and jobId.
    This is all working quiet well when i put it into a form.
    When i am adding a read only table to my page, the departmentId and jobId are shown as a number instead of their corresponding value for the department and jobs table.
    The question i am having, what is the best practice for solving this? Is there a way to tell the output text to show the value of the LOV instead of the actual ID? Or do i need to modify my VO and add the department and jobs view to my Employee view so i can add the departmentName and jobTitle column to my employee VO?
    I also notice that when i enable the filter on my table, it does not show my LOV for the department and job column... How can i enable that?
    Edited by: Yannick Ongena on Jun 6, 2011 12:57 PM

    The departmentId and jobId are shown as a number instead of their corresponding value for the department and jobs table1) What ADF Faces components do you use for the Department ID and Job ID in the table?
    2) What Control Type is chosen for these VO attributes on "Control Hints" page of VO attribute definition dialog (Default, Choice List, Combo Box, Input Text With LOV, etc.)?
    The generated table/tree binding does not specify the type of corresponding attribute bindings (have a look at the generated PageDef). The types of these attribute bindings (and also the types of the UI components inside corresponding <af:column>s) depend on the values of Control Type. If you use Choice Lists, then Department Name and Job Name should be displayed (if your LOV configurations specify them as displayed attributes). If you use "Input Text With LOV", then IDs should be displayed. I am not sure what should be displayed if "Combo Box" is specified, I suspect that IDs would be displayed.
    Do i need to modify my VO and add the department and jobs view to my Employee view so i can add the departmentName and jobTitle column to my employee VOIf you use Choice List and if the LOV has parameters (from values of another VO attributes), then the Choice List query will be executed once for each VO row (if the parameter values are different for the different rows), so the performance will be slow. It is recommended to avoid Choice Lists in such cases but to include the corresponding "name/descrription" attributes in the VO query. If the LOV's query does not depend on any parameters and you use Choice List, then the query will be executed once at page load and then it will be reused from the VO cache.
    When i enable the filter on my table, it does not show my LOV for the department and job column... How can i enable that?Table filter fields are text fields by default. You are able to override default filter fields (for example, with <af:inputListOfValues>) by using <f:facet name="filter"> within corresponding <af:column>. Just specify the necessary input component(s) within this facet.
    Dimitar

  • Iterators, View Objects, and ViewCriteria question

    JDev version 10.1.3.2, ADF BC JSF application, created a web-type search form with search and results on same page, exactly like that in Dev guide chap. 18.3. Would like to have the previous page put parameters in a managed bean, and then have the search page populate the QBE form fields with these parameters and execute the query.
    I was hoping to solve the problem by doing the following:
    1) in (session scoped) managed bean, have created a method that puts the parameter value into the "find mode" iterator's viewCriteria and then returns the JSF page navigation action that represents going to the search form. Here is the code for that method (the parameter is currently hardcoded "courseid = 390"):
    public String toEnableMissingSurvey() {
    // ViewObject postReqVO = getclassesStudentsCourses1();
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application app = fctx.getApplication();
    ValueBinding vb = app.createValueBinding("#{bindings}");
    DCBindingContainer dc = (DCBindingContainer) vb.getValue(fctx);
    DCIteratorBinding dciter = dc.findIteratorBinding("classesStudentsCourses1Iterator");
    ViewCriteria criteria = dciter.getViewCriteria();
    if (criteria.size() > 0) criteria.clear();
    //AdfFacesContext afContext = AdfFacesContext.getCurrentInstance();
    //String courseid = (String)afContext.getProcessScope().get("surveyCourseid");
    // String courseid = getReturnNavigationRule();
    String courseid = "390";
    if (courseid != null && !courseid.equals("")) {
    Row criteriaRow = criteria.createViewCriteriaRow();
    criteria.add(criteriaRow);
    criteriaRow.setAttribute("Courseid",courseid);
    dciter.getViewObject().applyViewCriteria(criteria);
    //dciter.executeQuery(); --I commented this out because it didn't make any difference, and I thought that the query should be executing on page open anyways
    return "enableMissingSurvey";
    2) On the calling page, on the "EnableMissingSurvey" button which is to navigate to the search page, I have set the "Action" property of the button to this method.
    The button successfully navigates to the search page, but I don't see any change in either the parameter form or the search results that are visible at page opening.
    Can someone tell me what I am doing wrong? Am I accessing the wrong iterator? Do I need to set both the "always find" iterator and the "search results" iterator? Do I need some kind of additional invokeActions in my page def? Is this idea not valid?

    I am not sure 100% what you are trying to accomplish, but you can easily have the search form and results on the same page and not lose the search parameters.
    You need an invoke action to set your search iterator to alway find like this:
    <invokeAction id="AlwaysFind" Binds="Find"
    RefreshCondition="${ ! bindings.AllEmployeesIterator.findMode }"/>
    And create another iterator for the search results.
    KurzHome

  • What is the best practice concerning View Objects and List of values

    Hi,
    Let's take these two tables :
    Market_Descriptions
    Id
    Name
    Desc
    Language_Id
    Languages
    Id
    Code
    Desc
    Now, if I am generating these business components with the help of the wizard, I will be having two entities and two views.
    If I am creating a list of value on the field Language_Id in Market_Descriptions table, showing the language code, everything works fine as long as this is drop as a Form but not as a table or read-only form.
    What is the best practice for me to include/replace the language_id with the language code, since it is more user-friendly, on a read-only form or a table?
    Thanks.

    Hi,
    Always have LOV on the field which we want show it on UI. Suppose based on below scenario, If you want to display Langaugae Description on UI, have LOV on Desc but not on Language_Id. Even though we can set display attribute in LOV configuration, but it will work only in forms but not in tables. In tables it will show language id instead of description.
    Have LOV on Desc and make one more join with location Id in LOV configuration, so as soon as we select desc in LOV, location_id will be populated.
    here is the join condition inside LOV
    Languages.Desc = ViewAccessor.Desc
    Languages.Id - ViewAccessor.Desc
    Hope this will help you.
    Dileep.

  • View Objects and Sequence Numbers

    Hi,
    I am creating viewobject from query statement. I would like to get nextval from my sequence, there is a bug in jdbc, and it increments by 2,
    any idea how to correct that and still using data from db ?
    Jacek

    Yes, primary key is my reason,
    Anyway using DBsequence in ADF I get minus values !!
    value from DBsequence in BC JClient, bug ?
    (duno if it is problem only in 10.1.3 but that is what I am using)
    I know I can use a trigger, but then I have to leave blank field during insert action in jtable (because trigger will do it, right?). I`d like it to automatically insert value from sequence to my id field during insert on jtable. Sounds simple.
    My byway is to create a view from query stmt that will get max(myid) like:
    ViewObject vo=MyView("SELECT MAX(my_id) FROM My_table");and
    int sample=0When I create row in my jTable I am increasing my Integer+myvalue from view... until commit/rollb... and so on...
    But why I have to always go byway...
    Jacek

Maybe you are looking for