on 05-07-2010 9:54 AM
Hello SDN!
I've got a table with data (called it data table). For some of columns I need to create filter which allow users to select filter values from combobox.
For my task I 've created a table with two columns. In first column there is a name of column of data table and in second column there is a combobox with unique values of data table's column. In other words, I need to get somethis like this:
Field A -> {valueA1, valueA2, valueA3}
Field B -> {valueB1, valueB2, valueB3, valueB4}
etc
As you can see there are different values in each row.
Also I've created node with following structure:
FilterNode
......+FilterValues
...........- id
...........- text
...- field
"field" contains column name of data table
"id" contains a value of "field" colulmn
"text" contains text representation of "id"
FilterValues is non-singletone node with cardinality 0...n
Here is a code filled filter node:
IPrivateScreen1.IFilterNodeNode nodeFilter = wdContext.nodeFilterNode();
nodeFilter.invalidate();
for(Iterator it = filters.fieldsIterator(); it.hasNext();){
String field = (String) it.next();
IPrivateScreen1.IFilterNodeElement elemFilter = nodeFilter.createFilterNodeElement();
elemFilter.setField(field);
nodeFilter.addElement(elemFilter);
IPrivateScreen1.IFilterValuesNode nodeFV = elemFilter.nodeFilterValues();
for(Iterator iv = filters.valuesIterator(field); iv.hasNext();){
IPrivateScreen1.IFilterValuesElement elemFV = nodeFV.createFilterValuesElement();
String id = (String)iv.next();
elemFV.setId( id );
elemFV.setText( id );
nodeFV.addElement(elemFV);
}
}
All "for" loops executed normally. But there are no values in comboboxes...
Hi,
In this line, u are invalidating before u loop and hence u will not have any values:
IPrivateScreen1.IFilterNodeNode nodeFilter = wdContext.nodeFilterNode();
nodeFilter.invalidate();
remove the invalidate statement or put it at the end.
Regards,
Poojith MV
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please add this line of code after your for loop,
nodeFilter.invalidate();
Regards,
Kishan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.