How to get first row from view iterator programatically?
Hi All,
I am using Jdeveloper 11g Release 2.
I want to fetch the first row of a view iterator in a bean. Can any one guide me through this use case.
Any help will be highly appreciated.
Thanks ... Best Regards
Bilal
Use the code snippet as below:
*// 1. Access the binding container*
DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
*// 2. Find a named iterator binding*
DCIteratorBinding iter = (DCIteratorBinding)bc.findIteratorBinding("<ITERATOR_NAME>");
*//3. Get the RowSetIterator Object*
RowSetIterator rsi = iter.getRowSetIterator();
*//4. Get the First Row*
Row firstRow = rsi.first();
Thanks,
Navaneeth
Similar Messages
-
How to get first row from View Object cache.
hi,
I am using Jdeveloper 11.1.1.6
can we get first row from View Object cache??
Thanks in Advance.
Best
ShashidharHi Frank,
Thanks for reply!!
My case is:
I have a Query based ViewObject.
One of the field is LOV and remaining fields are in ADF table. the LOV field is out side ADF table when i insert first record in ADF table and i choose LOV filed the value is selected.
when i create second row LOV value got refreshed because both are in same VO.
I need to get the LOV value of first row and set same value to second Row.
Shashidhar -
How to get specific rows from the vo or Iterator in the backing bean?
Hi,
I have to get the specific number of rows from iterator in the backing bean. means i want to get the records from the VO or Iterator only from 5 th record to 10th record its like rownum in SQL.
We can use rownum in VO sql query. but there would be a performance issue with that ...
SO i am trying to get the rows from ADF Iterator once we fetch from DB.
Is it possible to do that ?
Do we have any way to set the pointer to the VO/Iterator like setFirst() and after that setMaxResult to retrun the rows between first and maxresult..
ThanksIf this is for pagination, then af:table offers pagination by design when you set accessmode=RangePaging or RangePagingIncremental in VO. Paginated queries are fired when scroll down in the table. Explore this option before you try out any custom solution
To answer the question,
Note: same logic i have implpemented ADF with EJB ..In EJB Query class we have setFirst(int) and setMaxResult(int) methods...simply i did setFirst(30) and setMaxResult(10)..It worked fine...Theoretically speaking the same can be achieved by setting setRangeStart() on the viewobject(which in turn sets to the default rowset) and by setting max fetch size on VO + accessmode=RangePaging. However when you use table with ADF binding, these will be overridden by the binding layer. If you are not using ADF binding, then the above is same as what you did for JPA entity. Other option is, you build expert mode VO with rownum for this special case, which will work if you dont need to set accessmode=RangePaging for VO. -
How to get multiple rows from database table?
hello !
I need to get multiple rows from a OLEDB database table and display them on a table object.
I did "Wrap in subfrom" on the table, set subform of the table to "flowed", and checked "Repeat row for each data item" of Row1 of the table.
But I can get only one row on the table object.
I need your help.
ThanksHi,
best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
Frank -
How to get selected row from a non-bind ADF table
Hi,
I have an ADF table that is based on a collectionModel built programmatically. The collectionModel is this:
model = new SortableModel(new ArrayList<ArrayList>());
Hence, it is not a binding table. My question is how to get the selectedRows from a non-bind table.
I am used to building binding ADF table and I know we can get it from voiterator.getCurrentRow, since the selectionListener is set to the binding....collectionModel.makeCurrent
<af:table value="#{bindings.ItasLookupTypesVO1.collectionModel}"
selectedRowKeys="#{bindings.ItasLookupTypesVO1.collectionModel.selectedRow}"
selectionListener="#{bindings.ItasLookupTypesVO1.collectionModel.makeCurrent}"
</af:table>
I am thinking maybe I need to write my own selectionListener, but need more advice/ideas of what's the codes in the customer selection Listener to get it from my SortableModel.
Please help.
Thanks
-MinaI'm not sure if this works in your case, but check out the selection listener I write in this blog http://wp.me/pcBZk-eu
You should use the selection event and check the added set. This should give you access to the selected row.
Timo -
How to get selected row from table(FacesCtrlHierBinding ).
I'am trying to get selected row data from table:
FacesCtrlHierBinding rowBinding = (FacesCtrlHierBinding) tab.getSelectedRow();
Row rw = rowBinding.getRow();
But import for oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding cannot be found from my JDev 11.
What is correct package for FacesCtrlHierBinding?Hi, another problem.
I fill table with data manualy from source:
<af:table var="row" value="#{getCompanyData.com}"
rowSelection="single" columnSelection="single"
editingMode="clickToEdit"
binding="#{getCompanyData.tab}"
selectionListener="#{getCompanyData.GetSelectedCompany}">
<af:column sortable="false" headerText="col1">
<af:outputText value="#{row.id}"/>
</af:column>
<af:column sortable="false" headerText="col2">
<af:outputText value="#{row.name}"/>
</af:column>
<af:column sortable="false" headerText="col3">
<af:outputText value="#{row.phone}"/>
</af:column>
</af:table>
and when I'am trying to use method to get selected row:
RichTable table = this.getTab(); //get table bound to UI Table
RowKeySet rowKeys = table.getSelectedRowKeys();
Iterator selection = table.getSelectedRowKeys().iterator();
while (selection.hasNext())
Object key = selection.next();
table.setRowKey(key);
Object selCompany = table.getRowData();
JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) selCompany;
row = rowData.getRow();
I got an error:
SEVERE: Server Exception during PPR, #1
javax.el.ELException: java.lang.ClassCastException: data.COMPANY cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierNodeBinding
When I created tables by dragging data from date control, all worked fine.
What could be a problem? -
How to get first row in query output
HI,
query:
select a.LOGIN,s2diq(a.created_t)
from service_t a,account_t b
where a.ACCOUNT_OBJ_ID0=b.POID_ID0
and b.ACCOUNT_NO='80161001'
and b.status =10100
output of query:
80161001 6/25/2011 2:00:43 AM
80161001_1 10/16/2011 9:10:44 PM
80161001_2 10/16/2011 9:36:02 PM
80161001_3 10/16/2011 10:23:07 PM
80161001_4 10/17/2011 9:41:34 PM
80161001_5 10/17/2011 9:45:59 PM
80161001_6 10/17/2011 10:26:27 PM
how to get only first row only in quaery:
Thanks
Prakash
Edited by: prakashdba on Apr 7, 2009 3:09 AMThen how about this
select * from
(select a.LOGIN,s2diq(a.created_t) secondcolumn
from service_t a,account_t b
where a.ACCOUNT_OBJ_ID0=b.POID_ID0
and b.ACCOUNT_NO='80161001'
and b.status =10100
order by COLUMN_NAME) A
where rownum=1; -
How to get the rows from a table having some column has any letter
Hi All,
suppose i have a table having columns id(number), code(varchar).
code has alphanumeric characters (ex. ABC123, 67B56 etc).
some codes are only numbers (2344, 7898 etc).
how can i get the rows which have alphabets in the code.
ex:
id code
1 AB45
2 456
3 890
4 67B7
how can i write a query such that it should give me the ids 1 and 4 (as they have alphabets in code)
thanks in advance to allThanks to one and all.
i am gettig my required output.
But i have a doubt in the operator.
If i add or remove '[]' in the operator, i am getting different ouputs.
There is a count difference in the result of the operators used.
REGEXP_LIKE(<column>,'[[:lower:]]')
REGEXP_LIKE(<column>,'[[[:lower:]]]')
REGEXP_LIKE(<column>,'[:lower:]')
Can anybody please explain what is the difference in using '[]', in the operator?
What is the correct syntax, whether i have to use two '[]'s or one '[]'.
Also, can i use REGEXP_LIKE() in oracle 8i version.( I am unable to use the operator in 8i)?
Any query to get the required output in 8i version?
Thanks in advance to all. -
How To Delete a row from view object
Hi
I have a table whose data is populated based on the view object... and for each row i have a delete icon...
when i press on this delete icon i want to delete that particular row from the view object only..but not from the data
base..please help me in this issue
ThanksHi,
as per krishna priya says u can delete .
-----1st one thing let me know vo is eo based .???.
If not here is the sample code to delete a row not from the data base.:
public void Deleterow(OAPageContext pageContext, OAWebBean webBean,String prjid)
int idtodelete;
int fetchedrowcount;
Number prjojectid;
RowSetIterator deleteIter;
prjidtodelete=Integer.parseInt(prjid);
OADBTransaction tr = getOADBTransaction();
ProjectsVORowImpl row=null;
ProjectsVOImpl vo= getProjectsVO1();
fetchedrowcount=vo.getRowCount();
deleteIter = vo.createRowSetIterator("deleteIter");
deleteIter.setRangeStart(0);
deleteIter.setRangeSize(fetchedrowcount);
for(int i=0;i<fetchedrowcount;i++)
row= (ProjectsVORowImpl)deleteIter.getRowAtRangeIndex(i);
prjojectid=(Number)row.getAttribute("ProjectId");
if (prjojectid.compareTo(prjidtodelete)==0)
row.remove();
break;
deleteIter.closeRowSetIterator();
Regards
Meher Irk
Edited by: Meher Irk on Nov 2, 2010 12:42 AM -
How to get two rows from this data?
SQL Gurus,
I need to summarize the following data into two rows (two rows based on the example data below but it can be any number of rows if there are more breaks in continuos numbers)
DETAIL_ID FM_SERIAL_NUMBER TO_SERIAL_NUMBER
63009 11 11
63009 12 12
63009 13 13
63009 14 14
63009 15 15
63009 16 16
63009 17 17
63009 18 18
63009 19 19
63009 20 20
63009 228 228
I need to get two rows, one showing 11-20 (that's because there's a conituity between 11 to 20)
and the other row showing 228 - 228.
Any help is appreciated
Regards,
Srinithe example i gave had some issues.
Here is an updated code.
Provided your detail_id,f_serial_no,t_serial_no are numbers.
Thanks to the example provided by Karthick_Arp
link:genterating one order
WITH t AS
(SELECT 63009 a,
level b ,
level c
FROM dual CONNECT BY level < 10
UNION ALL
SELECT 63009 , 228,228 FROM dual
UNION ALL
SELECT 63009 , 229,229 FROM dual
UNION ALL
SELECT 63009 , 238,238 FROM dual
UNION ALL
SELECT 63009,239,239 FROM dual
UNION ALL
SELECT 630010,223,223 FROM dual
UNION ALL
SELECT 630010,224,224 FROM dual
union all
SELECT 63009,232,232 FROM dual
, t1 as (
select a, b, c, decode(b-nvl(lag(b) over (partition by a order by b),1),1,0,b) d from t)
,t2 as (
select a, b, c,d
from (select row_number() over(order by b) rno, a,b,c,d
from t1) t
model
return updated rows
dimension by (rno)
measures (a, b, c,d)
rules update
d[any] = case when d[cv()] = 0 then nvl(d[cv()-1],0) else d[cv()] end
select a,min(b),max(b) from t2
group by a,doutput
63009 1 9
630010 223 224
63009 232 232
63009 228 229
63009 238 239
Alvinder
Edited by: alvinder on Feb 20, 2009 9:28 AM -
How to get first row of a dataobject
I have a ListDataObjectList that Im setting in the request object. In the UIX page there is one field that is the same in all rows and hence I want to display only once. I have the following code in my UIX page, but it displays duplicate values (one from each row). How can I suppress repeating values?
<rowLayout hAlign="center">
<contents childData="${sessionScope.accounts}">
<html:b>
<formattedText text="${uix.current.customerSSN}" styleClass="OraDataText"/>
</html:b>
</contents>
</rowLayout>
Any help would be very much appreciated.You can use array notation in EL to access the first item (since it is duplicated).
<rowLayout hAlign="center">
<contents>
<html:b>
<formattedText text="${sessionScope.accounts[0].customerSSN}" styleClass="OraDataText"/>
</html:b>
</contents>
</rowLayout>
Kind Regards. -
How to get full row from F4 pop up window into selection-screen fields
HI ,
I had a selection screen having 3 fields (vbeln, posnr, ebeln )
If i press F4 on field 1 i will get a pop up having all values.
If i click on any one row in that popup, only the first field is getting filled with the value. But i want all the other fields to be filled with the corresponding values in the screen simultaneously.
Please let me know is there any solution for this...
Regards,
Kanth....Hi
U should base your selection-screen on a dictionary structure whith those three fields where you assign your search help exporting all values (VBELN, POSNR and EBELN).
In this way you'll obtain what you need automatically
Else you can manage it in POV event by your selef.
Max -
How to get the VIEW_ID from VIEW Controller Class?
Hi,
In my BADI(CRM_BP_UIU_VIEW_CONFIG), I have a view controller variable(IR_VIEW_CONTROLLER) referring to CL_BSP_WD_VIEW_CONTROLLER. Now, I have to get VIEW_ID using this varibale. However, the VIEW_ID attribute is Protected in the class .CL_BSP_WD_VIEW_CONTROLLER So, I am unable to access this attribute.
Could you please help me out, how can I do achieve this?
Thanks,
SandeepSee if you can make use of GET_VIEWAREA_CONTENT or GET_VIEWAREA_CONTENT_ID...
Regards,
BJ -
How to get current row from advanced table
Hi,
I have the following code to pick the value of columnA from one of the columns of an advanced table:
OAViewObject vo = (OAViewObject)am.findViewObject("AAALineVO2");
if (vo != null)
OARow vorow = (OARow)vo.getCurrentRow();
String ColA = (String)vorow.getAttribute("ColumnA");
String message = ColA; //to throw message so i can verify the value of ColumnA
throw new OAException(message, OAException.INFORMATION);
}It's picking up the first value of ColumnA of the first record correctly, however when I add a new row, it's not picking up the value of columnA anymore.
What am I doing wrong?
Thanks in advance,
NTry with this:
import oracle.apps.fnd.lookups.server.LookupCodeVORowImpl;
public void aaa (String row)
LookupCodeVORowImpl laborcreateeovorowimpl = (LookupCodeVORowImpl)findRowByRef(row);
}Thanks
--Anil -
How to get first Reference from a Mail header?
One of the fields that may appear in an email message header is "References." I need to get the first item (which is a Message ID) in that field. However, when I try the following script for a message that has one or more IDs in References:
<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:800px">using terms from application "Mail"
on perform mail action with messages theMessages
repeat with eachMessage in theMessages
set theFirstRef to item 1 of content of header "References" of eachMessage</pre>
I get: "Mail got an error: Can’t make item 1 of content of header \"References\" of message id 17946 of mailbox \"INBOX\" of account \"David\" into type reference."
If I omit "item 1 of", I get the complete References field. So I've tried:
<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:800px"> set theRefs to content of header "References" of eachMessage
set theFirstRef to item 1 of theRefs</pre>
but that only gets me the first character (or subsequent characters if I use a value > 1), which is an open-angle. (BTW, I don't understand why breaking the action into 2 steps like this doesn't produce the same error as the first example.) I've also tried:
<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:800px"> set theRefs to (content of header "References" of eachMessage)
set theFirstRef to word 2 of theRefs</pre>
This skips the first open-angle in the References field and gets me all of the string up to the first delimiter. Unfortunately, the number of delimiters that may appear in a Message ID varies, so I can't simply grab a predetermined set and concatenate them. Furthermore, that would remove the delimiters, so the resulting Message ID in theFirstRef would be incorrect.
I need a syntax that gets me everything between the first set of open- and close-angles but haven't been able to determine what that is.Thanks to your pointer, I found "text item delimiters" discussed on pp. 39-40 of the AppleScript Language Guide. A typical References field on my system for the last message in a somewhat long thread looks like this:
<[email protected]> <[email protected]> <[email protected]> <[email protected]> <[email protected]> <[email protected]>
So the message IDs are delimited by spaces and by open- and close-angles. Thus, if I use:
<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:800px"> set {savedDelims, my text item delimiters} to {my text item delimiters, " "}
repeat with eachMessage in theMessages
set theRefs to content of header "References" of eachMessage
set theFirstRef to text item 1 of theRefs</pre>
as you suggested, I get "<[email protected]>". That's close to what I want but includes the open and close angles in the returned string. If, however, I specify <pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:30px">"<> "</pre> as the delimiters, I get the entire field, i.e., no parsing occurs. I've tried variations and found, for example, that <pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:20px">"> "</pre>returns the first string without the close angle, whereas <pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:20px">" >"</pre>(i.e., using the opposite order) returns the entire field -- don't understand why the order matters -- but haven't found the magic.
I know < and > are AppleScript operators (what's more, I've had to take special steps to show the quoted strings properly here) and am wondering whether they're a special case. I've tried using backslash, but that didn't help, either.
Maybe you are looking for
-
Hi, I have run a stage analysis report but it says no data inspite of open opportunities being present in the system. Could anyone kindly let me know what could be the issue? Regards Sharat
-
How to provide specific filename on FTP PUT in OSB
Hi -- I'm trying to use an OSB dataflow to FTP PUT a file. The filename is to be derived based on the file's contents, according to a naming convention required by the client. I have a proxy service with a Routing action that has a Transport Header o
-
JBL Radial Speaker with an S-Video Output
Hey. I'm trying to watch videos that are on my iPod classic. I have a black JBL radial iPod speaker that has an S-Video output. I have plugged in an S-Video cable to both my TV (on the specific S-Video channel) and speaker and have the iPod docked. W
-
Open Dataset for input in BINARY MODE not working after ECC 6.0 upgrade
Hi All, Our requirement is to download an XML file from the application server and there is a customized program to download these files. This program uses the statement, Open dataset ...for input in BINARY MODE and it works perfect for 4.7. There w
-
Handling Messages in EOIO as QOS
Hi All For <b>EOIO</b> as <b>QOS</b> scenarios ( in case of <b>O/B</b> ), how can we make separate queues for messages that pass through the Integration server and adapter engine based on certain criteria ( sender/receiver etc..) in XI System? We a