SWT table widget and multi column sorting
Hello,
I want to make the standard SWT table widget support multi column sorting.
Searching on the web didn't lead to useful results. The Nebula project should be the last option.
I guess I need a comparator chain, but how do I realize aspects like let columns appear blue when marked or mark multiple columns by pressing shift key and left mouse button?
Any examples are much appreciated.
Thank you very much!
Regards,
Mick
Hello,
I want to make the standard SWT table widget support multi column sorting.
Searching on the web didn't lead to useful results. The Nebula project should be the last option.
I guess I need a comparator chain, but how do I realize aspects like let columns appear blue when marked or mark multiple columns by pressing shift key and left mouse button?
Any examples are much appreciated.
Thank you very much!
Regards,
Mick
Similar Messages
-
JTable multi column sorting (jdk 1.5)
Hi,
Can you please send a short example (and/or a link) to multi column sorting using sun TableSorter class ?
Thanks a lot,
IdoRead the Documentation that comes with the TableSorter class. I believe you use Shift+Click or Control+Click to sort multiple columns.
-
I am wondering if it is possbile to sort data grids in multi
columns?? For example lets say the data grid simply looks like
this:
Name
Date
Art 10/29/06
Chris 12/02/04
Bob 02/21/07
Bo 08/08/05
And i want to sort it in abc order first then within that
sort(abc order) have does be sorted again by date so that A's will
stay together, B's and so on...Is this possible and if so how?
Thanks for all the helphere is what i have...it crashes after the first click....
rivate function ctrlCheck(ke:KeyboardEvent):void // checks to
see if the ctrl key is pressed to do a multicolumn sort.
if( ke.keyCode == 17) ctrlChecker =true;
else ctrlChecker = false;
private function resortColumns(le:ListEvent):void //if there
is more than one page of results resort the columns and requery,
else just resort
colSortedOn = new String("");
var sortDirection:String = new String("");
var s:Sort=new Sort();
var count:int=0;
var arr:Array=new Array();
if(le.rowIndex == 0)//get the column sorted on and attach
that to the query and requery
if(ctrlChecker==true)
while(ctrlChecker==true)//while the user is still holding
the ctrl key
colSortedOn =
DataGridColumn(datagrid1.columns[le.columnIndex]).dataField.toString();
if(DataGridColumn(datagrid1.columns[le.columnIndex]).sortDescending)
sortLoadDirection = true;
else
sortLoadDirection = false;
arr[count]=new SortField(colSortedOn, true,
sortLoadDirection)
count ++;
for(var i:int =0; i<arr.length; i++)
s.fields
=arr
datagrid1.dataProvider.sort= s;
datagrid1.dataProvider.refresh();
else //there is no sort order taking place, the item click
was something else entirely
parentDocument.sortCheck = 1;
} -
Context v catsearch and multi-column scoring
hi everybody-
i'm a newbie to text search. need to eval oracle text and lucene for our application.
the docs aren't answering my questions, and i have done some searching here, but no luck.
here is our app.
DATA
we have a database of genes (for the malaria parasite). it is like a catalog of genes. however, like many other catalogs these days, we have commentary, which we store in clobs. so, most fields are short but a couple are clobs.
QUERYING
it seems to me that we would be very well served by the google model: the user types one or more words, and the results are ranked.
(a) i don't see the need for boolean or NEAR. like google, a simple rule should hold: the more words that are matched, the better. the closer together the better. i would like a score that indicates how good the match is, based on these criteria.
- does oracle text have an implementation of this?
- if not, how can i do it?
(b) we will be searching many columns, presumably each with its own CONTAINS query. they need to be ranked. i think that if the score returned by contains can reflect the rules in (a) then i can do all the ranking i need by just multiplying each contains by a ranking. (this seems simpler for our needs than the very confusing solutions described in this thread: Re: Multi column with CONTEXT index and ranking
(c) because i want to search multiple columns, and because some of them are clobs, am i correct in thinking this will force me to go uniformly with CONTAINS instead of somehow mixing CATSEARCH (for the small columns) and CONTAINS (for the clobs) in one sql query?
thanks much,
steve(1) in the template query you show above, can i do
the trick where i multiply each different WITHIN by
a weight for that field?Yes, I demonstrated that by multiplying the within clause for commentary1 by 2.
(2) i am looking at SNIPPET now as well. would i
be able to pass the complex query template into the
text_query param of CTX_DOC.SNIPPET?No, The progressive query relaxation uses a query template and according to the documenteation:
"CTX_DOC.SNIPPET does not support the use of query templates."
However, you can use the query with the progressive query relaxation template to find
the rows you want and rank them by score, then use ctx_doc.snippet to mark the
words and get the surrounding words, as demonstrated below. It may be a little hard to
view, as the marking of the words conflicts with some of the formatting on this forum.
SCOTT@orcl_11g>
SCOTT@orcl_11g> CREATE TABLE malaria_catalog
2 (gene VARCHAR2 (5),
3 commentary1 CLOB,
4 commentary2 CLOB)
5 /
Table created.
SCOTT@orcl_11g> INSERT ALL
2 INTO malaria_catalog VALUES ('gene1',
3 'This is a little bit longer entry with word1 followed by word2 and word3 to demonstrate the snippet function.',
4 'This is a second line with word1 word2 word3 in commentary2.')
5 SELECT * FROM DUAL
6 /
1 row created.
SCOTT@orcl_11g> BEGIN
2 CTX_DDL.CREATE_PREFERENCE ('your_datastore', 'MULTI_COLUMN_DATASTORE');
3 CTX_DDL.SET_ATTRIBUTE ('your_datastore', 'COLUMNS', 'gene, commentary1, commentary2');
4 CTX_DDL.CREATE_SECTION_GROUP ('your_sec_group', 'BASIC_SECTION_GROUP');
5 CTX_DDL.ADD_FIELD_SECTION ('your_sec_group', 'commentary1', 'commentary1', TRUE);
6 CTX_DDL.ADD_FIELD_SECTION ('your_sec_group', 'commentary2', 'commentary2', TRUE);
7 END;
8 /
PL/SQL procedure successfully completed.
SCOTT@orcl_11g> CREATE INDEX your_index ON malaria_catalog (gene)
2 INDEXTYPE IS CTXSYS.CONTEXT
3 PARAMETERS
4 ('DATASTORE your_datastore
5 SECTION GROUP your_sec_group')
6 /
Index created.
SCOTT@orcl_11g> VARIABLE search_string VARCHAR2 (100)
SCOTT@orcl_11g> EXEC :search_string := 'word1 word2 word3'
PL/SQL procedure successfully completed.
SCOTT@orcl_11g> EXEC CTX_DOC.SET_KEY_TYPE ('ROWID')
PL/SQL procedure successfully completed.
SCOTT@orcl_11g> COLUMN snippet FORMAT A60
SCOTT@orcl_11g> SELECT SCORE (1),
2 CTX_DOC.SNIPPET
3 ('YOUR_INDEX',
4 ROWID,
5 REPLACE (:search_string, ' ', ' OR ')) AS snippet
6 FROM malaria_catalog mc
7 WHERE CONTAINS
8 (gene,
9 '<query>
10 <textquery lang="ENGLISH" grammar="CONTEXT">
11 <progression>
12 <seq>'
13 || '(' || REPLACE (:search_string, ' ', ' NEAR ') || ' WITHIN commentary1) * 2 OR '
14 || REPLACE (:search_string, ' ', ' NEAR ') || ' WITHIN commentary2' ||
15 '</seq>
16 <seq>'
17 || '(' || REPLACE (:search_string, ' ', ' ACCUM ') || ' WITHIN commentary1) * 2 OR '
18 || REPLACE (:search_string, ' ', ' ACCUM ') || ' WITHIN commentary2' ||
19 '</seq>
20 </progression>
21 </textquery>
22 <score datatype="INTEGER" algorithm="COUNT"/>
23 </query>',
24 1) > 0
25 ORDER BY SCORE (1) DESC
26 /
SCORE(1) SNIPPET
67 is a little bit longer entry with <b>word1</b> followed by <
b>word2</b> and <b>word3</b> to demonstrate the snippet func
tion<b>...</b>line with <b>word1</b> <b>word2</b> <b>word3</
b> in commentary2
SCOTT@orcl_11g> -
How to get the table name and bind columns names in an INSERT statement ?
I have an INSERT statement with input parameters (for example
INSERT INTO my_table VALUES (:a, :a, :a)) and I want to know
without parsing the statement which is the name of table to
insert to and the corresponding columns.
This is needed to generate the SELECT FOR UPDATE statement to
refetch a BLOB before actually writing to it. The code does not
know in advance the schema (generic code).
Thanks in advance,
Joseph CanedoOnce you have prepared your statement, you can execute the
statement with the OCI_DESCRIBE_ONLY mode before binding any
columns. Then you can use OCIParamGet to find out about each
column (column index is 1-based). You should get OCI_NO_DATA or
ORA-24334 if there are no more columns in the statement. Note
that the parameter descriptor from OCIParamGet is
allocated/freed internally by OCI; you do not need to manage it
explicitly. The parameter descriptor is passed to OCIAttrGet in
order to obtain for instance the maximum size of data in the
column OCI_ATTR_DATA_SIZE. You can also get the column name in
this way, although I do not remember the #define off the top of
my head. Getting the table name appears to be much more
difficult; I have never had to do that yet. Good luck. -Ralph -
How to combine update stmts with different filters and multi-columns?
Hi,
I found these following update stmts in one of our long running jobs. I'd like to see if it is possible to combine it in one update or merge stmt so I can reduce the scan time on the same table from 4 times to 1 time. But I'd need some expert suggestions for how to do that. Here are the stmts:
UPDATE table1 c
SET (polnum,polren,polseq,vehnum,
compgrp,prodgrp,uwsys,comp,
state,prod,rrdate,brand,
agycode,AGYCLASS,valid)=(SELECT DISTINCT polnum,polren,polseq,vehnum,
compgrp,prodgrp,uwsys,comp,
state,prod,rrdate,brand,
agycode,AGYCLASS,'A'
FROM table2 v
WHERE v.polnum=c.pol# AND
v.polren=c.ren# AND
v.polseq=c.seq# AND
v.vehnum=c.veh#)
WHERE c.polnum IS NULL;
UPDATE table1 c
SET (polnum,polren,polseq,vehnum,
compgrp,prodgrp,uwsys,comp,
state,prod,rrdate,brand,
agycode,AGYCLASS,valid)=(SELECT DISTINCT polnum,polren,polseq,vehnum,
compgrp,prodgrp,uwsys,comp,
state,prod,rrdate,brand,
agycode,AGYCLASS,'B'
FROM table2 v
WHERE v.polnum=c.pol# AND
v.polren=c.ren# AND
v.polseq=c.seq# AND
v.mainveh='Y')
WHERE c.polnum IS NULL;
UPDATE table1 c
SET (polnum,polren,polseq,vehnum,
compgrp,prodgrp,uwsys,comp,
state,prod,rrdate,brand,
agycode,AGYCLASS,valid)=(SELECT DISTINCT polnum,polren,polseq,vehnum,
compgrp,prodgrp,uwsys,comp,
state,prod,rrdate,brand,
agycode,AGYCLASS,'C'
FROM table2 v
WHERE v.polnum=c.pol# AND
v.polren=c.ren# AND
v.polseq=0 AND
v.mainveh='Y')
WHERE c.polnum IS NULL;
UPDATE table1 c
SET (polnum,polren,polseq,vehnum,
compgrp,prodgrp,uwsys,comp,
state,prod,rrdate,brand,
agycode,AGYCLASS,valid)=(SELECT DISTINCT polnum,polren,polseq,vehnum,
compgrp,prodgrp,uwsys,comp,
state,prod,rrdate,brand,
agycode,AGYCLASS,'D'
FROM table2 v
WHERE v.polnum=c.pol# AND
v.polren=0 AND
v.polseq=0 AND
v.mainveh='Y')
WHERE c.polnum IS NULL;
Table1 has 800000 rows, Table2 has 200 million rows. In table1, about 12.5% rows has a null polnum, so 12.5% data will be updated.
Thank you in advance with all your suggestions!the reason I never specified the joins is because I thought the joins were there to derive the Valid indicator, in which case they are not required if you are using the CASE statement. The join, "V.Polnum = C.Pol#" is still required as this is across all rows! If that is the case, then it can be simplified even more so;
update Table1 C
set (Polnum,Polren,Polseq,Vehnum,Compgrp,Prodgrp,Uwsys,Comp,State,Prod,Rrdate,Brand,Agycode,Agyclass,Valid) =
( select distinct Polnum
,Polren
,Polseq
,Vehnum
,Compgrp
,Prodgrp
,Uwsys
,Comp
,State
,Prod
,Rrdate
,Brand
,Agycode
,Agyclass
,case
when (Polren + Polseq=0) and (Mainveh='Y') then
'D'
when (Polren=0) and (Polseq>0) and (Mainveh='Y') then
'C'
when (Polren>0) and (Polseq>0) and (Mainveh='Y') then
'B'
when (Polren>0) and (Polseq>0) and (Mainveh!='Y') then
'A'
end as Valid
from Table2 V
where V.Polnum = C.Pol#
where C.Polnum is null;However if you are returning more rows than what you are expecting from the above update statement because the joins are being used to limit the data as well, then this might be more appropriate:
update Table1 C
set (Polnum,Polren,Polseq,Vehnum,Compgrp,Prodgrp,Uwsys,Comp,State,Prod,Rrdate,Brand,Agycode,Agyclass,Valid) =
( select v2.PolNum
,v2.Polren
,v2.Polseq
,v2.Vehnum
,v2.Compgrp
,v2.Prodgrp
,v2.Uwsys
,v2.Comp
,v2.State
,v2.Prod
,v2.Rrdate
,v2.Brand
,v2.Agycode
,v2.Agyclass
,case
when (v2.Polren + v2.Polseq=0) and (v2.Mainveh='Y') then
'D'
when (v2.Polren=0) and (v2.Polseq>0) and (v2.Mainveh='Y') then
'C'
when (v2.Polren>0) and (v2.Polseq>0) and (v2.Mainveh='Y') then
'B'
when (v2.Polren>0) and (v2.Polseq>0) and (v2.Mainveh!='Y') then
'A'
end as Valid_Flag
( select distinct Polnum
,Polren
,Polseq
,Vehnum
,Compgrp
,Prodgrp
,Uwsys
,Comp
,State
,Prod
,Rrdate
,Brand
,Agycode
,Agyclass
,Mainveh
from Table2 V
where V.Polnum = C.Pol#
) v2
where (v2.Polren = C.Pol# or v2.Polren = 0)
and (v2.Polseq = C.Seq# or v2.Polseq = 0)
where C.Polnum is null;As before, both remain UNTESTED! -
Groups and Multi Column Reports
I'm using CR for .Net 2003. I've been running into a problem with the grouping feature, where groups are spanning multiple columns and are not being kept together, but only when spanning b/w columns. However, the groups aren't being broken between pages. Anyone else running into this? Here's my setup:
Page Header
Group Header
Details
Group Footer
Page Footer
The "Group Header", "Details" and "Group Footer" are all set to Keep Together in the Selection Expert. The layout of the "Details" section has "Format Groups with multiple Columns" checked. (I only have two columns) And my group options has the option "Keep Group Together" selected.
I was under the impression that if I have "Keep Group Together" it would keep the group together regardless of an end of page, or an end of column...but, maybe I have something misconfigured.
advTHANKSance for any help!Confirm version of Crystal Reports and version of .NET.
Also, have you applied any Service Packs to your version of CR?
Ludek -
Geneartion of max srlno +1 for a given table and a column
Dear friends,
I am trying to write a function which will accept a table name and a column name (must be numeric) of that table, calculate the maximum value of the column name as under...
The funtion compiles fantastic but on execution it gives a lot of error. I admit to be a newbie writing dynamic sql, and hence needs help on that ....Below what I wrote...
create or replace function get_newsrl(TabNm user_tab_columns.TABLE_NAME%TYPE,ColNm user_tab_columns.COLUMN_NAME%TYPE) return number is
NewSrl number;
Begin
NewSrl:=0;
dbms_output.put_line(TabNm);
dbms_output.put_line(ColNm);
Begin
Execute Immediate
'Begin
'select max(' || ColNm ||') into NewSrl from ' ||TabNm||' Using '||ColNm||','||TabNm||';';
||'end;';
end;
NewSrl:=NewSrl+1;
Return NewSrl;
End;SQL> create or replace function get_newsrl(TabNm Varchar2, ColNm Varchar2) return number is
2 NewSrl number;
3 Begin
4 /*
5 NewSrl:=0;
6 dbms_output.put_line(TabNm);
7 dbms_output.put_line(ColNm);
8 */
9 Execute Immediate
10 'select max(' || ColNm ||') into NewSrl from ' ||TabNm;
11 NewSrl:=NewSrl+1;
12 Return NewSrl;
13 Exception
14 When OTHERS
15 then return (- SQLCODE);
16 End;
17 /
Ôóíêöèÿ ñîçäàíà.
SQL> select get_newsrl('EMP', 'EMPNO') from dual;
GET_NEWSRL('EMP','EMPNO')
905
SQL> -
Table Name and Column name for Product Family Field under the Product Famil
Hi,
Please help me finding the table name and the column name for the 'Product Family' field and the 'Item' field under the Product families form. The navigation to this form is as follows:
Material Planner Responsibility -> Setup -> Product Family
Please help.
Thanks,
KM2 months ago, you asked a very similar question... and Markus gave you a good answer. His 2-months old answer still applies here.
I recommend that you read it a again at Table name for backorder qty on sales order.
When you have read his answer, please close both threads. -
Template: 13. Standard (PPR) and column sorting
When I use the template "template: 13. Standard (PPR)" and have column sorting setup for that region, I get the following script error when accessing my app and try to sort on a column.
missing ) after argument list
html_PPR_Report_Page(this,'R142222838802...3829',false,false,false,'fsp_sort_7')');
Have other seen this error too? The work around for me is to not use the PPR template.
Regards,
ToddHello,
PPR (Partial Page Refresh) is just a term used to describe some AJAX pagination and sorting functionality, it's just a holdover from before the term AJAX existed.
You can just change the template and on your report to enable that functionality. In 3.0 it will just be on off switch in your pagination options.
Carl
Message was edited by:
Carl Backstrom -
Disable sorting and resizing columns on table view
Is there a way to disable sorting and resizing columns on table view?
ThanksUse
setSortable(false)
setResizable(false)
on each TableColumn -
Customizing column sorting in new jsf table
The new JSF table in the creator 2 is great. I like it. It includes so many out of the box features. It is the reason we use the creator for our current project.
But I cannot figure out how to customize the column sorting.
Why do I need column sorting?
I need to sort a column that can include ad IP address or a host name. Our customer can either use a host name or an IP address to address a device in the network, both in the same column.
Now sorting an IP address is already difficult. It is actually a sort over a 4 byte number. Sorting over host names is normal alphabetic string sorting.
How to sort over both in the same column?
This cannot be done using standard sorting. I need to use a validator or something similar to customize the sorting of this column.
Can anybody help me with a hint if:
1- Customizing sorting over a column is possible. (I really would like to keep all other sorting features (icons, multi column support...)).
2- A hint or code sample, how to do this.
If this is not possible, I urge the creator team to think of implementing this soon. Otherwise one killer feature of the creator 2 will lose a lot of its teeth.Thx mayagiri for your reply!
But including the src-code for the dataprovider package into a test project, and debugging in the creator-ide has done the thing!
Here our solution:
Class ToCompare is the object type which address field displayed in a page, simply containing a table with 2 adress colums, that can be sorted either according to our ip/hostname-comparison or according to String.compare().
* ToCompare.java
* Created on 10. Februar 2006, 10:41
* This class is a basic model object,
* with a field - String address - according
* to which it shall be sortable.
package comparator;
* @author mock
public class ToCompare {
* holds the IP or Host address
private String address=null;
* Instance of a Comparator class that
* provides our sorting algorithm
private RcHostComparator hostComparator=null;
/** Creates a new instance of ToCompare */
public ToCompare() {
this("defaultHost");
* when creating a new ToCompare instance,
* the hostComparator is created for it
* @ param aAddress - IP or Hostname
public ToCompare(String aAddress) {
address=aAddress;
hostComparator=new RcHostComparator(address);
public String getAddress() {
return address;
public RcHostComparator getHostComparator() {
return hostComparator;
}Here the code of the Class RcHostComparator, it is created with the address field of the ToCompare object that it holds. It first checks if the address field is an IP or not, and then chooses the comparison algorithm according to its own field state and the field state of the object to compare to:
* RcHostComparator.java
* Created on 10. Februar 2006, 10:43
* This class is used to provide a method for
* comparing objects that have an address field,
* containing either IP adresses or hostnames.
package comparator;
import java.text.CollationKey;
import java.text.Collator;
import java.util.Comparator;
import java.util.Locale;
* @author mock
public class RcHostComparator implements Comparator
* holds the IP or Host address
private String address=null;
* Is the address an IP
private boolean isIPAddress=false;
* if (!isIPAddress) this is created out of the address
* to provide a performant way of comparing it with another
* CollationKey, in order to sort Strings localized
* @ see java.text.Collator
* @ see java.text.CollationKey
private CollationKey hostnameCollationKey=null;
* if (isIPAddress) this array holds
* the 4 byte of the Ip address to compare
private int[] intValues=null;
* minimum for IP bytes/ints
private static final int minIntValue=0;
* maximum for IP bytes/ints
private static final int maxIntValue=255;
* Creates a new instance of IpComparator
* @ param aAddress - holds the IP or Host address
public RcHostComparator(String aAddress) {
address=aAddress;
* check if address is an IP
isIPAddress=checkIP();
* if Hostname -> instantiate localized CollationKeys
if(!isIPAddress){
Collator _localeCollator=Collator.getInstance(Locale.getDefault());
hostnameCollationKey=_localeCollator.getCollationKey(address);
}else{}
* Here the comparison of the address fields is done.
* There a 4 cases:
* -1 both Hostnames
* -2 aObject1 IP, aObject2 Hostname
* -3 aObject1 Hostname, aObject2 IP
* -4 both IPs
* @ param aObject1, aObject2 - Comparator objects
public int compare(Object aObject1, Object aObject2)
int _result= 0;
if(aObject1 instanceof RcHostComparator && aObject2 instanceof RcHostComparator )
RcHostComparator _ipComparator1=(RcHostComparator)aObject1;
RcHostComparator _ipComparator2=(RcHostComparator)aObject2;
* Compare algorithms, according to address types
if(!_ipComparator1.isIPAddress()&&!_ipComparator2.isIPAddress()){
* If both addresses are Strings use collationKey.compareTo(Object o)
_result=_ipComparator1.getHostnameCollationKey().compareTo(_ipComparator2.getHostnameCollationKey());
}else{
* IPs are smaller than Strings -> aObject1 < aObject2
if(_ipComparator1.isIPAddress()&&!_ipComparator2.isIPAddress()){
_result=-1;
}else{
* IPs are smaller than Strings -> aObject1 > aObject2
if(!_ipComparator1.isIPAddress()){
_result=1;
}else{
int _intIndex=0;
int[] _int1=_ipComparator1.getIntValues();
int[] _int2=_ipComparator2.getIntValues();
* compare IP adresses per bytes
while(_result==0 && _intIndex<4){
if(_int1[_intIndex]>_int2[_intIndex]){
_result=1;
}else if(_int1[_intIndex]<_int2[_intIndex]){
_result=-1;
}else{}
_intIndex++;
}else{}
return _result;
* checks if the address field holds an IP or a hostname
* if (_isIP) fill intValues[] with IP bytes
* if (!isIP) create hostnameCollationKey
private boolean checkIP(){
boolean _isIP=false;
String[] _getInts=null;
* basic check for IP address pattern
* 4 digits also allowed, cause leading
* 0 stands for octet number ->
* 0172=122 ->
* 0172.0172.0172.0172 = 122.122.122.122
boolean _firstcheck=address.matches("[0-9]{1,4}\\.[0-9]{1,4}\\.[0-9]{1,4}\\.[0-9]{1,4}");
if(_firstcheck){
_getInts=address.split("\\.");
intValues=new int[4];
for (int _count=0; _count<4; _count++){
try{
int _toIntValue;
if(_getInts[_count].startsWith("0")){
// if leading 0 parse as octet -> radix=8
_toIntValue=Integer.parseInt(_getInts[_count], 8);
}else{
// parse as is -> radix=10 -> (optional)
_toIntValue=Integer.parseInt(_getInts[_count]);
if(_toIntValue<minIntValue||_toIntValue>maxIntValue){
// out of unsigned byte range -> no IP
return _isIP;
}else{
// inside byte range -> could be part of an IP
intValues[_count]=_toIntValue;
}catch(NumberFormatException e){
// not parseable -> no IP
return _isIP;
// all 4 bytes/ints are parseable and in unsigned byte range -> this is an IP
_isIP=true;
}else{}
return _isIP;
public boolean isIPAddress() {
return isIPAddress;
public int[] getIntValues() {
return intValues;
public CollationKey getHostnameCollationKey() {
return hostnameCollationKey;
public String getAddress()
return address;
}The page bean holds an array of ToCompare objects. It is the model for a new table component, hold by an ObjectArrayDataProvider. Here a code excerpt:
public class Page1 extends AbstractPageBean
private ToCompare[] toCompare= new ToCompare[]{
new ToCompare("1.1.1.1"),
new ToCompare("2.1.1.1"),
new ToCompare("9.1.1.1"),
new ToCompare("11.1.1.1"),
new ToCompare("0172.0172.0172.0172"),
new ToCompare("123.1.1.1"),
new ToCompare("a"),
new ToCompare("o"),
new ToCompare("u"),
new ToCompare("z"),
new ToCompare("�"),
new ToCompare("�"),
new ToCompare("�")
* This method is automatically generated, so any user-specified code inserted
* here is subject to being replaced
private void _init() throws Exception
objectArrayDataProvider1.setArray(toCompare);
private TableRowGroup tableRowGroup1 = new TableRowGroup();
private ObjectArrayDataProvider objectArrayDataProvider1 = new ObjectArrayDataProvider();
}The relevant .jsp section for the two column table looks like:
<ui:tableRowGroup binding="#{Page1.tableRowGroup1}" id="tableRowGroup1" rows="10" sourceData="#{Page1.objectArrayDataProvider1}" sourceVar="currentRow">
<ui:tableColumn binding="#{Page1.tableColumn1}" headerText="SortIP" id="tableColumn1" sort="#{currentRow.value['hostComparator']}">
<ui:staticText binding="#{Page1.staticText1}" id="staticText1" text="#{currentRow.value['address']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{Page1.tableColumn2}" headerText="SortString" id="tableColumn2" sort="address">
<ui:staticText binding="#{Page1.staticText2}" id="staticText2" text="#{currentRow.value['address']}"/>
</ui:tableColumn>
</ui:tableRowGroup>Sorting localized with Locale="DE_de" according to ip/hostcompare sorts:
SortIP
1.1.1.1
2.1.1.1
9.1.1.1
11.1.1.1
0172.0172.0172.0172
123.1.1.1
a
�
o
�
u
�
zWhereas normal sort over String address whitout localization sorts:
SortString
0172.0172.0172.0172
1.1.1.1
11.1.1.1
123.1.1.1
2.1.1.1
9.1.1.1
a
o
u
z
�
�
�Not that short, but I hope it will help - if anyone has the need for another than the default sorting algorithms
Best regards,
Hate E. Lee -
Unable to capture the adf table column sort icons using open script tool
Hi All,
I am new to OATS and I am trying to create script for testing ADF application using open script tool. I face issues in recording two events.
1. I am unable to record the event of clicking adf table column sort icons that exist on the column header. I tried to use the capture tool, but that couldn't help me.
2. The second issue is I am unable to capture the panel header text. The component can be identified but I was not able to identify the supporting attribute for the header text.Hi keerthi,
1. I have pasted the code for the first issue
web
.button(
122,
"/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1824fhkchs_6']/web:form[@id='pt1:_UISform1' or @name='pt1:_UISform1' or @index='0']/web:button[@id='pt1:MA:0:n1:1:pt1:qryId1::search' or @value='Search' or @index='3']")
.click();
adf
.table(
"/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1c9nk1ryzv_6']/web:ADFTable[@absoluteLocator='pt1:MA:n1:pt1:pnlcltn:resId1']")
.columnSort("Ascending", "Name" );
} -
I was using a muticolumn listbox(not table,for table i have example code,and problem is that i was not getting active cell position for Multi column listbox) with 5 columns.In third column,i want to generate a ring control,generate in the sense,whenever user clicks on any cell of third column of multicolumn listbox(not table),the ring control should pop up.The thing is that i need to use only one ring control and whenever user clicks on any cell of a third column,this ring control should pop up.How can i achieve this,anyone please help me,
Regards,
Naresh.NHi, Naresh,
For starting point you can read this: Table with Drop Down Items
Andrey. -
Default column sort order for 11g table
Could anyone give me some indication on how I would go about setting the default sort order for a table?
I have a table with a few columns, and dataset returns in a particular order, but my table decides to sort if in any given order until I manually click on the column header and sort it.
I would like to have it done by default on a particular field.
Any info is appreciated.
Thanks
JonnyAs Chris says, the easiest way and best re-use way is to use the order-by clause in your underlying model layer SQL query. For instance in ADF BC this would be in a View Object's query.
However as you haven't dictated your model layer technology, there is another way in JDev 11g. In your web page that contains the ADF Faces RC table, select the binding tab at the bottom of the page, then double click on the iterator in the binding page, and in the Edit Iterator Binding dialog, select the Sort Criteria tab. This allows you to override the sort order on the iterator's columns.
CM.
Maybe you are looking for
-
My old computer died. I had my iTunes library backed up to an external drive. I have followed the steps outlined and moved the itunes folder from the external to the music folder on my new imac. I have checked that the addres is correct but when I
-
How to enter a new serial number
Ok I did the wrong thing. But now trying to fix it. I had an urgent document to send off today but pages wouldn't save as the trial ran out. Today. To get around this I used a workmates serial as a temp fix. I've now bought iWork so I now have my own
-
Problem with Scrollbar skinning
Hello guys... I'm witnessing a weird behaviour in my application and I thought I should get your opinions on the matter. I've created two scrollbar skins in Flash Catalyst (one horizontal, one vertical). Its working great when I test the application
-
I have an application that requires Java to run. I've discovered that the application will run on my macbook in Safari, but I can't get it to run in Firefox or Chrome. Unfortunately, Firefox is the most convenient browser to use. I have the latest Ja
-
Handling 2 iPhones 3GS on a single iMac24 a family matter!
I just bought an iPhone for my wife and it is still in the box. I feel confronted and unsecure with the question *how can I synchronize 2 iPhones* on one iMac without crashing information on my iPhone. Sharing contacts and iCal items and mail is not