How to select rows in the inner JTable rendered in an outer JTable cell
I have wrriten the following code for creating cell specific renderer - JTable rendered in a cell of a JTable.
table=new JTable(data,columnNames)
public TableCellRenderer getCellRenderer(int row, int column)
if ((row == 0) && (column == 0))
return new ColorRenderer();
else if((row == 1) && (column == 0))
return new ColorRenderer1();
else
return super.getCellRenderer(row, column);
ColorRenderer and ColorRenderer1 are two inner classes, which implement TableCellRenderer to draw inner JTable on the outer JTable cell, having 2 rows and 1 column each.
Now what is happening the above code keeps executing continously, that is the classes are being initialised continously, inner JTables are rendered (drawn) continously, and this makes the application slow after some time. It throws java.lang.OutOfMemoryException.
WHY IS IT SO??? I can't understand where's the bug..
Any advice please???
Moreover i want selections in inner tables and not on outer table, how can this be possible.
I am working on this since a long time but have not yet found a way out...
With your help i have overcome the problem of continous repeatition.
The major problem which I am facing is, in selecting rows in the inner rendered JTables.
I have added listener on outer JTable which select rows on the outer JTable, hence the complete inner JTable which being treated as a row, gets selected.
The thing is i need to select the rows of inner rendered JTables,not the outer JTable.
How to go about it??
I have even added listener to inner rendered JTables, but only first row of every table gets selected.
Please help....
Thanks in advance.
Similar Messages
-
How to obtain the selected rows in the model with af:Table using selectMany
Hi ,
I am using multi select af:Table and it is based on a programmatically populated view. When the table is single select I can use the getCurrentRow at the view implementation. I wonder whether there is a way to get list of selected rows within the view implementation for the multi-select scenario.
I saw some ways of doing it in the page's backing bean but it will be more appropriate if I could do it at the model project.
Thanks
My environment is JDeveloper 10.1.3.3 and jdk 1.4Thanks for your reply.
What you say makes sense. I thought there might be way of setting the selected rows in the model also as we do woth the current row.
But looks like these two different things.
Anyway I am doing it by passing the values through the backing bean.
Thanks -
How to get row of the selected cell in ALV while implementing OVS
Dear Folks,
I am implementing OVS search help in ALV.When i click on cell, i can see the search help in cell and now i can identify the colomn of the cell but i can't identify the row of the cell.Can any one tell me how to identify row of the cell in this case.
Nirad.Thnx for the answer nithya.I have solved problem my self.
DATA: elem_ovs TYPE REF TO if_wd_context_element,
ls_data TYPE REF TO data,
ls_index type string.
FIELD-SYMBOLS : <ovs_data> TYPE data.
elem_ovs = ovs_callback_object->context_element.
ls_data = elem_ovs->get_static_attributes_ref( ).
ls_index = elem_ovs->GET_INDEX( ).
and this is the solution. -
I cant make path selection work on the inner areas of my path selection
The problem is that it's only loading the outline of my path as the selection. All the inner areas aren't included, and I want to chop them out as well
Activate the Path Selection Tool.
Option-click on the compound Path's thumbnail in the Paths panel. That will select all components of the Path.
In the options bar, click the Subtract button to ensure all components are negative.
Click on the canvas outside of the entire path to deselect all of the path. Click on the line of the main outline path to select only it.
In the options bar, click the Add button to make the main outline positive.
The compound path should be correct now.
You can target the Path and the image layer then Add Vector Mask to the image layer, or Command-click the Path's thumbnail to get a marquee then Add Layer Mask to the image layer. -
Can't Select Rows in the Microsoft Edge F12 Network Inspector
Applies To: Microsoft Edge F12 Developer Tools
Release: Windows 10 Insider Preview SDK and tools, April 2015 release
Issue:
Can’t select rows in the network inspector with mouse to see body, timings etc.Workaround
Use arrow keys. The initially selected row, when focus is on the network data grid, will be the last row so you may need to press up arrow several times to reach a displayed row. -
When iam selecting row of the table i got the exception
Hi ,
When iam selecting row in the table at that time iam getting below exceptions
<21/02/2013 1:31:35 PM EST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /InventoryPropertiesViewTF/InventoryPropertiesView URI: /com/avocent/trellis/apps/mainUi/inventory/pages/fragments/InventoryPropertiesView.jsff actual-URI: /com/avocent/trellis/apps/mainUi/inventory/pages/fragments/InventoryPropertiesView.jsff.
javax.el.PropertyNotFoundException: Target Unreachable, 'BracketSuffix' returned null
<21/02/2013 1:31:35 PM EST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /PropertyDisplayTF/PropertyDisplay URI: /com/avocent/trellis/apps/coreapps/ui/fragments/PropertyDisplay.jsff actual-URI: /com/avocent/trellis/apps/coreapps/ui/fragments/PropertyDisplay.jsff.
javax.el.PropertyNotFoundException: Target Unreachable, 'BracketSuffix' returned null
at com.sun.el.parser.AstValue.getTarget(Unknown Source)
Please Let me know why its getting this type exception only some time interemitten issue,
Please provide me any solution for these,
jdeveloper 1.1.1.4Check your page code for an EL that uses 'BracketSuffix'. This is the point of error as the 'BracketSuffix' can't be evaluated at the given point.
Timo -
How to select and store the dynamically clicked values in the checkboxes?
Hi Gurus
How to select and store the dynamically clicked values in the checkboxes?
Scenario:-
I am having a tree structure but I am not getting that user has clicked the which nodes.
So how to do it.
Pls.Hi,
Once again, this is dependent on what your implementation expects. It would seem that your implementation is expecting all of the API to be coded in Java Card so it would make sense that you would load these packages like any other package. Loading an applet is not a special case, it just has an extra step of installing instances of it (and can actually be installed). Any other Java package just needs to be loaded. As such, just load your CAP files for each package of the API before loading any code that depends on it.
Cheers,
Shane -
Sorry if this is a bit naive. I have just bought my first iPad (Retina Display). I have WiFi at home but it has taken me ages to get on-line as I needed all sorts of codes, passwords, numbers etc.
How does one connect to the web (Google) when one is out and about?
Thankshaha, You're welcome
Maybe these links will be useful
ipad manual/user guide
http://manuals.info.apple.com/en_US/ipad_user_guide.pdf
ipad support page
http://www.apple.com/support/ipad/
ipad assistant
http://www.apple.com/support/ipad/assistant/ -
How do I finish installing the last two discs after exiting out of the system?
How do I finish intalling the last two discs after exiting out of the setup?
Installing what?
On what system? -
How do I select rows from the same table that have multiple occurances
Hi Everybody,
I am trying to select records from a detail table by grouping it. The table has more than 1 million records and the query is not performing well. The basic question is how to select a distinct record from a table which matches all values in one column and any in the other.
desc SCV
ID NUMBER PK (ID + SCRID)
SCRID NUMBER FK(SC)
ID SCRID
1 1
2 1
3 1
4 2
5 2
6 3
7 4
8 4
desc PROJECTS
ID NUMBER PK
NAME VARCHAR2(100)
ID NAME
1 PROJECT1
2 PROJECT2
3 PROJECT3
4 PROJECT4
desc PJS
ID NUMBER
PROID NUMBER FK (PROJECTS)
SCRID NUMBER FK (SCV(SCRID + SCVID)
SCVID NUMBER
ID PROID SCRID SCVID
1 1 1 1
2 1 1 2
3 1 2 5
4 1 3 6
5 1 4 7
6 2 1 3
7 2 2 4
8 2 2 5
9 2 4 7
There are over 1 million records in PJS.
desc TBP
SCRID NUMBER
SCVID NUMBER
SCRID SCVID
1 1
1 2
1 3
2 4
2 5
3 6
4 7
4 8
The requirement is to select projects that have matching SCRID, SCVID from TBP such that
all distinct SCRID should match and within that and any SCVID match will do. (A "AND" between each SCRID and an "OR" for each SCVID in that SCRID like 'SCRID = 1 AND (SCVID = 1 OR SCVID = 2 OR SCVID = 3) AND SCRID = 2 AND (SCVID =....)
So, for the sample data it should return us PROID = 1
I have few queries written for this:
SELECT PROID FROM PJS,TBP WHERE TBP.SCVID = PJS.SCVID AND TBP.SCRID = 1
INTERSECT
SELECT PROID FROM PJS,TBP WHERE TBP.SCVID = PJS.SCVID AND TBP.SCRID = 2
INTERSECT
SELECT PROID FROM PJS,TBP WHERE TBP.SCVID = PJS.SCVID AND TBP.SCRID = 3
INTERSECT
SELECT PROID FROM PJS,TBP WHERE TBP.SCVID = PJS.SCVID AND TBP.SCRID = 4
This query performs well but the cost is very high, hardcoding, sorting.
The 2nd option is to:
SELECT pjs.PROID proid
FROM TBP tbp,
PJS pjs
WHERE pjs.SCVID = tbp.SCVID
AND pjs.SCRID = tbp.SCRID
GROUP BY pjs.PROID
HAVING COUNT(DISTINCT pjs.SCRID) = (SELECT COUNT(DISTINCT SCRID ) FROM TBP)
This has a low cost but runs slowly.
One more way I tried was with the IN operator like
SELECT DISTINCT PROID FROM PJS A,TBP T WHERE T.SCRID = 1 AND T.SCVID = A.SCVID
AND PROID IN (SELECT PROID FROM PJS A,TBP T WHERE T.SCRID = 2 AND T.SCVID = A.SCVID
AND PROID IN (...SO ON with each DISTINCT SCRID.
Again this involves too much of sorting.
Any help will be appriciated.
Thanks in advance.Hi Andrew,
Use DELETE t_itab statement inside the loop.
I have modified your code. It is perfectly working.See bellow -
LOOP AT it_zmember01 INTO wa_zmember01.
WRITE: / wa_zmember01-mnumber UNDER 'NUMBER',
wa_zmember01-mname UNDER 'NAME',
wa_zmember01-mdob UNDER 'DOB'.
WRITE / '-----------------------------------------------------------------'.
DELETE it_zmember01. " Modified
ENDLOOP.
DELETE it_zmember01. statement inside the loop will delete the current row of the table.
Regards
Pinaki -
How to select rows in adf faces table
Hi guys
im new to adf faces .I created a adf faces table with some data.My task is to select one row and if i click tht row, the data of tht row will be displayed in an input text fileds.How can i select a row in a adf faces table and give actions to rows...i read so many tutorials...none of them didnt give a correct idea....plz help me...
thanks in advance..
rajivYou're here in the Sun JSF forum, not in the Oracle JSF forum.
Try here: JDeveloper and ADF
If the ADF datatable is technically comparable with the RI datatable, check http://balusc.xs4all.nl/srv/dev-jep-dat.html to get some insights how to retrieve the selected row object. -
How To Lock Rows (in the DB)
I need to lock a Row when a users enters some editing JSP until the user finished doing changes, while the other users (using VOs. created on the fly, and SQLJ) **DO NOT** have to get access to that Row.
From a bean used in a JSP or in My AppModule How do I get a Lock over a Row? (The lock must be visible to all users of the D.B. not just the ones using the Framework.)
Also setting the Transaction locking mode to NONE and doing manually the locks doesn't seems to be locking anything to the rest of users of the Framework.
Thanks in advance.Or else you could issue the following select statement:
select *
from tab1, tab2, ....
where <join clause>
for update of <table to be updated> -
How to select and duplicate the records and update some column values using cursor
I have a table with 920 records, we need to update the end date to 6/30/2014 for 920 records and I need to create all 920 records with start date is 7/1/2014 and update the external value to
CCC.
Note: the table primary key is not auto increment, but I have sp to get the latest key for that.
Existing table.
ID
Source Name
Internal value
External value
Start date
End date
1
XXX
AAA
BBB
1/1/2013
6/30/2015
Create new records
ID
Source Name
Internal value
External value
Start date
End date
921
XXX
AAA
CCC
7/1/2013
12/30/2015Hi ManuGT
If I understand what you need then you ask for:
1. updating all current rows (920 rows in the table now)
2. insert new rows which are duplicates of the preiviews rows, but with value 'CCC' insteade of 'BBB'
If so, there is not reason to use a cursor and it is highly NOT RECOMMENDED to use ant type of loop.
You should work with SET and do it all in 2 simple queries:
-- first we duplicate the existing rows,
-- but we use the values 'CCC" and '20140107' for the new rows values
INSERT test (SourceName, InternalValue, ExternalValue, StartDate, EndDate)
select SourceName, 'CCC', ExternalValue, '20140107' , EndDate
from test
where
-- You can use any filter that you need if you dont want to update all rows
InternalValue = 'AAA' and ExternalValue = 'BBB' and StartDate = '20140101' and EndDate = '20140630'
-- Now we update the old rows (check the filter! I get only the old rows since I filter the new rown out)
UPDATE test
SET EndDate = '20140107' -- I use date in format yyyymmdd, You can use other formats as well
where
-- You can use any filter that you need if you dont want to update all rows
InternalValue = 'AAA' and ExternalValue = 'BBB' and StartDate = '20140101' and EndDate = '20140630'
Unfortunately you did not post DDL+DML! Therefore we cant see your table structure and the data sample and we can only guess. I used Saeid's post as the basic DDL+DML.
Please next time post DDL+DML
here is the full code with the DDL+DML that i used:
-- This is our DDL - A create table query:
create table test
( id int identity(1,1) primary key,
SourceName nvarchar(3),
InternalValue nvarchar(3),
ExternalValue nvarchar(3),
StartDate date,
EndDate date
go
-- This is our DML - A query that insert some sample data
declare @i int = 1 ;
while @i < 921
begin
insert test (SourceName, InternalValue, ExternalValue, StartDate, EndDate)
values ('XXX', 'AAA', 'BBB', '1/1/2014', '6/30/2014' ) ;
set @i += 1 ;
end ;
GO
-- Here is the solution for the problem as I understood your needs:
-- first we duplicate the existing rows,
-- but we use the values 'CCC" and '20140107' for the new rows values
INSERT test (SourceName, InternalValue, ExternalValue, StartDate, EndDate)
select SourceName, 'CCC', ExternalValue, '20140107' , EndDate
from test
where
-- You can use any filter that you need if you dont want to update all rows
InternalValue = 'AAA' and ExternalValue = 'BBB' and StartDate = '20140101' and EndDate = '20140630'
-- Now we update the old rows (check the filter! I get only the old rows since I filter the new rown out)
UPDATE test
SET EndDate = '20140107' -- I use date in format yyyymmdd, You can use other formats as well
where
-- You can use any filter that you need if you dont want to update all rows
InternalValue = 'AAA' and ExternalValue = 'BBB' and StartDate = '20140101' and EndDate = '20140630'
-- Here we just check how the result look like :-)
select *
from test ;
-- And since we do not realy need this table in our server... Here we clean the DDL (you probaby DO NOT WANT TO EXECUTE THIS!)
DROP table test
GO
I hope this was useful :-)
[Personal Site] [Blog] [Facebook] -
Trapping the selected row in the table using boolean checkbox
Hi,
I am using Jdev 11.1.1.2.0 with ADF 11g.
I have a screen that has a table with an additional column of 'Select boolean checkbox'. I have assigned a valuechangelistener method that helps me know which row has been selected. But the issue is it gets fired for all the rows in the table once I select/de-select a checkbox of 1 single row.
How can I handle this? Yes I can iterate through the table rows and check the values of the checkbox. But that is not I want, I also want to trap the de-select event.
What is the way to achieve this?Timo Hahn wrote:
I don't see a bug in this behavior. This is because each row gets stamped when they render.
The way to do this is to use an attribute (which can be transient) to hold the status of the check box. Exactly this does the link I gave.
TimoHi,
Why I am saying it as a bug is because it is not firing the event for the record where the event has occurred. instead the event is fired for each row which should definitely not what is expected. And because of this we have to add an additional variable.
Now it becomes more complex if I have to handle de-selection as well, b'coz if the valuchangelistener is going to fire for all the records then I need to know which row was previously selected and now de-selected as now the de-selected record will also return a false.
So any better solution, anyone? -
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
Maybe you are looking for
-
I need a new Nvidia card. I want the gtx 970 but I am concerned about the power supply. It is listed at 600 watts but I need 2- 8 pin power plugs to run most of the available cards. I notice there are 2 6 pin plugs in the box one black and one white.
-
Problem with REGEX_LIKE
Hi, In my table I've a column holding values like (165, 16, 133:16, 16:133, etc.). Now I want to query for records having '16' in this column. So I'm not very firm in regex I've with the help of some tutorials get the following query: SELECT * FROM M
-
I found a lot of discussion on this error in Photoshop but I'm getting it in After Effects. I have a sequence of JPG images created by photoshop (output is RGB in sRGB color space) and it appears one of them is causing problems in AE. There are sev
-
White line appears on jpeg export in indesign CS6? How to get rid of the same?
White line appears on jpeg export in indesign CS6? How to get rid of the same?
-
Changed my Apple Password on iMac; iCloud does not recognize new password on iPad.
I changed my Apple password on my iMac. Now I repeatedly get the message that my Apple password is invalid on my iPad when accessing iCloud or iTunes. I tried syncing my iPad with my iMac. This did not help. Any solutions?