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)
Similar Messages
-
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...
DaniloHi 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 -
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 suggestionsIf 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). -
Why I cannot use RowID in where clause but can use it in order by clause
I am on SQL Server 2008.
1. If I use
SELECT (ROW_NUMBER() over
(order by ImportId, ScenarioId, SiteID, AssetID, LocalSKUID, WEEKID, MonthID)) RowID, *
FROM [JnJ_Version1].[dbo].[td_Production_Week]
order by RowID
Statement works
But
2. If I use
SELECT (ROW_NUMBER() over
(order by ImportId, ScenarioId, SiteID, AssetID, LocalSKUID, WEEKID, MonthID)) RowID, *
FROM [JnJ_Version1].[dbo].[td_Production_Week]
where RowID > 10000
I get error, RowID is an invalid column Name why? How to correct query 2.This is due to the logical evaluation order of a SELECT statement. Logically, a SELECT statement is computed in the order:
FROM (which includes JOIN)
WHERE
GROUP BY
HAVING
SELECT
ORDER BY
OFFSET
Thus, you can use what is defined in the SELECT list in the ORDER BY clause, but not in the WHERE clause.
In the case of row_number(), this has immediate repurcussions. row_number() is computed from the rows as they arrive the SELECT clause, and if you then you would filter on the value in the WHERE clause you would be going round in circles.
To do what you are looking for, you use a nested table, for instance with a CTE:
WITH numbering AS (
SELECT (ROW_NUMBER() over
(order by ImportId, ScenarioId, SiteID, AssetID, LocalSKUID, WEEKID, MonthID)) RowID, *
FROM [JnJ_Version1].[dbo].[td_Production_Week]
SELECT *
FROM numbering
WHERE RowID > 10000
Erland Sommarskog, SQL Server MVP, [email protected] -
Dynamic Where Clause in select using member attribute of class
Hello,
can anybody provide me some tips how to solve this problem:
SELECT (lv_sql_select) INTO CORRESPONDING FIELDS OF TABLE lt_cntrl2
FROM (lv_db_name)
FOR ALL ENTRIES IN mt_guids
WHERE (lv_sql_where).
works perfectly fine if I use a local table variable or a member of my class. But if I build my where clause using a member attribute of my class which comes from the interace- exactly the same type and data as before I get a dump.
SELECT (lv_sql_select) INTO CORRESPONDING FIELDS OF TABLE lt_xyz
FROM (lv_db_name)
FOR ALL ENTRIES IN if_abc~mt_guids
my where clause "guid = if_abc~mt_guids-guid.
Dump:
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SEMANTICS', was
not caught in
procedure "....GET_DATA" "(METHOD)", nor was it propagated
by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
Das laufende ABAP-Programm wollte eine Open SQL-Anweisung ausführen,
die eine dynamische Angabe enthält. Der Parser lieferte jedoch den
Fehler: "Wrong table name or table alias name table alias name
table alias name "....". table alias name
"...". table alias name "...". t"Hi Marco Freischlag,
As per my understanding , if we give for all entries we want to use internal table , For where conditions you want to pass variable , not internal table one filed,because it will not have header line...
so code like this...
SELECT (lv_sql_select) INTO CORRESPONDING FIELDS OF TABLE lt_xyz
FROM (lv_db_name)
FOR ALL ENTRIES IN if_abc~mt_guids
where guid = if_abc~mt_guids-guid. " Here pass some variable or work area in it and test.
Thanks,
Vijay SR -
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!
BrittaWhat 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); -
Generate WHERE clause for VO using imported entities
Hi,
I am using JDev 9.0.3 Preview.
I attempt to create in one BC project a view based on a join of three entities.
One of the entities is from the same project, but the other two are imported. After importing the project(s) containing the two additional entities, I have to create the associations (based on database constraints) between the "inner" entity and the "imported" entities. This is OK (apart from known problems, with known workarounds...)
Now I want to modify the default view created by the wizard for the inner entity and add the two imported entities. When I add the first imported entity, all is OK, the WHERE clause is properly updated, according to the definition of the association. But, when the second imported entity is added, the WHERE clause remains unchanged.
Is this the expected behaviour?
Thanks,
AdrianI tried to reproduce this in our production 9.0.3.1035 build which will be available here very shortly on OTN, and this issue is no longer a problem in 9.0.3 production. The WHERE clause is formulated correctly.
-
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.
ThanksHi,
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 -
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
DebHi 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 -
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.
JayasreeI'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 -
How to set two Conditions Simultaneously in set where clause
Hi,
I have a messgechoice item , and i need to fire messagechoice VO with two conditions.
For Eg:-- we have three Items ProjectContractor& Work Order on a custom Page , now i need work order list should populate on lelection of project & contractor both, so i have apply a fire partial event on contractor where i i get the parameter values as follows:--
CO Code
if("OrderNoself".equals(event))
String value21 = (String)pageContext.getParameter("ProjectName");
System.out.println("The Selected Project Name for self Contractor is "+value21);
String value22 = (String)pageContext.getParameter("ContractorName");
System.out.println("The SelectedContractor Name for ContractorName is "+value22);
Serializable [] params11 = {value21,value22} ;
am.invokeMethod("initWorkOrderNumberself",params11);
AM Code
public void initWorkOrderNumberself(String ProjectName,String ContractorName");
getDprWorkOrderpopVO1().setWhereClause("PROJECT_NAME = " + "'"+ProjectName+"'");
getDprWorkOrderpopVO1().setWhereClause("CONTRACTOR_NAME = " + "'"+ContractorName+"'");
getDprWorkOrderpopVO1().executeQuery();
Now when i run my form then Work order list only populateon set conditions ofContractor NAme only.
Please suggest....Hi Tarun,
Thanx for ur reply,
i have used below mwntioned code provided by you but still i m getting error...
public void initWorkOrderNumber(String ProjectName,String ContractorName)
//getDprWorkOrderpopVO1().setWhereClause("CONTRACTOR_NAME = " + "'"+ContractorName+"'");
//getDprWorkOrderpopVO1().executeQuery();
getDprWorkOrderpopVO1().setWhereClause("PROJECT_NAME =:1 AND CONTRACTOR_NAME=:2");
getDprWorkOrderpopVO1().setWhereClauseParams(null);
getDprWorkOrderpopVO1().setWhereClauseParam(1,ProjectName);
getDprWorkOrderpopVO1().setWhereClauseParam(2,ContractorName);
getDprWorkOrderpopVO1().executeQuery();
ERROR:---
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (select * from omaxe_work_order_headers
where work_order_number is not null) QRSLT WHERE (PROJECT_NAME =:1 AND CONTRACTOR_NAME=:2)
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:862)
at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:985)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:210)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:721)
at omaxe.oracle.apps.xxopa.boqmain.webui.OmaxeDPRCO.processFormRequest(OmaxeDPRCO.java:107)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
at OA.jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
java.sql.SQLException: ORA-01006: bind variable does not exist
Regards
Saurabh -
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,
PradeepHi 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 -
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.
ThnaksHi,
Could you please share the code segment for reference. Then we can tell the solution.
Regards,
Tarun -
I am using the following query for as part of my effort
select b.account_number,
b.restriction_code,
a.cusip_number,
a.symbol,
c.shares,
round(((c.shares/nullif(to_number(a.shares_outstanding),0))*100),4) outstanding_share_percent
from br_securities a,
br_accounts b,
(select account_number,cusip_number,sum(shares) shares
from br_positions
where account_number not in (select account_number
from br_house_accounts)
group by account_number,cusip_number) c
where a.cusip_number = c.cusip_number
and b.account_number = c.account_number
and b.open_flag = 'Y'
and a.security_type||a.security_sub_type in ('A01','B01','B02','C02')
and (round(((c.shares/nullif(to_number(a.shares_outstanding),0))*100),4) > 10
or round(((c.shares/nullif(to_number(a.shares_outstanding),0))*100),4) < 0
or round(((c.shares/nullif(to_number(a.shares_outstanding),0))*100),4) is null)
order by outstanding_share_percent desc;
Since the expression round(((c.shares/nullif(to_number(a.shares_outstanding),0))*100),4) re-occurs in
the where clause, I tried using the query as shown
select b.account_number,
b.restriction_code,
a.cusip_number,
a.symbol,
c.shares,
a.shares_outstanding,
round(((c.shares/nullif(to_number(a.shares_outstanding),0))*100),4) outstanding_share_percent
from br_securities a,
br_accounts b,
(select account_number,cusip_number,sum(shares) shares
from br_positions
where account_number not in (select account_number
from br_house_accounts)
group by account_number,cusip_number) c
where a.cusip_number = c.cusip_number
and b.account_number = c.account_number
and b.open_flag = 'Y'
and a.security_type||a.security_sub_type in ('A01','B01','B02','C02')
and ( outstanding_share_percent > 10
or outstanding_share_percent < 0
or outstanding_share_percent is null)
order by outstanding_share_percent desc;
SQL*Plus returned this error
ERROR at line 21:
ORA-00904: "OUTSTANDING_SHARE_PERCENT": invalid identifier
Is there a way to modify the query for a better readability?You have to have the query in a sub-query. Like this.
SELECT *
FROM (SELECT b.account_number,
b.restriction_code,
a.cusip_number,
a.symbol,
c.shares,
a.shares_outstanding,
round(((c.shares / nullif(to_number(a.shares_outstanding), 0)) * 100), 4) outstanding_share_percent
FROM br_securities a,
br_accounts b,
(SELECT account_number,
cusip_number,
SUM(shares) shares
FROM br_positions
WHERE account_number NOT IN (SELECT account_number FROM br_house_accounts)
GROUP BY account_number,
cusip_number) c
WHERE a.cusip_number = c.cusip_number
AND b.account_number = c.account_number
AND b.open_flag = 'Y'
AND a.security_type || a.security_sub_type IN ('A01', 'B01', 'B02', 'C02'))
WHERE (outstanding_share_percent > 10 OR outstanding_share_percent < 0 OR outstanding_share_percent IS NULL)
ORDER BY outstanding_share_percent DESC;
Maybe you are looking for
-
How to backup one Time Capsule with another Time Capsule?
I have two Time Capsules and a Mac Mini. The first Time Capsule (TC1) is plugged by ethernet cable directly to my Mac Mini. It is also set up to provide my home with a wireless network. The second Time Capsule (TC2) is upstairs and connected to this
-
How to get "double click" as an event in Module Pool
Dear Experts, Being new to ABAp, I am struck in a problem. I want to get double click as an event in my module pool program. On the screen I have two input/output fields. The attributes of them are as below: 1) 1st I/O field Attributes: Name: WA_AUFN
-
Macbook Pro is detecting a second display that is not attached
I have a first generation Core Duo Macbook Pro and have had a problem with it since it was new detecting 2 displays when only one is connected. At first it would detect 2 displays and change the notebook screen resolution to 800x600. A quick click on
-
Report showing hours per artisan per task
How do i generate a report that shows hours each artisan spends on a particular task? Illustration: for a four weekly service of a dump truck, i have four artisans to carry out the service. how do i generate a report that will show how many hours eac
-
Upload Error: Missing Application Descriptor File
Hi, I keep getting an error when trying to upload my AIR 2.5 app, specifically, "missing application descriptor file". I've double checked the proper XML format for 2.5, as well as checking its location by changing AIR extension to ZIP, etc. The ap