Dynamically setting where clause parameter before the page load

Hi Experts,
I do have the following requirement.
I am working on jsf page in ADF10.1.3.3. I have a View Object which displays the results on the screen. Can someone provide me some example where I can dynamically set the where clause parameter to my Query in VO before the Page Load happens(By Overriding the Prepare Model) and display results on screen.
Thanks

Hi,
Thanks for yor advice.
I need to write the method in Prepare Model method when the page loads and not in AM.
Here in the page there is no action as such.
On the Page load we need to directly set the Where Clause on the VO.
Provide me some examples if any.
Thanks

Similar Messages

  • Have been running version 4 for a week without problems. Today, downloaded MS live security update, and have had problems since. when I click on a favorite site, it takes 20 to 40 seconds before the page load's and the same if I click a link on the page.

    been running version 4 for a week without problems. Today, downloaded MS live security update, and have had problems since. when I click on a favorite site, it takes 20 to 40 seconds before the page load's.'''bold text'''

    http://portableapps.com/apps/internet/firefox_portable/localization#legacy36

  • Progress bar/Icon before the page loads

    Hi,
    I am having a page which takes 1-2 mins to load and render the data now i want to display animated icon/progress-bar immediately the page pops up(ie. when blank). Ive already done progress bar on the page load but in this case i want it to display much early when the page is still blank, any idea please. If this is not doable in Apex i might borrow JS/JQuery......thanks all.

    All,
    I got this issue to work in a better way using Skillbuilder's pop-up plugins but again I am having issue with that too as described below,
    The first time the popup page comes up the background is totally black, how can i change this to make it meaningful color?
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    workspace=proj2010
    userid/pwd=demo/demo123
    thanks in advance.
    Edited by: jieri on Jul 30, 2012 1:18 PM

  • Set where Clause parameter using UIX

    I am using uiXML to generate a table which is associated to a ViewObject. The query of the ViewObject has bind variable for date. I would like to display a report (i.e table) with the values from ViewObject corresponding to dates (from & to) set using the bind variable. In other words, I would like to set the value for the bind variable from UIX just before displaying the table. My code is as follows:
    <bc4j:rootAppModuleScope name="QnAMainRepView1AppModule">
    <contents>
    <form name="QnAFrm">
    <contents>
    <bc4j:viewObjectScope name="QnAMainRepView1">
    <contents>
    <bc4j:table name="QnATbl" width="100%">
    <bc4j:keyStamp>
    <bc4j:rowKey name="key"/>
    </bc4j:keyStamp>
    <contents>
    <bc4j:column attrName="HostName">
    <columnHeader>
    <bc4j:sortableHeader text="Host"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>
    <bc4j:column attrName="ModuleName">
    <columnHeader>
    <bc4j:sortableHeader text="Module"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>
    <bc4j:column attrName="Description">
    <columnHeader>
    <bc4j:sortableHeader/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>
    <bc4j:column attrName="Count1">
    <columnHeader>
    <bc4j:sortableHeader text="Count"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>
    <bc4j:column attrName="Gmt">
    <columnHeader>
    <bc4j:sortableHeader text="GMT"/>
    </columnHeader>
    <contents>
    <bc4j:dateField readOnly="true">
    <onSubmitValidater>
    <date dateStyle="long"
    pattern="MM-dd-yyyy 'at' hh:mm:ss"/>
    </onSubmitValidater>
    </bc4j:dateField>
    </contents>
    </bc4j:column>
    <column>
    <columnHeader>
    <sortableHeader text="Local Time"/>
    </columnHeader>
    <contents>
    <dateField readOnly="true" value="2003-01-25">
    <onSubmitValidater>
    <date dateStyle="long"
    pattern="MM-dd-yyyy 'at' hh:mm:ss"/>
    </onSubmitValidater>
    </dateField>
    </contents>
    </column>
    </contents>
    </bc4j:table>
    </contents>
    </bc4j:viewObjectScope>
    </contents>
    </form>
    </contents>
    </bc4j:rootAppModuleScope>
    In the above, QnAMainRepView1 is the ViewObject which has bind variables. How do I set the value for the bind variable before the table is drawn?
    Thank you very much for your help.
    Jayasree

    I'm try implement this feature, but my Page return the follow error:
    oracle.jbo.SQLStmtException: JBO-27122: Error during preparation for instruction. Instruction: SELECT A.COD_CLIENTE, A.SEQ_ESCOLA, A.SEQ_CAMPUS, (select b.nom_escola from ed_escola b where a.cod_cliente = b.cod_cliente and a.seq_escola = b.seq_escola) AS DspNomEscola, A.STA_PRINCIPAL, A.COD_PESSOA, A.NOM_CAMPUS, A.STA_CNPJ, A.NUM_CNPJ, A.STA_FUNCIONAMENTO, A.TIP_DEPENDENCIA, A.TIP_ZONA, A.COD_GEOPROCESSAMENTO, A.QTD_M2_CONSTRUIDA, A.QTD_M2_TOTAL, A.NUM_DEPENDENCIA_OUES, A.NUM_CADASTRO_IMOB, A.COD_PESSOA_PRO, A.TIP_ESGOTO_SANITARIO, A.TIP_OCUPACAO_IMOVEL, A.TIP_ESFERA_PESSOA_PRO, A.SEQ_ESCOLA_DEP, A.SEQ_TIPO_LOCAL_CAMPUS, A.COD_CLASSE_LOCAL_CAMPUS, A.SEQ_TIPO_DESTINO_LIXO, A.COD_CLASSE_DESTINO_LIXO FROM ED_ESCOLA_CAMPUS A WHERE cod_cliente = ?
    at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:608)
    at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:2600)
    at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:521)
    at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2197)
    at oracle.jbo.server.ViewRowSetIteratorImpl.first(ViewRowSetIteratorImpl.java:1141)
    at oracle.jbo.server.ViewRowSetImpl.first(ViewRowSetImpl.java:2240)
    at oracle.jbo.server.ViewObjectImpl.first(ViewObjectImpl.java:4345)
    at oracle.cabo.data.jbo.ui.data.RowSetDataProvider.init(Unknown Source)
    at oracle.cabo.ui.data.provider.TableDataProvider.init(Unknown Source)
    at oracle.cabo.ui.data.provider.CachingDataProvider.init(Unknown Source)
    at oracle.cabo.ui.data.provider.DataProviderStack.addDataProvider(Unknown Source)
    at oracle.cabo.ui.LogicalNodeRenderingContext.addDataProvider(Unknown Source)
    at oracle.cabo.ui.composite.CompositeRenderingContext.addDataProvider(Unknown Source)
    at oracle.cabo.ui.laf.base.DataScopeRenderer.prerender(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.composite.UINodeRenderer.renderWithNode(Unknown Source)
    at oracle.cabo.ui.composite.UINodeRenderer.render(Unknown Source)
    My ViewObject have the SQL Statment:
    select a.cod_cliente,
    a.seq_escola,
    a.seq_campus,
    from ed_escola_campus a
    where cod_cliente = ?
    package br.com.siadem.siaed.ed00010;
    import javax.servlet.ServletConfig;
    import oracle.jbo.ViewObject;
    import oracle.cabo.ui.RenderingContext;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.servlet.ui.BajaRenderingContext;
    import oracle.cabo.data.jbo.servlet.bind.ServletBindingUtils;
    My Event Handler:
    public class FunPreQuery
    public EventResult handleEvent(BajaContext context, Page page, PageEvent event) throws Throwable
    ViewObject view = ServletBindingUtils.getViewObject(context);
    view.setWhereClauseParam(0, "1");
    view.executeQuery();
    return new EventResult(page);
    My Page UIX:
    <?xml version="1.0" encoding="windows-1252" ?>
    <page xmlns="http://xmlns.oracle.com/uix/controller"
    xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
    xmlns:ui="http://xmlns.oracle.com/uix/ui"
    xmlns:bc4j="http://xmlns.oracle.com/uix/bc4j" >
    <bc4j:registryDef>
    <bc4j:rootAppModuleDef name="EdEscolaCampusView1AppModule"
    definition="siaed.Ed00010Module"
    releaseMode="stateful" >
    <bc4j:viewObjectDef name="EdEscolaCampusView1"
    rangeSize="10" >
    <bc4j:rowDef name="UpdateEdEscolaCampusView1" autoCreate="false" >
    <bc4j:propertyKey name="key" />
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    <content>
    <try xmlns="http://xmlns.oracle.com/uix/ui"
    xmlns:data="http://xmlns.oracle.com/uix/ui" >
    <catch>
    <displayException />
    </catch>
    <contents>
    <!--
    <switcher childName="default">
    <boundAttribute name="childName">
    <if>
    <comparison type="equals">
    <dataObject select="key" source="ctrl:page"/>
    <dataObject source="ui:null"/>
    </comparison>
    <fixed text="error"/>
    </if>
    </boundAttribute>
    <case name="error">
    <header text="Required page property 'key' missing. Cannot display page."/>
    </case>
    <case name="default">
    -->
    <pageLayout xmlns="http://xmlns.oracle.com/uix/ui"
    xmlns:data="http://xmlns.oracle.com/uix/ui"
    title="Campus - Pesquisar" >
    <contents>
    <!-- this will contain any validation errors after form
    submission -->
    <messageBox automatic="true" />
    <bc4j:rootAppModuleScope name="EdEscolaCampusView1AppModule" >
    <contents>
    <header text="Pesquisar" >
    <contents>
    <form name="search" method="POST" >
    <contents>
    <inlineMessage prompt="Condição" vAlign="middle" >
    <contents>
    <flowLayout>
    <contents>
    <choice name="attrName"
    data:selectedValue="attrName@ctrl:page"
    shortDesc="Search Column">
    <contents>
    <option text="Escola" value="SeqEscola" />
    <option text="Código Campus" value="SeqCampus" />
    <option text="Nome" value="NomCampus" />
    </contents>
    </choice>
    <textInput name="attrValue" columns="20"
    data:text="attrValue@ctrl:page"
    shortDesc="Search"/>
    </contents>
    </flowLayout>
    </contents>
    <end>
    <submitButton text="Pesquisar" ctrl:event="search" />
    </end>
    </inlineMessage>
    </contents>
    </form>
    </contents>
    </header>
    <header text="Resultados" >
    <contents>
    <form name="viewForm" method="POST" >
    <contents>
    <tableLayout>
    <contents>
    <bc4j:viewObjectScope name="EdEscolaCampusView1" >
    <contents>
    <bc4j:table name="viewTable" width="80%"
    alternateText="Nenhum registro encontrado">
    <tableSelection>
    <!-- single selection for each row in the table -->
    <singleSelection selectedIndex="0" shortDesc="Select Row">
    <contents>
    <!-- the update button causes the currently selected
    row to be sent to the update page -->
    <submitButton text="alterar"
    ctrl:event="update" />
    <!-- the delete button causes the currently selected
    row to be removed -->
    <submitButton text="excluir"
    ctrl:event="delete" />
    </contents>
    </singleSelection>
    </tableSelection>
    <!-- the key identifying the current row in the table -->
    <bc4j:keyStamp>
    <bc4j:rowKey name="key" />
    </bc4j:keyStamp>
    <contents>
    <!-- A bc4j:column element is added for each attribute
    in the ViewObject. -->
    <bc4j:column attrName="SeqEscola">
    <columnHeader>
    <bc4j:sortableHeader text="Escola"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>
    <bc4j:column attrName="SeqCampus">
    <columnHeader>
    <bc4j:sortableHeader text="Campus"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>
    </contents>
    </bc4j:table>
    </contents>
    </bc4j:viewObjectScope>
    </contents>
    </tableLayout>
    </contents>
    </form>
    </contents>
    </header>
    </contents>
    </bc4j:rootAppModuleScope>
    </contents>
    <contentFooter>
    <!-- the create button redirects to the create page -->
    <button text="Inserir" ctrl:event="inserir" />
    </contentFooter>
    </pageLayout>
    </contents>
    </try>
    </content>
    <handlers>
    <event name="*">
    <method name="br.com.siadem.siaed.ed00010.FunPreQuery"
    method="handleEvent"/>
    </event>
    <event name="search" >
    <!-- using the ApplicationModule causes it to be checked out from the
    ApplicationPool. It is released using stateful mode. -->
    <bc4j:findRootAppModule name="EdEscolaCampusView1AppModule" >
    <!-- establish the ViewObject scope -->
    <bc4j:findViewObject name="EdEscolaCampusView1" >
    <!-- search for the view criteria -->
    <bc4j:findByExample>
    <bc4j:exampleRow ignoreCase="true" >
    <bc4j:exampleAttribute>
    <bc4j:nameBinding><bc4j:parameter name="attrName" /></bc4j:nameBinding>
    <bc4j:valueBinding><bc4j:parameter name="attrValue" /></bc4j:valueBinding>
    </bc4j:exampleAttribute>
    </bc4j:exampleRow>
    </bc4j:findByExample>
    <bc4j:executeQuery/>
    <!-- store the current search criteria as page properties -->
    <bc4j:setPageProperty name="attrName" >
    <bc4j:parameter name="attrName" />
    </bc4j:setPageProperty>
    <bc4j:setPageProperty name="attrValue" >
    <bc4j:parameter name="attrValue" />
    </bc4j:setPageProperty>
    </bc4j:findViewObject>
    </bc4j:findRootAppModule>
    </event>
    <event name="sort" source="viewTable" >
    <!-- using the ApplicationModule causes it to be checked out from the
    ApplicationPool. It is released using stateful mode. -->
    <bc4j:findRootAppModule name="EdEscolaCampusView1AppModule" >
    <!-- establish the ViewObject scope -->
    <bc4j:findViewObject name="EdEscolaCampusView1" >
    <!-- sort by the submitted attribute name -->
    <bc4j:sort/>
    </bc4j:findViewObject>
    </bc4j:findRootAppModule>
    </event>
    <event name="goto" source="viewTable" >
    <!-- using the ApplicationModule causes it to be checked out from the
    ApplicationPool. It is released using stateful mode. -->
    <bc4j:findRootAppModule name="EdEscolaCampusView1AppModule" >
    <!-- establish the ViewObject scope -->
    <bc4j:findViewObject name="EdEscolaCampusView1" >
    <!-- navigate to the submitted range -->
    <bc4j:goto/>
    </bc4j:findViewObject>
    </bc4j:findRootAppModule>
    </event>
    <event name="create" >
    <!-- forward to the create page -->
    <ctrl:go name="ed00010create" redirect="true" />
    </event>
    <event name="update" >
    <!-- forward to the update page, passing the selected key
    as a page property -->
    <ctrl:go name="ed00010update" redirect="true" >
    <ctrl:property name="key" >
    <ctrl:selection name="viewTable" key="key" />
    </ctrl:property>
    </ctrl:go>
    </event>
    <event name="delete" >
    <!-- using the ApplicationModule causes it to be checked out from the
    ApplicationPool. It is released using stateful mode. -->
    <bc4j:findRootAppModule name="EdEscolaCampusView1AppModule" >
    <!-- establish the ViewObject scope -->
    <bc4j:findViewObject name="EdEscolaCampusView1" >
    <!-- find the selected Row -->
    <bc4j:findRowByKey>
    <bc4j:keyBinding>
    <bc4j:selectionKey name="viewTable" key="key" />
    </bc4j:keyBinding>
    <bc4j:handlers>
    <!-- remove the selected ViewObject row -->
    <bc4j:removeRow />
    <!-- execute the query to eliminate dead row access -->
    <bc4j:executeQuery/>
    </bc4j:handlers>
    </bc4j:findRowByKey>
    </bc4j:findViewObject>
    <!-- commit the transaction, forwards to self automatically -->
    <bc4j:commit/>
    </bc4j:findRootAppModule>
    </event>
    </handlers>
    </page>
    Any body have a any idea for solution this problem ???
    thanks,
    Danilo

  • Issue with dynamically setting where clause in OAF

    Hi All,
    I have a View object having the query below:
    SELECT  rownum LINENUM,
            B.line_id LINE_ID,
            B.INVENTORY_ITEM_ID INVITMID ,
            B.QUANTITY_DELIVERED PICKQTY         
    from   MTL_TXN_REQUEST_HEADERS A,
            MTL_TXN_REQUEST_LINES  B
      WHERE A.HEADER_ID=B.HEADER_ID
       AND A.MOVE_ORDER_TYPE=2 
       AND 'on'=:1
       AND B.TO_SUBINVENTORY_CODE=NVL(:4,B.TO_SUBINVENTORY_CODE)
       AND A.request_number=NVL(:5,A.REQUEST_NUMBER) 
    UNION ALL
    SELECT  rownum LINENUM,
            a.wip_entity_id LINE_ID,
            a.INVENTORY_ITEM_ID INVITMID,
            a.QUANTITY_ISSUED PICKQTY      
      FROM  WIP_REQUIREMENT_OPERATIONS a,
            eam_work_orders_v b
      WHERE a.wip_entity_id=b.wip_entity_id
         AND 'on'=:2
        AND a.ATTRIBUTE2=NVL(:4,a.ATTRIBUTE2)
      and b.wip_entity_name=NVL(:6,b.wip_entity_name)
    I need to pass dynamically a condition to my where clause that i can handle it by defining two bind parameters in the vo query and can pass it but the problem is the bind variable contains a string like 1311,13112,14445 that i need to pass for a field such as B.line_id in the first query and b.wip_entity_id in the second query so when i am trying by passing the string as one value it is working fine but for value separetd by comma it is giving prob.
    so i tried by passing dynamic where clause but it is everytime executing for first clause only how i can pass dynamically both the queries.
    vo.setWhereClause("LINE_ID in "+wherclause);
    please help me out
    Thnaks
    Deb

    Hi Gaurav,
    Thnaks for the reply i tried belwo way u suggested but the query is executing multiple times and i am not getting the correct data as expected.
    public void processPOData (String wherclause)
                 OAViewObject vo = this.getXXDPECONTAINLINESVO1();
                    String query =vo.getQuery();
                    String newwhereclause ="LINE_ID = "+wherclause;
                    StringBuffer stringbuffer = new StringBuffer();  
                stringbuffer.append("SELECT * FROM (");
                stringbuffer.append(query);
                stringbuffer.append(") where ");
                stringbuffer.append(newwhereclause);          
        ViewDefImpl viewdefimpl = getXXDPECONTAINLINESVO1().getViewDefinition();
                viewdefimpl.setQuery(stringbuffer.toString());
                 vo.reset();
                 vo.clearCache();
                vo.executeQuery();
                    System.out.println("where clause:"+wherclause);
    in my log file the query is forming like below:
    SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM ( SELECT * FROM ( SELECT  rownum LINENUM,
            B.line_id LINE_ID,
            B.INVENTORY_ITEM_ID INVITMID ,
            B.QUANTITY_DELIVERED PICKQTY ,
            B.TO_SUBINVENTORY_CODE UNLOADINGPNT,
            A.REQUEST_NUMBER RRNUM,
            NULL WORKORDNUM,
            NULL DTRNUM,
            A.description,
            A.FROM_SUBINVENTORY_CODE FROM_SUB,
            A.TO_SUBINVENTORY_CODE  TO_SUB,
            NULL SOURCE       
    from   MTL_TXN_REQUEST_HEADERS A,
            MTL_TXN_REQUEST_LINES  B
      WHERE A.HEADER_ID=B.HEADER_ID
       AND A.MOVE_ORDER_TYPE=2  
    UNION ALL
    SELECT  rownum LINENUM,
            a.wip_entity_id LINE_ID,
            a.INVENTORY_ITEM_ID INVITMID,
            a.QUANTITY_ISSUED PICKQTY,
            a.ATTRIBUTE2 UNLOADINGPNT,
            NULL RRNUM,
            b.WIP_ENTITY_NAME WORKORDNUM,
            NULL DTRNUM,
            b.description,
            NULL FROM_SUB,
            NULL TO_SUB,      
            b.source SOURCE
      FROM  WIP_REQUIREMENT_OPERATIONS a,
            eam_work_orders_v b
      WHERE a.wip_entity_id=b.wip_entity_id ) )) where LINE_ID = 30026) where LINE_ID = 30026) where LINE_ID = 30026
    But in my page i am getting all the data instead of only for line 30026, please help me out

  • I get a flash of blue background before the page loads.

    its happening on this  page I created. its a duplicate from an older page in where i use the framework.
    but  all other pages on site ae fine.
    please help
    http://www.factoryfresh.net/factoryfreshinventory_Skew_wordUp.html

    http://www.factoryfresh.net/factoryfreshinventory_Skew_wordUp.html
    The blue is coming from your use of bgcolor="#003366" in your first row cell which appears while waiting to load all those graphics. Once the graphics are cached, I don't see the blue anymore.
    Change this:
    <td colspan="7" bgcolor="#003366">
    to this:
    <td colspan="7">
    You also have a mixture of XHTML and HTML causing some of the 1094 validation errors at http://validator.w3.org .
    Since you apparently don't need XHTML (your server is sending it as text/html anyway), try File->Convert->HTML 4.01 Transitional
    Sidenote - Missing links:
    http://www.factoryfresh.net/print.css
    HTTP/1.x 404 Not Found
    http://www.factoryfresh.net/mm_spacer.gif
    HTTP/1.x 404 Not Found
    Mark A. Boyd
    Keep-On-Learnin' :-)
    [Edit: re-inserted missing line feeds]

  • When I open a new window with firefox I very briefly get a blue screen every time before the page loads. I have already upadated my graphics driver but no difference.

    This started today after my mail account was compromised.

    Dos it help if you disable hardware acceleration?
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • How to set Where clause in the View Object of the MessageChoice ?

    Hi,
    How to set Where clause in the View Object of the
    MessageChoice ?
    Example:
    <bc4j:rootAppModuleDef name="EdEscolaCampusView1AppModule"
    definition="ed00050.Ed00050Module"
    releaseMode="stateful" >
    <bc4j:viewObjectDef name="EdEscolaCampusView1" >
    <bc4j:rowDef name="CreateEdEscolaCampusView1" autoCreate="true" >
    <bc4j:propertyKey name="key" />
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    <bc4j:viewObjectDef name="ListaTipLocalView1"
    rangeSize="9999">
    </bc4j:viewObjectDef>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    messageChoice declaration:
    <bc4j:messageChoice name="SeqTipoLocalCampus"
    attrName="SeqTipoLocalCampus"
    prompt="Local do Campus">
    <contents>
    <bc4j:optionList attrName="SeqTipoBasico"
    textAttrName="NomTipoBasico"
    voName="ListaTipLocalView1"/>
    </contents>
    </bc4j:messageChoice>
    I would like set where clause of ViewObject, with dinamic parameters (using attribute1 = :1), before populate messageChoice.
    thanks...
    Danilo

    Hi Andy,
    I try set a where clause using the message:
    Set where Clause parameter using UIX , but my UIX Page have 2 messageChoice's of different ViewObject's, then I need implement this Java Class:
    //Nome da Package da Tela Detail
    package br.com.siadem.siaed.ed00050;
    // Importa as Bibliotecas necessárias
    import oracle.jbo.ViewObject;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.client.Configuration;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.data.jbo.servlet.bind.*;
    import oracle.cabo.ui.data.BoundValue;
    import oracle.cabo.ui.data.DataBoundValue;
    import javax.servlet.http.HttpServletRequest;
    import br.com.siadem.siaed.util.*;
    import javax.servlet.http.Cookie;
    import oracle.cabo.data.jbo.def.NestedAppModuleDef;
    import oracle.cabo.data.jbo.def.ViewObjectDef;
    import oracle.cabo.data.jbo.def.AppModuleDef;
    // Classe que configura os parametros para a execução da Query,
    // utilizando variáveis de Sessao
    public class FunPreQueryLista
    public static EventResult FunConfiguraQuery(BajaContext context, Page page, PageEvent event) throws Throwable
    // TrataDadosSessao - Classe utilizada para retornar os valores das variáveis de sessão genéricas
    // Ex: CodCliente, CodMunicipio etc...
    TrataDadosSessao varDadosSessao = new TrataDadosSessao();
    // 1o. Parametro Configurado - Através da classe TrataDadosSessao, utilizando um método Get
    // <alterar>
    String valor1 = varDadosSessao.getCodCliente();
    String valor2 = varDadosSessao.getCodMunicipio();
    //Cria o objeto que retorna o ApplicationModule
    ApplicationModule am = ServletBindingUtils.getApplicationModule(context);
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoLocal = am.findViewObject("ListaTipoLocalView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoLocal.setWhereClauseParam(0,valor1);
    TipoLocal.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoLocal.executeQuery();
    // Fim das Configurações da Query da Lista
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoDestLixo = am.findViewObject("ListaDestinoLixoView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoDestLixo.setWhereClauseParam(0,valor1);
    TipoDestLixo.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoDestLixo.executeQuery();
    // Fim das Configurações da Query da Lista
    // Retorna o Resultado para a Página
    return new EventResult(page);
    The code works very well...
    And, I'm sorry for my two repost's in UIX Forum about this in a few time.
    Thank very much...
    Danilo

  • Need help in clearing string buffer during dynamic VO where clause in oaf

    Hi All,
    I am dynamically setting where clause in OAF using string buffer, but the issue is when i am executing the vo multiple times so the old data in the string buffer it is not clearing .so every time my where clause adding to the query and it is erroring out, please help me how to clear string buffer class in oaf.
    Thnaks

    Hi,
    Could you please share the code segment for reference. Then we can tell the solution.
    Regards,
    Tarun

  • How to not have your view objects query before the page comes up?

    Hello. I have a view object that is part of a LOV. This view object always gets queried on bringing up the page (I need it to happen on the LOV click) How can I have the VO not queried initially? I tried setting the Iterator to refresh never, but it still does it. Here's the log before the page comes up:
    [363] BindingContext.put( ContactsAMDataControl@irepair_DataBindings_cpx, oracle.jbo.uicli.binding.JUApplication )
    [364] Resolving VO:ContactsVVO1 for iterator binding:ContactsVVO1Iterator
    [365] Changing iterator range size from :1 to :25
    [366] ContactsVVO1 ViewRowSetImpl.execute caused params to be "un"changed
    [367] Column count: 13
    [368] ViewObject: ContactsVVO1 Created new QUERY statement
    [369] ContactsVVO1>#q computed SQLStmtBufLen: 663, actual=623, storing=653
    [370] select
    oc.JOB_TITLE,
    oc.PARTY_SITE_ID,
    RELATIONSHIP_ID ,
    hp.PARTY_NAME OBJECT_NAME, -- Contact
    OBJECT_ID ,
    hr.PARTY_ID ,
    oc.CONTACT_KEY,
    subject_id,
    hp.EMAIL_ADDRESS,
    hp.primary_phone_country_code,
    hp.primary_phone_area_code,
    hp.primary_phone_number
    from HZ_ORG_CONTACT_ROLES ocr,
    HZ_ORG_CONTACTS oc,
    HZ_PARTIES hp,
    HZ_RELATIONSHIPS hr
    where
    hp.party_id = hr.object_id
    and hr.RELATIONSHIP_ID=oc. PARTY_RELATIONSHIP_ID
    and oc.ORG_CONTACT_ID = ocr.ORG_CONTACT_ID(+)
    and relationship_code = 'CONTACT'
    order by OBJECT_NAME
    [371] Bind params for ViewObject: ContactsVVO1
    [372] DCUtil, returning:oracle.adf.model.binding.DCParameter, for ContactsAMDataControl
    [373] LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1 ViewRowSetImpl.execute caused params to be "un"changed
    [374] Column count: 13
    [375] ViewObject: LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1 Created new QUERY statement
    [376] LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1>#q computed SQLStmtBufLen: 663, actual=623, storing=653
    [377] select
    oc.JOB_TITLE,
    oc.PARTY_SITE_ID,
    RELATIONSHIP_ID ,
    hp.PARTY_NAME OBJECT_NAME, -- Contact
    OBJECT_ID ,
    hr.PARTY_ID ,
    oc.CONTACT_KEY,
    subject_id,
    hp.EMAIL_ADDRESS,
    hp.primary_phone_country_code,
    hp.primary_phone_area_code,
    hp.primary_phone_number
    from HZ_ORG_CONTACT_ROLES ocr,
    HZ_ORG_CONTACTS oc,
    HZ_PARTIES hp,
    HZ_RELATIONSHIPS hr
    where
    hp.party_id = hr.object_id
    and hr.RELATIONSHIP_ID=oc. PARTY_RELATIONSHIP_ID
    and oc.ORG_CONTACT_ID = ocr.ORG_CONTACT_ID(+)
    and relationship_code = 'CONTACT'
    order by OBJECT_NAME
    [378] Bind params for ViewObject: LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1
    Thanks!
    Edited by: user621288 on Jun 17, 2009 4:11 PM

    There are two ways:
    1. Uncheck "Query List Automatically" under List UI Hints in the view object overview xml.
    2. In the query add "where 1=:bnum and 1 is not null" and execute the query in the LaunchPopupEvent
        public void userIdId_launchPopupListener(LaunchPopupEvent launchPopupEvent) {
            DCIteratorBinding myListIter = (getItrtBindings("MyLovViewObj1Iterator"));
            ViewObject vo = myListIter.getViewObject();
            NavigatableRowIterator myItemList = myListIter.getNavigatableRowIterator();
            Row row = myItemList.first();
            Object[] val = row.getAttributeValues();
            ViewRowSetImpl vor = (ViewRowSetImpl)val[row.getAttributeCount() - 1];
            vor.setNamedWhereClauseParam("bnum", new BigDecimal(1));
            vor.executeQuery();
        }

  • JSF action before the page is displayed?

    Hi all,
    What's the best way to execute a backing bean method before the page is rendered?
    I have to fill out some selectOneMenus on the page with a backing bean method.
    Will the onload JavaScript function in the <body> tag do this for me? How does one call a JSF method from JavaScript?
    Thanks for any help!
    Illu

    Why not just bind the value of a selectOneMenu to a list of SelectItems, like this:
                        <h:selectOneMenu styleClass="selectOneMenu" id="acctprodMenu" value="#{accountServiceMappingAction.mappingBean.acctPrdId}" >
                             <f:selectItems value="#{adjustmentsInit.accountProducts}"/>
                        </h:selectOneMenu>      Where in the adjustmentsInit bean, there is a method like this:
         public List getAccountProducts() {
              ArrayList temp = new ArrayList();
              Iterator itr = someService.getAccProdList.iterator();
              while (itr.hasNext()) {
                   AccountProduct acct = (AccountProduct) itr.next();
                   SelectItem item =
                        new SelectItem(
                             new Integer(acct.getAccountProductId()),
                             acct.getAccountProductName());
                   temp.add(item);
              return temp;
         }This way, once you load the page, it will have what you need in it.

  • Using a dummy where-clause to force the use of an index

    I notice that an index only gets used when I use the index key in the where clause. Should I use a dummy where clause to force the index to be used?
    SQL> create table emp (
    2 empno NUMBER(5),
    3 empname VARCHAR2(15) );
    Table created.
    SQL> create index idx_emp_no on emp (empno);
    Index created.
    SQL> insert into emp (empno, empname) values (1, 'Peter');
    1 row created.
    SQL> set autotrace traceonly;
    SQL> select empno from emp;
    Execution Plan
    Plan hash value: 3956160932
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 13 | 3 (0)| 00:00:01 |
    | 1 | TABLE ACCESS FULL| EMP | 1 | 13 | 3 (0)| 00:00:01 |
    SQL> select empno from emp where empno > 0;
    Execution Plan
    Plan hash value: 434430053
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 13 | 1 (0)| 00:00:01 |
    |* 1 | INDEX RANGE SCAN| IDX_EMP_NO | 1 | 13 | 1 (0)| 00:00:01 |
    As you can see, using a dummy where clause (empno > 0), I manage to reduce the cost from 3 to 1.

    Again. Be careful with comparisons. But I like the discussion. It is usefull to carefully look at what happens "behind the scenes" and find a sensible explaination for that.
    Your new scenario now is different. By selecting one specific row instead of selection all you already made an assumption. That only one or few of the rows are returned. Andre's statement still is correct. Now the CBO will prefere the index scan.
    The CBO now has to decide between two options.
    Option a) use the index.
    This means =>
    Step 1: Access the index to find the value
    Step 2: Access the table using the rowid that was found in the index leaf entry.
    Option b) scan the full table
    This means =>
    Step 1: Iterate over all rows of the table
    Step 2: Apply a filter condition (empno = :x)
    We can see this execution plan by adding a hint to the query.
    select /*+ FULL(emp) */ * from emp where empno = 1;This hint will force the CBO to access the table emp using a full table scan.
    The cost in my environment for option B is 3.
    Option A has a cost with 2. Therefore the CBO prefers Option A.
    However this can easily change.
    Consider the following
    begin
      for i in 1..1000 loop
        insert into emp (empno, empname) values (1, 'Employee');
      end loop;
    end;
    commit;
    execute dbms_stats.gather_table_stats(user,'EMP');The run the select again.
    SQL> set autotrace traceonly
    SQL> select * from emp where empno = 1;
    1001 Zeilen ausgewõhlt.
    Ausf³hrungsplan
    Plan hash value: 3956160932
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |  1001 | 12012 |     3   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| EMP  |  1001 | 12012 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("EMPNO"=1)
    Statistiken
              1  recursive calls
              0  db block gets
             74  consistent gets
              0  physical reads
              0  redo size
          18356  bytes sent via SQL*Net to client
           1250  bytes received via SQL*Net from client
             68  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
           1001  rows processedThe CBO now prefers the full table scan and not the index access.
    If we force it to use an index then the cost increases.
    SQL> set linesize 100
    SQL> select /*+INDEX(emp) */ * from emp where empno = 1
    1001 Zeilen ausgewõhlt.
    Ausf³hrungsplan
    Plan hash value: 2426388914
    | Id  | Operation                   | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |           |  1001 | 12012 |     5   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP       |  1001 | 12012 |     5   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | IDX_EMPNO |  1001 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("EMPNO"=1)
    Statistiken
              0  recursive calls
              0  db block gets
            139  consistent gets
              0  physical reads
              0  redo size
          30550  bytes sent via SQL*Net to client
           1250  bytes received via SQL*Net from client
             67  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
           1001  rows processed
    SQL>The cost using the index range scan is now 5. WHile the FTS is still 3. Therefore the CBO prefers to use the FTS.

  • Bc4j: set where clause at runtime for view objcet ?

    how to set where clause for a view object that is not put in a subselect at runtime ?
    select a.para_id, b.para_para_id
    from table1 a, table2 b
    need to set at runtime either:
    where a.para_id = b.para_para_id
    or:
    where a.para_id = b.para_para_id(+)
    problem is that bc4j is useing it as followed:
    select * from (
    select a.para_id, b.para_para_id
    from table1 a, table2 b
    ) where (a.para_id = b.para_para_id(+))
    cant use outer join like this
    any suggestions

    If you do not want to issue the framework built query, you may want to set the query for a VO yourself instead of setting just the where clause by using setQuery() api. TO revert back to framework built query, call setQuery(null).
    This way, when you need the xtra where-clause and not the "innerSQL stuff", you can build a custom sql with whereclause etc, and call setQuery(), execute that SQL, perform your tricks with the VO and then when the VO is usage is done, reset the VO query to original by calling setQuery(null).

  • Set Where Clause of VL Using Coding???

    How to Set Where Clause of VL(View Link) Using Coding???

    i think,if you can not change the VL def,change the SQL(like give a translate column)

  • Dynamic XQuery Where clause

    I have the following schema:
    <?xml version="1.0"?>
    <xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="CountryRiskService"
    targetNamespace="CountryRiskService"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
    <xs:element name="CountryRiskParameters">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="countryId" type="xs:int" minOccurs="1" maxOccurs="unbounded"/>
    <xs:element name="catA" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    I am passing this into my Logical Data Service, what I want to do is create a dynamic XQuery where clause if the catA field is populated, ignore it if it isn’t, so basically, I want to be able to create a dynamic query based on the parameters requested, so I have the following XQUERY:
    declare function tns:getCountries($countryRiskInput as element(ns7:CountryRiskParameters)) as element(ns0:CountryRiskInfo)* {
    for $tbl_high_risk_countries in ns1:tbl_high_risk_countries()
    where $countryRiskInput/ns4:countryId = $tbl_high_risk_countries/country_id
    where $countryRiskInput/ns4:catA = $tbl_high_risk_countries/risk_catA
    I really thought that DSP would be able to handle this on the fly since the element is optional but if I don’t populate it, I get nothing back, the idea is I want to increase the number of elements in my schema so my consumers have the ability to filter the results they want, so above, I don’t want the second where clause if catA isn't specified, any ideas how to accomplish this?

    Simply add the disjunction of the input being empty.
    for $tbl_high_risk_countries in ns1:tbl_high_risk_countries()
    where $countryRiskInput/ns4:countryId = $tbl_high_risk_countries/country_id
    where ( $countryRiskInput/ns4:catA = $tbl_high_risk_countries/risk_catA or empty( $countryRiskInput/ns4:catA )
    But suppose you have 27 different elements that you might want to filter on - the xquery gets long and ugly. You might want to looking into using FilterXQuery. Visit http://edocs.bea.com/aldsp/docs25/, search on FilterXQuery, look for the tutorial.
    If your queries get more complicated, you would do well to look into generating ad hoc queries. (edocs as well).

Maybe you are looking for

  • HOW TO USE A VIDEO PHONE WITH MY LAPTOB THETHERING MY BLACKBERRY

    Hello every one I have a curve from Verizon I use this phone as theder with my laptopworks perfectly but what I try to due is connect to my laptop a video phone from ACN wish works with internet connecting to a ether net portFor some reason my phone

  • Exception in Server Logs : JMSCC0033 While using Weblogic 10.3.X and MQ 7

    Following exception is contuniously occuring in Weblogic Managed Server Logs after migrating to IBM MQ 7. com.ibm.msg.client.jms.DetailedIllegalStateException: JMSCC0033: A synchronous method call is not permitted when a session is being used asynchr

  • Transfer backuped apps from pc to ios

    I backed up all of my apps and photos from my ipad to itunes account an can't seem to figure out how to get them back on my ipad now that i reset it? please help. thanks

  • Statistics analysis in Oracle 8i

    Is there a statisticS utility in Oracle 8i, which can do statistical analysis on data tables in Oracle? I am not talking about statistics in Oracle for performance tuning. If not, is there a 3rd party software to do this work? Thanks!

  • Please anyone explain me about HTTP adapter

    Can anyone explain about HTTP Adapter (sender,receiver) End to End implementation with screen shots?