How to show the "latest" row in a dynamically growing Jtable
I thought, this topic was poeted before, but as I could not find it, here is my question.
I have a Jtable ( 5 columns ) putted on a JScrollbar.
Adding new rows lets the vertical-scrollbar shrink, thus showing there are more rows towards the end.
But how can I force the bottom-row to be shown.
I did neither find a way handling the JTable nor the jSCrollBar
Thanks for any hint
Hanns
I think you have your JTable in a JScrollPane like that :
JTable table = ...
JScrollPane scroller = new JScrollPane(table);
After adding a row, you should use the method scrollRectToVisible(Rectangle r), where r is the bounds of the first cell in the last row.
ex :
int lastRowIndex = table.getRowCount();
table.scrollRectToVisible(table.getCellRect(lastRowIndex, 0, true));Denis
Similar Messages
-
Master Child tables how to get the latest rows from both
Hi,
Need some help with the sql. I have two tables Master & Child. In my Master table I have multiple rows for the same record and in the child table also multiple rows for the same master row how can I get the latest one's from both.
For example Data in my Master table looks like
CONT_ID SEQ_NUM DESCRIPTION
1 189 Update 2
1 188 Update 1
1 187 NewNow in the child table for the same CONT_ID I may have the following rows
CONT_ID UPDATED_DATE STATUS
1 3/16/2010 2:19:01.552700 PM P
1 3/16/2010 12:29:01.552700 PM A
1 3/16/2010 12:29:01.552700 PM P
1 3/16/2010 12:19:01.552700 PM NIn my final query how can I get the row with seq_num 189 as it's the latest in Master table and from child table the row with status of P as it's the latest one based on the time. Here is the query i have but it returns the latest row from the child table only and basically repeats the master table rows as opposed to one row that is latest from both:
ThanksHi,
You can use the analytic ROW_NUMKBER function to find the latest row for each cont_id in each table:
WITH got_m_rnum AS
SELECT cont_id, seq_num, description
, ROW_NUMBER () OVER ( PARTITION BY cont_id
ORDER BY seq_num DESC
) AS m_rnum
FROM master_table
-- WHERE ... -- any filtering goes here
, got_c_rnum AS
SELECT cont_id, updated_date, status
, ROW_NUMBER () OVER ( PARTITION BY cont_id
ORDER BY updated_date DESC
) AS c_rnum
FROM child_table
-- WHERE ... -- any filtering goes here
SELECT m.cont_id, m.seq_num, m.description
, c.updated_date, c.status
FROM got_m_rnum m
JOIN got_c_rnum c ON m.cont_id = c.cont_id
AND m.m_rnum = c.c_rnum
AND m.m_rnum = 1
;If you'd like to post CREATE TABLE and INSERT statements for the sample data, then I could test this.
If there happens to be a tie for the latest row (say, there are only two rows in the child_table with a certain cont_id, and both have exactly the same updated_date), then this query will arbitrarily choose one of them as the latest. -
How to get the latest row from my Logical Table Source?
Hi everyone,
I have a SALARY_HISTORY table that holds the Salary Date and the Salary Amount for an employee, as a simple example. In my Business Model, I want to have a Display Folder called "Current Salary" and use the Where Clause restriction to derive the latest salary for each of my employees.
In standard SQL Plus, I used a nested SQL statement, e.g. "where a.SalaryDate = (select max(b.SalaryDate) from SALARY_HISTORY b where b.employeeid = a.employeeid)".
Is there anyway in the "Where Clause" filter of the LTS to derive this type of a query?
I have tried things like "DB".""."SCHEMA"."AL_SALARY_HISTORY"."SalaryDate" = EVALUATE('SELECT_PHYSICAL MAX(SALARY_DATE) FROM "DB".."SCHEMA"."AL_SALARY_HISTORY" WHERE employeeid = %1)', "DB".""."SCHEMA"."AL_SALARY_HISTORY"."employeeid"). And I know I can't use any of the analytic functions in a where clause.
So how do I go about this other than creating a View in the database or creating a function in the database to give me the maximum salary date for my employee?
Thanks
PaulHi Paul,
You could achieve this requirement using a sub query. Briefly, the steps are
1. Just create one report with max(salary_date) for each employee.
2. Create another report with SALARY_DATE included.
3. Create a filter (Based on another analysis) on this report, as employee is in(Employee of report in step1) AND SALARY_DATE IS IN(SALARY_DATE of report in step1)(this is the max_salary_date for him)
You could notice that BI Server would send two queries to the backend for this info.
Hope this helps.
Thank you,
Dhar -
How do I retrieve a older backup on itunes that I saved last week in the PC. Currently, it shows the latest backup was yesterday, but I need the backup I saved on 18.10.13. Can anyone help?
It keeps only the last backup.
-
How can i find the latest row inserted in a table
i have a table with five columns and there is no primary key and everyday 100's of rows will be inserted to this table ,infact by mistake i have inserted a row and i just want to find out which is the last row i have inserted in to this particular table is there any way to find out this please......
That's not guaranteed to give you the latest row added to the table. Oracle could place new rows anywhere depending on what happened to rows in the table previously, what space is available in the tablespace etc etc:
SQL> create sequence dt_test_rowid_seq start with 1 increment by 1;
Sequence created.
SQL>--generate some test data
SQL> CREATE TABLE dt_test_rowid as
2 select object_id,
3 object_name,
4 dt_test_rowid_seq.nextval ins_sequence
5 from
6 dba_objects
7 where
8 object_id is not null
9 and
10 rownum <10000;
Table created.
SQL>--here, the latest addition to the table....
SQL> select max(ins_sequence) from dt_test_rowid;
MAX(INS_SEQUENCE)
9999
SQL>... reflects the highest rowid
SQL> select ins_sequence from dt_test_rowid where rowid=(select max(rowid) from dt_test_rowid);
INS_SEQUENCE
9999
SQL>--get rid of a load of rows
SQL> delete from dt_test_rowid where mod(object_id,2)=0;
2521 rows deleted.
SQL>--insert a load more
SQL> insert into dt_test_rowid
2 select object_id,
3 object_name,
4 dt_test_rowid_seq.nextval ins_sequence
5 from
6 dba_objects
7 where
8 object_id is not null
9 and
10 rownum <1000;
999 rows created.
SQL>--and here the latest addition to the table...
SQL> select max(ins_sequence) from dt_test_rowid;
MAX(INS_SEQUENCE)
10998
SQL>--...is NOT reflected by the highest rowid
SQL> select ins_sequence from dt_test_rowid where rowid=(select max(rowid) from dt_test_rowid);
INS_SEQUENCE
9999 -
How to get the latest credit limit values per each customer in the report.
Hi All,
Can anybody give me an idea on how to get the latest credit limit values per each customer in the report.
I have below requiremnt.
I have cube which is having transactional data on document and customer level .and it also having master data info object in the cube which is credit management view having all the customer numbers .
This credit management view is master data info object having credit limit key figure as attribute.These credit limit are per each customer.
So we need these credit limits in the report as dynamic values .(I mean whatever be the current credit limit in the master data table for that paricular customer that should show up in the reporting).
one more thing these credit limits should roll up correctly at the HTR level.
One HTR having number of customers .
for example HTR 100 can have customer number 200,300,400.
Those 200,300,400 customer credit limits should roolup correctly at the HTR 100 level.
Example below :
Cube DATA :
HTR Customer Doct number Credit managment view
100 200 10001 200
100 200 10002 200
100 300 10004 300
100 300 10005 300
100 400 10006 400
100 400 10007 400
100 400 10008 400
Master data tabel (P Table)(Credit managment view)
Credit managment view Credit limits
200 1000.00
300 50000.00
400 90000.00
Please remeber :
We can not make these credit limits as navigational becasue these are keyfigure attributes not characteristics.
one more thing we can not make them as charatistics because we need use these credit limits to derive other calkculation. so it is not possibel to derive calculations on charactristics .Create a formula variable of type replacement path with reference as attibutes of Credit management view and choose your key figure credit limit,say zcredit.
Now create a formula or CKF and use zcredit.
This should display the credit limit in your report as normal key figure.
I didnot get this part "one more thing these credit limits should roll up correctly at the HTR level.", may be the above will solve this too.Try it.
Hope this helps. -
How to get the latest creditlimits in the reporting
Hi All,
Can anybody give me an idea on how to get the latest credit limit values per each customer in the report.
I have below requiremnt.
I have cube which is having transactional data on document and customer level .and it also having master data info object in the cube which is credit management view having all the customer numbers .
This credit management view is master data info object having credit limit key figure as attribute.These credit limit are per each customer.
So we need these credit limits in the report as dynamic values .(I mean whatever be the current credit limit in the master data table for that paricular customer that should show up in the reporting).
one more thing these credit limits should roll up correctly at the HTR level.
One HTR having number of customers .
for example HTR 100 can have customer number 200,300,400.
Those 200,300,400 customer credit limits should roolup correctly at the HTR 100 level.
Example below :
Cube DATA :
HTR Customer Doct number Credit managment view
100 200 10001 200
100 200 10002 200
100 300 10004 300
100 300 10005 300
100 400 10006 400
100 400 10007 400
100 400 10008 400
Master data tabel (P Table)(Credit managment view)
Credit managment view Credit limits
200 1000.00
300 50000.00
400 90000.00
Please remeber :
We can not make these credit limits as navigational becasue these are keyfigure attributes not characteristics.
one more thing we can not make them as charatistics because we need use these credit limits to derive other calkculation. so it is not possibel to derive calculations on charactristics .
Edited by: sirisha Nekkanti on Oct 30, 2008 6:27 PM
Edited by: sirisha Nekkanti on Oct 30, 2008 6:35 PMThis is duplicate of
how to get the latest credit limit values per each customer in the report.
thread. -
How to highlight the whole row of a particular line item of sale
How to highlight the whole row of a particular line item of sales order depending on condition?
Please help its urgent..
Looking forward your reply.
Moderator message: please do more research before asking, show what you have done yourself when asking, do not flag posts as "urgent".
[Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
[Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
Edited by: Thomas Zloch on Aug 9, 2011 9:30 AMAny ideas on what would cause this NOT to work? I added this row right after the table is created and populated and it is still not highlighted when I enter the form. The snippet of code that does this is:
MyTableModel modelS = (MyTableModel)dataModel.get("S");
jTable1 = new JTable(modelS);
jTable1.setRowSelectionInterval(0,0);MyTableModel is this:
class MyTableModel extends DefaultTableModel {
public MyTableModel(Object[] columnNames, int numRows) {
super(columnNames, numRows);
public boolean isCellEditable(int row, int column) {
if (TableKey == 'S') {
if (column == 6) {
return false;
if (TableKey == 'O') {
if (column == 0 || column == 4 || column == 5) {
return false;
if (TableKey == 'P') {
return false;
return true;
}Can anyone help? Thanks.
Allyson -
How to select the latest date for a field in CR?
Dear all expert.
I need to develop a report where it only show the latest date. For example, I had a report, it contain a customer description and bussiness transaction posting date.
Customer description BT posting Date
A 03/10/2010
A 15/10/2010
A 23/11/2010
A 24/12/2010
A 30/12/2010
A 15/02/2011
A 20/03/2011
B 20/03/2011
B 02/04/2011
B 08/04/2011
B 11/04/2011
But in CR, i Just wan it to show me:
Customer description BT posting Date
A 20/03/2011
B 11/04/2011
I just want to show customer with the latest BT posting Date, How can I do that?
Thank You.Hi Alex,
If you want to show the data only in Detail other than group then you may follow the following :
--Create a group on Curstomer Descripton
--Createa fromula : Maximum(,)
--Go in Section Expert -- suppress condition -- then give a condition like :
<> Maximum(,) // 'not equal'
This will suppress other dates and give you the latest date on your detail.
Thanks,
Sastry -
How to show the checked-out symbol in list of files in a folder
Hi,
When the folder is selected it is showing all the files in that folder. But, the user would not know which file had been checked out. In general it should show the lock symbol (As similar to Documentum, webtop) when a file had been checked out by some other user.
How to show the lock/key column in list of files. Any other way to find a file had been checked out or not instead of going into the content information.
Also, how do we add additional columns like author etc... to the list of files screen in UCM?
Please helpYou should double check, but I don't believe that the check-out info is in the resultset. Because that information isn't available, the state of each row in the search results table cannot be defined. So, the first hurdle would be to add that info to the dataset.
The second hurdle would be to alter the UI to leverage that info (e.g., the key icon when checked out).
If you're looking to alter the folder views, then look to the COLLECTION_DISPLAY service & related template. Other views (e.g., search results) have different templates and backing services.
-ryan -
Please check www.megasound.dk in FF and then in Explorer. The Explorer version is the recent and correct version. The FF version is an old version. Is there an option in FF, "show the latest version of a website"?
How to solve this problem?
Br
SalinanuReload web page(s) and bypass the cache.
*Press and hold Shift and left-click the Reload button.
*Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
*Press "Cmd + Shift + R" (MAC)
See also:
*http://kb.mozillazine.org/browser.cache.check_doc_frequency -
Can any one tell me how to change the current row header in FB1LN tcode
Hi,
can any one tell me how to change the current row header in FB1LN tcode.
I want to show input date also in the layout.
Regards
MaveHi
I know two ways:
- transaction obvu: here you can insert new fields, but only if these fields are included in certain table (like BKPF, BSEG, BSIS.....
- if your field isn't included in those table, you have to modify the structure RFPOS and manage it in the BTE 1650. After updating RFPOS you have to run the program RFPOSXEXTEND to update the structure RFPOSXEXT.
Max -
How to sync the latest instance' of scheduled report with the report link
I've scheduled one report daily and it seems to be working fine: I can view the latest instance or I can do it from the history.
But when I'm trying to open report using traditonal link to the report, it shows only content based on the last save manual event after refreshing.
I'm looking for a way to sync reports under 'View Latest Instance' link and Report link.
Any ideas?
thxJacques, thanks a lot, it is very helpful.
But now I got another headache, the link to that report shows the latest instance, but 'View' link points to old report manually run and it can be confusing for customer.
What will be next logical step: remove 'View' but how or I can add time-stamp to each report to highlite when the report is produced
Any suggestions?
anyway, many thanks for your help
Michael -
How to trigger the automated row fetch process and open modal window by javascript api?
Hi,
I would like to click the one row of column of IR report, to open the modal window of current page. <----------------it is ok. I can use "javascript:openModal('windowID')" to do it.
There is one form in this modal window, Meanwhile, I would like to pass column data to this form. <--------------------- it is ok also. I can use " $s('P7_ID','column_value');" to do it.
But I don't know how to trigger the "automated row fetch" process of this form to retrieve other field's value in this form.
I tried to use following 2 ways. But failed.
First method:
add one ajax process of "automated row fetch" in "page processing" block, named "get_fetch_data"
when click IR column , call "openModal", and call "apex.server.process ( "get_fetch_data", {}, { success: function( pData ) { } } );" , I tried to call above ajax process to refresh form. It is failed.
Second method:
add one process of "automated row fetch" in "page rendering" block, named "get_fetch_data"
when click IR column, call javascript api "apex.submit" to submit current page , then call "openModal".
such as : javascript:apex.submit({request:'MODIFY',set:{'P7_ID': #ID#}}); openModal('trade');
But it is failed also. the modal page is showed firstly. then page refresh. but modal window will not open again.
I am not sure if my thinking is right. Could you please provide any suggestion?
Thanks in advance,
PingHi Ping,
You can try to set the session state of your modal page's primary key before opening the modal page. Use one dynamic action (on click of IR row) with two true actions. First one to set session state of modal page pk, second on to open modal page.
Or you can add the modal page url as link in your report by extending your query:
select ...
, apex_util.prepare_url( 'f?p='||:APP_ID||':7:'||:APP_SESSION||'::'||:DEBUG||':7:P7_ID'||COLUMN_VALUE ) as link
from ...
This will give you the url of the modal page, with set primary key.
Regards,
Vincent Deelen
http://vincentdeelen.blogspot.com -
Conversation doesnt show the latest message but an old one.
Each time i click on a conversation in Mail, it doesnt show the latest message, but on old one. Changing the settings to 'place latest message on top' (sorry don't know exactly how they have translated this, I am running Dutch version) does not fix this.
If you change the settings to 'place latest message on top'. It does place the latest message on top, but it shows an old one. So each time i click on a conversation, i have to scroll to the top to see the latest message. This is very irritating. I already answered several old messages. People think i am getting ********...
I am using Mail in classic view! Changing it to the new view, doesnt fix it either.Hey Olivia,
If you are having an issue with your iPhone only showing the most recent message of a conversation in the Messages application, and you have already tried restarting and resetting the iPhone, the next thing to try would be to back up any data on the iPhone, erase it and set it up as a new device. See this article for directions -
How to erase your iOS device and then set it up as a new device or restore it from backups
Thanks for using Apple Support Communities.
Happy computing,
Brett L
Maybe you are looking for
-
I just noticed about 1 week ago, that my IMAC has gotten much brighter... I did not change anything on the machine, now my hightlights seem to be washed out - ex - I cannot see the same detail in Google Maps. I tried to Calibrte the Screen using the
-
"urgent" pls help: How to remove name space form message in call to WS
Hi I am calling a WS from my BPEL process. In the BPEL process I call the WS by referring to the URI of the WS in the partner link. The process works fine. But I have a problem with the message size. The WS does not accept Message size greater than 1
-
Hi, JES2005Q4 116577-32 what is the expected behavior when creating an event in CE and inviting a user whose icsStatus is set to inactive? It let's me create an event and I wonder if it works as expected. Shouldn't UWC generate an error message indic
-
The Help says: "To add a caption to a photo, click the placeholder text below a photo and type a caption. You can change the number of columns and the height of captions using the Graphic Inspector." However, I can't seem to find out how to change th
-
Open Directory Printers still showing up even though Print services is off
Hi all, Long time ago, back when Panther was king, we setup Print services on our Panther servers. It often jammed and now we turned off the Print service and deleted all the queues. But now, when adding printers to our client laptops running Leopard