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).

Similar Messages

  • How To change the ADF View Object  query where-clause at RunTime?

    I am trying to create a simple display page which will display user data (username, assoc_dist_id, assoc_agent_id, status , etc). The User data is stored in a database table and i am using an ADF Read Only table based on the View Object to display the data on the JSF page.
    However, i want to display only the users that a particular person accessing the page has the AUTH LEVEL to see. e.g. If the person accessing the page is an 'ApplicationAdministrator' then the page should display all users in the table, If its a 'DistributorAdministrator' then the page should display only users associated with that Distributor (i.e. assoc_dist_id = :p_Dist_id ) and If its an 'AgentAdministrator' , then the page should display only users associated with that Agent ( i.e. assoc_agent_id = :p_Agent_id).
    Currently my af:table component displays all the users in the table because the query for the view object is (select * from users) . However, i want to use the same viewobject and just set the where-clause at runtime with the appropriate parameter to restrict the dataset returned.
    Do anyone knows how to accomplish this ?

    David,
    See the custom method initializeDynamicVariableDefaults() in the SRViewObjectImpl.java class in the FrameworkExtentions project in the SRDemoSampleADFBC sample application. You can find out how to install the demo if you haven't already from the ADF Learning Center at:
    http://www.oracle.com/technology/products/adf/learnadf.html
    This class is a framework extension class for view objects that adds a neat, generic feature to be able to dynamic default the value of named bind variables. You can read more about what framework extension classes are and how to use them in Chapter 25, "Advanced Business Components Techniques" of the ADF Developer's Guide for Forms/4GL Developers, also available at the learning center above.
    It is an example of generic framework functionality that "kicks in" based on the presence of custom metadata properties on a named bind variable. See section 25.3.3 "Implementing Generic Functionality Driven by Custom Properties" in the dev guide for more details. Using this sample code, if you add a bind variable to a view object, and define a custom metadata property named "DynamicDefaultValue" on that bind variable, and set this custom metadata property to the value "CurrentUser", then that bind variable will have its value dynamically defaulted to the name of the authenticated user logged in. If instead you set this custom property to the value "UserRole", then the bind variable will be set to the comma-separated string containing the list of roles that the authenticated user is part of.
    Once you've created a framework extension class for view objects like this, you can have the view objects you create inherit this generic functionality.See section 25.1.4 "How to Base an ADF Component on a Framework Extension Class" in the dev guide for more info on this.
    By adapting a technique like this (or some idea similar that better suits your needs) you can have your view object query contain bind variables whose values automatically take on the defaults based on something in the user-session environment.

  • 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

  • A bug? BC4J ViewObject where clause change doesn't affect view contents

    Hi!
    I've found the following interesting behaviour (maybe a bug?) of BC4J ViewObject caching:
    1) make a viewobject with where clause and 1 parameter in it.
    2) set parameter binding to some value
    3) execute query
    4) then change viewobject's where clause, but leave parameter binding intact
    5) execute query again
    6) view object contents haven't changed!
    actually, changing where clause text should make view object requery data from the database instead of using cached rows...
    If to add a call to viewobject.clearCache() before second viewobject.executeQuery(), then everything works fine and view object's contents are changed.
    Does anybody have any ideas about this? Or is this a some kind of a feature, or it is already fixed in a newer version of JDev?
    Thnx!
    PS. JDeveloper version 9.0.3.4 (build 1247).

    delete message

  • 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)

  • Group by, setting where clause in View Objects

    Hello,
    I have a problem with View Objects in BC4j. Cause I cannot use a column in the where clause of a view object that is not also an attribute of the view object, I am unable to group a statement as I want to. Is there a way to solve this problem?
    Thanks in advance!
    Britta

    What version are you using..I tried a simple WHERE clause using an attribute which is not part of the VO and that works ok....
    Thanks
    Grant Ronald
    Oracle Product Management

  • Programatically set where clause or view criteria not working in managed bean

    I get a view using finditerator then then apply setwhere or view criteria but it does not filter the original rows. code is as follows
    DCIteratorBinding dcIter3 =
    ADFUtils.findIterator("PlanColorsIterator");    
    ViewObject cvo = dcIter3.getViewObject();
    cvo.setNamedWhereClauseParam("Plno","4000");  // not working
       /*   // not working
    cvo.applyViewCriteria(cvo.getViewCriteriaManager().getViewCriteria("PlanColorsCriteria"));
    cvo.ensureVariableManager().setVariableValue("Plno", "4000");
    cvo.executeQuery();
    /* not working
    cvo.setWhereClause("plan_no = :ThePlanType");
    cvo.defineNamedWhereClauseParam("ThePlanType", null, null);
    cvo.setNamedWhereClauseParam("ThePlanType", "4000");
    cvo.executeQuery();

    thanks for reply.
    Jdeveloper version is 11.1.1.4.0.
    Actually the vo on which I am trying to set set where is used as source to act as cursor  to get values from filtered rows using set where and copy the this cursor values to another target vo. I am not showing these source values just getting values.
    DCIteratorBinding dcIter2 =
    ADFUtils.findIterator("PlotDtl2Iterator");     
    ViewObject dvo = dcIter2.getViewObject();
    // colors to copy 
    DCIteratorBinding dcIter3 =
    ADFUtils.findIterator("PlanColorsIterator");    
    ViewObject cvo = dcIter3.getViewObject();
    cvo.setNamedWhereClauseParam("Plno","4000");
    cvo.applyViewCriteria(cvo.getViewCriteriaManager().getViewCriteria("PlanColorsCriteria"));
    cvo.ensureVariableManager().setVariableValue("Plno", "4000");
    cvo.executeQuery();
    cvo.setWhereClause("plan_no = :ThePlanType");
    cvo.defineNamedWhereClauseParam("ThePlanType", null, null);
    cvo.setNamedWhereClauseParam("ThePlanType", "4000");
    cvo.executeQuery();
    int totalCount=cvo.getRowCount();
    cvo.setRangeSize(totalCount);
    Row[] rArray=cvo.getAllRowsInRange();
    for (Row r:rArray){
    NameValuePairs nvp = new NameValuePairs();      
    nvp.setAttribute("Description",r.getAttribute("Description"));
    nvp.setAttribute("PlanNo",r.getAttribute("PlanNo"));
    nvp.setAttribute("MainAcc",r.getAttribute("MainAcc"));
    nvp.setAttribute("Plqty",r.getAttribute("Qty"));
    nvp.setAttribute("Cdkid",r.getAttribute("CdkId"));
    nvp.setAttribute("FabricCode",r.getAttribute("FabricCode"));
    nvp.setAttribute("DyeWash",r.getAttribute("DyeWash"));
    //  nvp.setAttribute("Description","test");
    Row drow = dvo.createAndInitRow(nvp);      
    dvo.insertRow(drow); 

  • Change JDBC select SQL query's where clause at runtime

    Hi,
    I have one JDBC sender channel with Select SQL Query which helps in fetching data from JDE table. We have defined where clause to fetch some particular records i.e. if ABC = NULL then fetch the record.. and then update query is used to turn that flag to "Y" i.e. ABC ="Y" so that next time the channel don't pick the same records again.
    Now the problem is that if we want to fetch some records again whose flag has been set to "Y" we cannot change the select query again and again in the production environment.
    Is there any way to change the select query of the JDBC channel at runtime e.g. Picking up some flat file where the conditions for the particular records to be picked are defined (ID=123) and changing the WHERE clause of select query in the JDBC channel for those records to be picked without using BPM.
    Thank you!
    With regards,
    Simran

    Hi Simran,
    Yes, it is possible with the help of store procedure. In SQL Server there is a IF-Else Conditional block, which you can use inside store procedure. Create a SP with 2 additional parameter something like FlagReadAgain and KeyField. Pass the flag always as True or False. For the Key field pass the record key which you want to read again if you are passing the Flag as True else pass it as 0 or whatever.
    In the procedure check if the value of flag is True -> If yes, Read the entry with key name specified in where part.
    In the else part put the query which you are using for the normal flow.
    IF (FlagReadAgain) = TRUE
    BEGIN
       SELECT EmpName, EmpAddress
       FROM Employee
       WHERE EmpID = 'E001'
    END
    ELSE
       BEGIN
         SELECT EmpName, EmpAddress
         FROM Employee
         WHERE Status = 'N'
       END
    You may also use the approach which Srini mentioned. Create an application to restore any value to intial stage so that it can be picked up by XI when it poll again.
    Choose any approach which you like.
    Regards,
    Jitender Chauhan

  • 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

  • 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

  • How to set where clause for a Valueset from OAF Page

    Hi all
    I am customizing a standard page Employee Self Service. I have added some additional fields to existing KFF. There was field say "CHILD NAME" which is a free text field. The client now wants it to be a Drop down(or as LOV) which should display only the name of the child of the employee who is logged in.
    I want to know if i can achieve it by attaching a value set to the CHILD NAME field. But how to set the employee id to that valueset in order to show only the children of the particular employee
    Regards,
    Pradeep

    Hi Pradeep,
    If you could share some more details of the region you are trying to customize we can help
    1. Do you need this selected value through lov or drop to be saved to the database
    2. Right now, the "CHILD NAME"  is this part of any table or in a panel. If would be best if you paste the PG.XMl and point the field you are trying to change.
    This would help us to give you the best solution
    Thanks
    Sandeep

  • BC4J,Setting a default Value In a View With Data From An Other View

    hi
    I'm developping A BC4J. I want to set the default value of a field By counting the number of rows in an other view.
    So I want to instanciate the view and execute the sql statement and get the result.
    Is that the right manner to do it or not.
    can someone help me to do that
    cheers
    ghassen

    There's lots of ways to skin this cat depending upon whether you mean "database view" or "view object" when you say "view", and individual requirements.
    Given database views v1 and v2 with a common key between them
    select v1.x, count(*) from v1,v2 where v1.key = v2.key group by v1.x;
    either in the database view or in expert mode for the view object ( I think it'll take group by, but never done it ). ( assumption is that v1.x is a primary key for v1 )...
    Try this from sql*Plus first to get a feel for how this works.
    The catch with the above is that it is "static"... if you can ADD rows to v2 in your application... they aren't visible in the count until saved and requeried.
    Another way ( I think... hopefully Oracle folk will kibitz... )
    Create your own attribute on the view object like "TheOtherCount".
    In the view object's RowImpl, find the "getTheOtherCount". Find the count of rows in the second view object or entity object or rowSetInfo through the method of your choice. ( If you've already set up a master detail relationship that is active you can just get the rowcount! ). Refer to earlier postings on how to get the rowcount, or to create a dynamic view query to get the count.
    The nice thing is that this should reflect your counts even if the second view has added or removed rows... but will probably move like a snail.
    Note that if you have a need where you want the row count updated in a frame for v1 whenever v2 is added to or removed from... well... then you need to set up some sort of event listener to do a redisplay of v1's frame, I'd think? Since the attribute you've created in the view object is not based on an entity object attribute, it has no way to know when it has been "updated" via an additional or removed row from the target.
    I'm posting the above because no one has responded yet... it may form a place to start from. And maybe someone in the know will go "No, No, No... KKirk... it doesn't work that way at all!" and fill us in on how this can be accomplished!
    Good Luck

  • Rectangular Pixel Setting: Where? (also tips for higher quality?)

    The bottom line: Where can I find the setting -- in Final Cut, in Compressor, or in DVD Studio Pro -- to use rectangular instead of square pixels on export (or burn or wherever)?
    The story: I'm trying to burn a DVD for a friend of our kids' jazz concert.  It looks great on computer.  Once in DVD Studio Pro's simulate function, though, all the the performers look slightly stretched.  They look that way on TV, too.  My understanding is that this is due to the difference in computer and TV pixel shapes and that there is a setting somewhere to address it.
    These are my settings in Compressor. If that helps.  And, if anyone can recommend settings for higher quality (I'm getting some stepping which looks lousy on big TVs), I would love to hear them
    Name: MPEG-2 7.5 Mbps 2-pass
    Description:
    File Extension: m2v
    Estimated size: 2.88 GB/hour of source
    Type: MPEG-2 video elementary stream
        Usage:SD DVD
    Video Encoder
        Format: M2V
        Width and Height: Automatic
        Pixel aspect ratio: Default
        Crop: None
        Padding: None
        Frame rate: (100% of source)
        Frame Controls: Automatically selected: Off
        Start timecode from source
        Aspect ratio: Automatic
            Selected 16:9
        Field dominance: Automatic
        Average bit rate: 6.4 (Mbps)
        2 Pass VBR enabled
            Maximum bit rate: 7.5 (Mbps)
        High quality
        Best motion estimation
        Closed GOP Size: 1/2 second, Structure: IBBP
        DVD Studio Pro meta-data enabled

    Found it!
    It's in DVD Studio Pro, on the Settings drop down found in the upper right corner of the Viewer window

  • Setting query datasource at runtime for FORM Datablock

    Hello all,
    we have below requirement -
    the Form datablock is build on a customized table. we need to populate some of the fields of the form by writing a view which joins tables across variousl modules. the form data will be queried by giving po number in query find window. then the rest of the fields are entered from the form front end and saved to the DB Table. we want to query the new po numbers from the view from the query find window. where as the existing po numbers will be queried from the form datablock table only... for this i wrote the below pre_query trigger at datablock level.
    declare
         po_num number;
    BEGIN
    :parameter.G_query_find := 'TRUE' ;
    select count(*) into po_num from ICS_PO_IBOT_ICOT_REP where vendor_po_num = nvl(:QUERY_FIND.PO_NUMBER, vendor_po_num);
         if po_num > 0 then
    COPY(:QUERY_FIND.PO_NUMBER, 'ICS_PO_IBOT_ICOT_REP.VENDOR_PO_NUM');
         else
    set_block_property ('ICS_PO_IBOT_ICOT_REP', QUERY_DATA_SOURCE_NAME, '(select * from ICS_PO_IBOT_ICOT_REP_VIEW where
    VENDOR_PO_NUM = :QUERY_FIND.PO_NUMBER)');
    end if;
    :parameter.G_query_find := 'FALSE';
    end;
    here ICS_PO_IBOT_ICOT_REP - DB TABLE
    ICS_PO_IBOT_ICOT_REP_VIEW - view
    condition is checking for existing pos in table.....
    The above form while running from oracle apps, entering a New po number in query find window gives following error -
    ORA-01008: not all variables are bound.
    whereas for old pos it works correctly......................Please help on this...
    on more analysis from help-diagnostic-system - last query it gives the below code
    SELECT LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN,CREATION_DATE,CREATED_BY,ATTRIBUTE1,ATTRIBUTE2,ATTRIBUTE3,ATTRIBUTE4,ATTRIBUTE5,ATTRIBUTE6,ATTRIBUTE7,ATTRIBUTE8,ATTRIBUTE9,ATTRIBUTE10,ATTRIBUTE11,ATTRIBUTE12,ATTRIBUTE13,ATTRIBUTE14,ATTRIBUTE15,ATTRIBUTE16,ATTRIBUTE17,ATTRIBUTE18,ATTRIBUTE19,ATTRIBUTE20,ATTRIBUTE21,ATTRIBUTE22,ATTRIBUTE23,ATTRIBUTE24,ATTRIBUTE25,ATTRIBUTE26,ATTRIBUTE27,ATTRIBUTE28,ATTRIBUTE29,ATTRIBUTE30,ORG_ID,CONSULTANT_ID,CONSULTANT_NAME,VENDOR_NAME,VENDOR_CONTACT_NUM,VENDOR_EMAIL,VENDOR_DIVERSITY_STATUS,CONSULTANT_INFO,MINORITY_STATUS,REMARK,CBC_DATE,ACKN_DATE,IBM_PO,PO_STATUS,SOW_NUMBER,PO_TYPE,START_DATE_ON_PO,IBM_PO_ISSUE_DT,IBM_PO_ICS_RCV_DT,IBM_PO_CHANGE_DT,SKILL_LEVEL,REQUESTER,REQ_CONT_NO,REQ_EMAIL_ID,BUYER,BUYER_CONT_NO,BUYER_EMAIL_ID,TRANS_STATUS,ST_BILL_RATE,ST_HOURS,OT_BILL_RATE,OT_HOURS,EXPENSES,TOTAL,REGION,AREA,LOCATION,STATE,JOB_ROLE,JOB_SKILL,LOB,CSA_REQ_NO,CSA_SUBMIT_DT,CLIENT,WAGES,EXEMPT,BENEFIT_STATUS,US_NATIONAL,VISA_STATUS,MATRIX_PRICE,SCORP_C2C_W2H,REFERAL_STATUS,REBATE_STATUS,REBATE_PERCENTAGE,REBATE_DESC,CSA_FEE_STATUS,CSA_PERCENTAGE,ICS_FEE,MARK_UP,ADD_INFO,VENDOR_PO_NUM,CCF_CREATED_DATE,CCF_MODIFIED_DATE,DOJ,DOT,DATE_OF_MODIFICATION_DOT,ST_PAY_RATE,ST_BURDEN_RATE,OT_PAY_RATE,OT_BURDEN_RATE,RATE_DESC,SALES_PERSON,RECRUITER,PROJECT,ACCRUAL_REVERSAL,WEEK_1,WEEK_2,WEEK_3,WEEK_4,WEEK_5,ESTIMATE,ACCRUALS,TOTAL_HOURS,BILLABLE_AMOUNT,TOTAL_COST,GM_AMOUNT,GM_PERCENTAGE,INVOICE_NUMBER,INVOICE_AMOUNT,SUBMITTED_ON,RENEWAL_PO,REJECTED_ON,RESUBMITTED_ON FROM (select * from ICS_PO_IBOT_ICOT_REP_VIEW where
    VENDOR_PO_NUM = :QUERY_FIND.PO_NUMBER)
    please suggest what am i missing?????????????????????
    Thanks,
    Sam

    here are the answers to your questions-
    How do you update record?
    Do you have any ON-UPDATE, POST-UPDATE, PRE-UPDATE triggers on this block?
    Do you have any database triggers on the table?
    What is DML Data Target Type property of this block?
    it was not required for me to write any ON-UPDATE, POST-UPDATE, PRE-UPDATE triggers on this block to update record. these are done or taken care off automatically. no database trigger is associated with the table. DML data target type is table.
    also the block has Query data source type as Table only. and the query data source name is the db table ie ICS_PO_IBOT_ICOT_REP. so what u suggest now? if i simply click on new button and enter some data onto form and save it it is inserting record onto db table. so why cant it insert the record in current scenario when a new PO is queried from the view. Please help on this where i am missing.................

Maybe you are looking for