Selecting row from table
hi
i want select rows in table,that mean i have to put radio button in front of each row in table when i select that radio button and click the go button i should able to edit that row.
please help me to devloped above functionality.
Thanks in Advanced
It would help if you tell us your jdev version and full use case.
Why do you want to use a radio button in front of a row to just edit the row?
In 11g you can select a row and edit it directly (clickToEdit mode), or hit a button on the selected row and open a form to edit the selected row.
@Abhijit you should mention that the sample is for 10g. If the OP uses 11g this confuses matters.
Timo
Similar Messages
-
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? -
Delete operation is not working to delete selected row from ADF table
Hi All,
We are working on jdev 11.1.1.5.3. We have one ADF table as shown below. My requirement is to delete a selected row from table, but it is deleting the first row only.
<af:table value="#{bindings.EventCalendarVO.collectionModel}" var="row"
rows="#{bindings.EventCalendarVO.rangeSize}"
emptyText="#{bindings.EventCalendarVO.viewable ? applcoreBundle.TABLE_EMPTY_TEXT_NO_ROWS_YET : applcoreBundle.TABLE_EMPTY_TEXT_ACCESS_DENIED}"
fetchSize="#{bindings.EventCalendarVO.rangeSize}"
rowBandingInterval="0"
selectedRowKeys="#{bindings.EventCalendarVO.collectionModel.selectedRow}"
selectionListener="#{bindings.EventCalendarVO.collectionModel.makeCurrent}"
rowSelection="single" id="t2" partialTriggers="::ctb1 ::ctb3"
>
To perform delete operation i have one delete button.
<af:commandToolbarButton
text="Delete"
disabled="#{!bindings.Delete.enabled}"
id="ctb3" accessKey="d"
actionListener="#{AddNewEventBean. *deleteCurrentRow* }"/>
As normal delete operation is not working i am using programatic approach from bean method. This approach works with jdev 11.1.1.5.0 but fails on ver 11.1.1.5.3
public void deleteCurrentRow (ActionEvent actionEvent) *{* DCBindingContainer bindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcItteratorBindings =
bindings.findIteratorBinding("EventCalendarVOIterator");
// Get an object representing the table and what may be selected within it
ViewObject eventCalVO = dcItteratorBindings.getViewObject();
// Remove selected row
eventCalVO.removeCurrentRow();
it is removing first row from table still. Main problem is not giving the selected row as current row. Any one point out where is the mistake?
We have tried the below code as well in deleteCurrentRow() method
RowKeySet rowKeySet = (RowKeySet)this.getT1().getSelectedRowKeys();
CollectionModel cm = (CollectionModel)this.getT1().ggetValue();
for (Object facesTreeRowKey : rowKeySet) {
cm.setRowKey(facesTreeRowKey);
JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)cm.getRowData();
rowData.getRow().remove();
The same behavior still.
Thanks in advance.
Rechin
Edited by: 900997 on Mar 7, 2012 3:56 AM
Edited by: 900997 on Mar 7, 2012 4:01 AM
Edited by: 900997 on Mar 7, 2012 4:03 AMJDev 11.1.1.5.3 sounds like you are using oracle apps as this not a normal jdev version.
as it works in 11.1.1.5.0 you probably hit a bug which you should file with support.oracle.com...
Somehow you get the first row instead of the current row (i guess). You should debug your code and make sure you get the current selected row in your bean code and not the first row.
This might be a problem with the bean scope too. Do you have the button (or table) inside a region? Wich scope does the bean have?
Anyway you can try to remove the iterator row you get
public void deleteCurrentRow (ActionEvent actionEvent) { DCBindingContainer bindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcItteratorBindings =
bindings.findIteratorBinding("EventCalendarVOIterator");
dcItteratorBindings.removeCurrentRow();Timo -
Need sample code to get handle of Selected rows from ADF Table
Hi,
I am new to ADF. I have an ADF table based on VO object.On some button action,I need to get handle of selected rows in application module.
If anybody is having sample code to do this then please share with me.
Thanks,
ashokwow now link http://blogs.oracle.com/smuenchadf/examples/#134 is working.thanks a lot.
also the link http://baigsorcl.blogspot.com/2010/06/deleting-multi-selected-rows-from-adf.html is very useful. Thanks a lot for Sameh Nassar too.He made it clear that in 11g Select column is not available for a ADF table and provided a solution to get Select column.
Thanks,
ashok -
How to get the values of last selected row in Table?
Hi,
I have one editable table , where i have Create, Delete and Commit operation on it.
When i am clicking on Create button it add new row to my table.
But I want the value of my last selected row from the table in my Bean.
Can anyone suggest me please....... its urgent
Jdev:- 11.1.1.0.3
Thanks,
Ramitjust get this code empTable is the table binding
RowKeySet rks = new RowKeySetImpl();
CollectionModel model = (CollectionModel)empTable.getValue();
RowKeySet selectedRowKeys = empTable.getSelectedRowKeys();
if (selectedRowKeys != null)
Iterator iter = selectedRowKeys.iterator();
if (iter != null && iter.hasNext())
empTable.setRowKey(iter.next());
model.setRowIndex(empTable.getRowIndex());
Object key = model.getRowKey();
rks.add(key);
empTable.setSelectedRowKeys(rks);
AdfFacesContext.getCurrentInstance().addPartialTarget(empTable);
public void setEmpTable(RichTable empTable) {
this.empTable = empTable;
public RichTable getEmpTable() {
return empTable;
} -
Select count(*) from table in oracle 11g with direct path read takes time
select count(*) from table takes long time, even more than couple of hours..
direct path read is the wait event which is almost is at 99%..
can u someone provide some info on this.. on solution.. thankxknowledgespring wrote:
table has millions of records... 130 millions..
select count(*) from BIG_SIZE_TABLE; --- executed in sql plus command prompt.
Rows Execution Plan
0 SELECT STATEMENT MODE: ALL_ROWS
0 SORT (AGGREGATE)
0 TABLE ACCESS MODE: ANALYZED (FULL) OF 'BIG_SIZE_TABLE' (TABLE)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 1 0.00 0.00
enq: KO - fast object checkpoint 1 0.01 0.01
Disk file operations I/O 18 0.00 0.00
direct path read 58921 0.34 418.54direct path read time waited is : 58921 total time waited: 418.54
That 418 seconds - not the hours you reported earlier. Is it possible that your connection to the database broke ?
On a typical system, by the way, you can usually turn one direct read for tablescan into 1MB, so your scan seems to have covered about 59 GB, which seems to be in the right sort of ballpark for 130M rows.
we have another query and when we test the query execution using v$sql, is_bind_sensitive =N, how to make is_bind_sensitive=Y all the time.. There is a hint /*+ bind_aware */ - I'd have to check whether or not it's documented at present. It might help.
I would be interested in hearing why you think the hint should be bind sensitive when the optimizer doesn't.
Regards
Jonathan Lewis -
Deleting rows from table based on value from other table
Hello Members,
I am struck to solve the issue said below using query. Would appreciate any suggestions...
I have two tables having same structures. I want to delete the rows from TableA ( master table ) with the values from TableB ( subset of TableA). The idea is to remove the duplicate values from tableA. The data to be removed are present in TableB. Catch here is TableB holds one row less than TableA, for example
Table A
Name Value
Test 1
Test 1
Test 1
Hello 2
Good 3
TableB
Name Value
Test 1
Test 1
The goal here is to remove the two entries from TableB ('Test') from TableA, finally leaving TableA as
Table A
Name Value
Test 1
Hello 2
Good 3
I tried below queries
1. delete from TestA a where rowid = any (select rowid from TESTA b where b.Name = a.Name and a.Name in ( select Name from TestB ));
Any suggestions..
We need TableB. The problem I mentioned above is part of process. TableB contains the duplicate values which should be deleted from TableA. So that we know what all values we have deleted from TableA. On deleted TableA if I later insert the value from TableB I should be getting the original TableA...
Thanks in advancedrop table table_a;
drop table table_b;
create table table_b as
select 'Test' name, 1 value from dual union all
select 'Test' ,1 from dual;
create table table_a as
select 'Test' name, 1 value from dual union all
select 'Test' ,1 from dual union all
select 'Test' ,1 from dual union all
select 'Hello' ,2 from dual union all
select 'Good', 3 from dual;
/* Formatted on 11/23/2011 1:53:12 PM (QP5 v5.149.1003.31008) */
DELETE FROM table_a
WHERE ROWID IN (SELECT rid
FROM (SELECT ROWID rid,
ROW_NUMBER ()
OVER (PARTITION BY name, VALUE
ORDER BY NULL)
rn
FROM table_a a
WHERE EXISTS
(SELECT 1
FROM table_b b
WHERE a.name = b.name
AND a.VALUE = b.VALUE))
WHERE rn > 1);
select * from table_a
NAME VALUE
Test 1
Hello 2
Good 3Edited by: pollywog on Nov 23, 2011 1:55 PM -
Unable to select rows in table
Hi Expert,
I am a beginer of Webdynpro application development. I have created 2 views. In main view material No selection is there and in a second view table display is there. Data is getting populated nicely in second view but i uanble to select rows in table.
I have checked the node parameters in component controller for selection 0 - n and it was maped in second view. and in table perameter row selectable perameter is also enabled. I unable to fix this issue. Kindly guide me.
Thanks and Regards,
Jayakumar ManiHi Jayakumar,
If you want select a single or multiple row of a table then
1. your table should not be read only. This property should not be checked.
2. It should be enabled. This property should be checked.
3. It should be row selectable. This property should be checked.
However when ever you create a new table in in layout the above properties are set accordingly by default.
In your case if you are still unable to select a row of your table you can set this properties dynamically through coding from any particular action.
Create a attribute of type WDUI_TSMODE.
Then bind this attribute with the selection mode property and the set values according to your requirement.
Check this once and reply in case of any issue.
Regards,
Monishankar C -
Remove row from table when adding values to another table
hi am adding value programticaly how can i remove the row i just add from the table
this is how am adding value
public void addMember(javax.faces.event.ActionEvent actionEvent) {
List<String> tempTable = new ArrayList<String>();
//Code to get the bindings for TargetVO :
RowKeySet selectedEmps = getEmpTable().getSelectedRowKeys();
Iterator selectedEmpIter = selectedEmps.iterator();
DCBindingContainer bindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding empIter = bindings.findIteratorBinding("UserDetailsViewVO1Iterator");
RowSetIterator empRSIter = empIter.getRowSetIterator();
while(selectedEmpIter.hasNext()){
Key key = (Key)((List)selectedEmpIter.next()).get(0);
Row currentRow = empRSIter.getRow(key);
onRowCreate(currentRow);
boolean b = selectedEmps.remove(currentRow);
i what to clear the row i just selected from the table
AdfFacesContext.getCurrentInstance().addPartialTarget(empTable);
// empTable
public void onRowCreate( Row currentRow ) {
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
//access the name of the iterator the table is bound to.
DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("addmemberBeanIterator");
//access the underlying RowSetIterator
RowSetIterator rsi = dciter.getRowSetIterator();
//get handle to the last row
Row lastRow = rsi.last();
//obtain the index of the last row
int lastRowIndex = rsi.getRangeIndexOf(lastRow);
/*check if the user is added already*/
/*OperationBinding oper2 = (OperationBinding) bindings.get("check if user exists method binding");
oper2.getParamsMap().put("attributeName1", uniqueUserAttributeValue);
Object ret = oper2.execute();*/
//create a new row
Row newRow = rsi.createRow();
String f = (String)currentRow.getAttribute("Firstname");
String s = (String)currentRow.getAttribute("Surname");
String u = (String)currentRow.getAttribute("Username");
String n = (String)currentRow.getAttribute("Emailaddress");
// String orgid = (String)currentRow.getAttribute("Organisationid");
newRow.setAttribute("firstname", f);
newRow.setAttribute("surname", s);
newRow.setAttribute("name", u);
newRow.setAttribute("emailaddress", n);
// newRow.setAttribute("Organisationid1",orgid);
//initialize the row
newRow.setNewRowState(Row.STATUS_INITIALIZED);
//add row to last index + 1 so it becomes last in the range set
rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
//make row the current row so it is displayed correctly
rsi.setCurrentRow(newRow);
System.out.println("Username " + u);
System.out.println("firstname " + f);
System.out.println("surname " + s);
System.out.println("email " + n);
// refereshpage();
// return null;
am in jdevloper 11.1.1.6.0
my table is
public void onRowCreate( Row currentRow ) {
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
//access the name of the iterator the table is bound to.
DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("addmemberBeanIterator");
//access the underlying RowSetIterator
RowSetIterator rsi = dciter.getRowSetIterator();
//get handle to the last row
Row lastRow = rsi.last();
//obtain the index of the last row
int lastRowIndex = rsi.getRangeIndexOf(lastRow);
/*check if the user is added already*/
/*OperationBinding oper2 = (OperationBinding) bindings.get("check if user exists method binding");
oper2.getParamsMap().put("attributeName1", uniqueUserAttributeValue);
Object ret = oper2.execute();*/
//create a new row
Row newRow = rsi.createRow();
String f = (String)currentRow.getAttribute("Firstname");
String s = (String)currentRow.getAttribute("Surname");
String u = (String)currentRow.getAttribute("Username");
String n = (String)currentRow.getAttribute("Emailaddress");
// String orgid = (String)currentRow.getAttribute("Organisationid");
newRow.setAttribute("firstname", f);
newRow.setAttribute("surname", s);
newRow.setAttribute("name", u);
newRow.setAttribute("emailaddress", n);
// newRow.setAttribute("Organisationid1",orgid);
//initialize the row
newRow.setNewRowState(Row.STATUS_INITIALIZED);
//add row to last index + 1 so it becomes last in the range set
rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
//make row the current row so it is displayed correctly
rsi.setCurrentRow(newRow);
System.out.println("Username " + u);
System.out.println("firstname " + f);
System.out.println("surname " + s);
System.out.println("email " + n);
// refereshpage();
// return null;hi,
make the table selection single and use this links 4 ur task.
http://www.baigzeeshan.com/2010/06/deleting-multi-selected-rows-from-adf.html
http://deepakcs.blogspot.com/2013/01/ejb-dc-deleting-multi-selected-rows.html
https://forums.oracle.com/thread/2534813
https://blogs.oracle.com/jdevotnharvest/entry/iterating_selected_rows_in_an
txs -
Select values from table%ROWTYPE variable into a cursor
I have a stored procedure which has an OUT parameter of table1%ROWTYPE.
In future we might have to add more OUT parameters of table2%ROWTYPE etc. But at any point of time only one will have values.
So instead of having table%ROWTYPE as OUT parameter, can I send these single row ( with variable values) in a cursor, so that declaration part atleast will not change.
Is it possible to select values from table%ROWTYPE variable into a cursor.
cursorOUT IS
SELECT * FROM varREC;
where varREC is table.ROWTYPE variable.
Or which is the better solution in this situation.
Thanks.SQL> var a refcursor
SQL> declare
2 bb emp%ROWTYPE;
3 begin
4 select * into bb from emp where rownum = 1;
5 open :a for select bb.ename ename, bb.empno empno from dual;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> print a
ENAME EMPNO
SMITH 7369Rgds. -
How to select rows from database like 10 to 20 etc
Hi Experts,
I want to select rows from database like row number 10 to row number 20.How could it be done?HI,
First get the data into the INTERNAL TABLE from the FLAT FILE and read the internal table using the index.
ex: 1) Read table ITAB index 10.
2) Read table ITAB index 20.
or use as said by Srinivas Gurram, to get the range of records using where condition to the loop.
<REMOVED BY MODERATOR>
Edited by: Ravi Kumar on Jun 9, 2008 4:01 PM
Edited by: Alvaro Tejada Galindo on Jun 9, 2008 3:16 PM -
How can I get the selected rows from two ALV grids at the same time?
I have a program that uses two ALV grids in one dialog screen. I'm using the OO ALV model (SALV* classes).
The user can select any number of rows from each grid. Then, when a toolbar pushbutton is pressed, I'd have to retrieve the selected rows from both grids and start some processing with these rows.
It is no problem to assign event handlers to both grids, and use the CL_SALV_TABLE->GET_SELECTIONS and CL_SALV_SELECTIONS->GET_SELECTED_ROWS methods to find out which rows were marked by the user. Trouble is, this only works when I raise an event in each grid separately, for instance via an own function that I added to the grid's toolbar. So, I can only see the selected rows of the same grid where such an event was raised.
If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.
As it is right now, I can have an own button in both grid's toolbar, select the rows, click on the extra button in each grid (this will tell me what entries were selected per grid). Then, I'd have to click on a third button (the one in the dialog screen's toolbar), and process the selected rows from both grids.
How can I select the rows, then click on just one button, and process the marked entries from both grids?
Is it somehow possible to raise an event belonging to each grid programmatically, so that then the corresponding CL_SALV_SELECTIONS->GET_SELECTED_ROWS will work?
Thanks.Hello Tamas ,
If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.--->
is it possible to have a check box in each grid & get the selected lines in PAI of the screen ?
regards
prabhu -
How to update duplicate row from table
Hi,
how to update duplicate row from table?
First to find duplicate row then update duplicate row with no to that duplicate row in oracle.
can you give me suggestion on it?
Thanks in advance.
your early response is appreciated...In order to find a duplicate row, see:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1224636375004
(or search this forum, your question has been asked before)
In order to update it, just create and use an Oracle sequence, have it start and increment at a value that doesn't exist in your table.
If that doesn't get you going, post some CREATE TABLE + INSERT INTO statements, and the results you want from them, in other words: a complete testcase. -
Select data from table not in another table
Hi,
I want to select data from table A which is not in table B.
Currently I am doing:
select
snoA,
nameA,
dobA
from A
where snoA not in
(select snoB from A, B
where snoA = snoB
and nameA = nameB)
But above is very slow.
Can I do something like:
select
snoA,
nameA,
dobA
from A, B
where
EXCLUDE ( snoA = snoB and nameA = nameB)
Please note that I need the where condition on both the columns.
any help will be appreciated.
-- HarveyWhat are the approximate data volumes in A and B?
What is "very slow"?
What version of Oracle?
What is the query plan?
Without knowing anything about your system, my first thought would be to see if a NOT EXISTS happened to be faster for your data
SELECT snoA,
nameA,
dobA
FROM a
WHERE NOT EXISTS (
SELECT 1
FROM b
WHERE a.snoA = b.snoB
AND a.nameA = b.nameB )Of course, I'm not sure why you are joining A & B in your NOT IN subquery. It would seem like you would just need a correlated subquery, i.e.
SELECT snoA,
nameA,
dobA
FROM a
WHERE snoA NOT IN (
SELECT snoB
FROM b
WHERE a.snoA = b.snoB
AND a.nameA = b.nameB )That should be more efficient than the original query. The NOT EXISTS version may or may not be more efficient than the NOT IN depending on data volumes.
Justin -
Selecting rows in table control
Hi experts,
I have question regarding selecting rows in table control. How can I select a row when a button is pressed. I cannot use the selection column in this case. Is there any option to achieve my requirement without using the selection column. Thanks.
regards,
sriram.By,
Using the Get cursor syntax you can achive the Selected row in Table control.
DATA : selrow TYPE i,
selindex TYPE i .
* getting the cursor line in Table Control for selected row
GET CURSOR FIELD selfield LINE selrow.
selindex = <tablecontrol>-top_line + selrow - 1.
Prabhu
Maybe you are looking for
-
when i try to open itunes on windows keeps saying apple application is required to run itunes error 2 windows error 2
-
How to verify the digital signatures?
Buyer has to send a certified interactive form to vendor, vendor has to digitally sign the form back. We need to verify the signature of the vendor only then start processing the form. How do I achiev this security. 1) How do I generate buyer certif
-
Hi I m writing code to list and extract all the files when a directory name is passed as an argument. my code works fine if the directory contains all the zip files.it extracts all the files. the problem i m getting when a directory contains subdirec
-
Can Apple unlock my Iphone 4s?, Can Apple unlock my Iphone 4s?
I bought an Iphone 4s and it worked in my former country but once I tried using an uk sim (O2) it doesnt seem to be reading is. Does the apple store unlock iphones?
-
Building addresses in training and events
My client is going to expand in a very short period from now. It has some building addresses as of now, but will be increased in future. Can the Core Team Member include new building addresses through transaction S_AHR_61011843? Points assured! Thank