Retrieve index of selected row in j2me TableItem - netbeans

I'm using org.netbeans.microedition.lcdui.TableItem for a j2me mobile application and i have trouble on retrieve index of the row "selected" by the user in a TableItem.
I know there is getSelectedCellRow() but if i don't select any row or if i select the first row the method returns always zero so i don't know in which case i'm in.
In which way have you solved ?
Thanks

Actually you need to know that the Tableitem is not a part of standard API. You can check it out here and we implement it like this, class TableItem, as you can see here, getSelectedCellRow() actually returns cursorCellX; and if you go through the implementation you can find yourself the reason for your question,why it returns zero.

Related

How to Ignore selected rows when filtering using floating filters in ag-grid?

I'm currently working on a project that uses ag-grid in Angular.
We have a table that displays some sort of data and it's possible to filter this table using some textbox floating filters above the table for every column.
Every row has a checkmark in the beginning that can be used to select this row.
The goal is to figure out a way to not filter out the rows that have been selected by the user. The rest of the rows should get filtered as normal.
Is there an easy way to implement this?
I've been looking trough the documentation and it seems like I will have to write a custom filter component, but I'm not sure where to start. Do filters even have the capability to check if a row is selected or not?
So I figured out an easy way. I created a new simple class:
export class IgnoreSelectionFilter extends TextFilter {
doesFilterPass(params: IDoesFilterPassParams): boolean {
if (params.node.isSelected()) return true;
else return super.doesFilterPass(params);
}
}
I use this class as the "filter" component for every column where this functionality is required. This new class behaves exactly like agTextColumnFilter, but first it will verify if the node is selected or not and ignore it if it's selected.

store selected rows on PFQueryTableViewController

I have a tableview that is of type PFQueryTableViewController and gets its value from Parse cloud. The tableview works fine but now I need to allow the user to:
Select a row
Record in a column (string array) on Parse-Users table what rows have been selected (need to record on parse that - i will use these values for other things later)
When the user comes back and opens the tableview he can see what rows have been selected last time he was in the app
I am not sure if PFQueryTableViewController has any methods ready for that. Could anyone give me some guidance?
I would prefer to use parse cause there are so much stuff out of the box. But if not, that is fine as well.
Also, code samples from similar solutions would be great. Just need to know the best approach.
The table view controller is there for display, it will tell you about selection, but it won't automatically maintain a record of selected items in the back end. You need to decide on the appropriate way to store the selections (array of pointers is better than an array of strings) and update the store and table display appropriately. There is no standard approach to this.

Conditional Switch clause?

hey guys another TSQL question. I'm trying to only have one set of data listed instead of all the fields. Basically I need:
If rep_name="MATT_RYAN" then switch to "Matt Ryan" else nothing
As of now, I get one row that works correctly, but I also have another row that lists all the other data from the other reps as well.
Thanks
I decided to just hide whichever value is null on the table. I highlighted the row, and under properties I added this expression to the hidden value:
=IIF(IsNothing(Fields!EmptyValue.Value),True,False)

scala, swing : make a table scroll to the last row non empty

I would like to be able to add a row in a table, to achieve this I thought to a button near the table, with the caption "New/Update". if no row is selected, then clicking on this button makes the table "scroll" to display the first empty row, then the person enter the informations in this row, and a second click on the button stores the new row.
But I need to make the table scroll, how can I do this?
I searched on internet and found this : here, but it is in Java and I did not find the scala equivalent to getCellRect method.
please note I did not used a model for the table.
If there's a method that isn't implemented in the Scala version, you can use peer to access the underlying Java Swing version.
So you should be able to access the method in your question, if you have a Table t, using t.peer.getCellRect.

CellList always remember old selection after refresh new data, even though old selection is cleared

I have a CellList with SingleSelectionModel, My use case is:
User selects one row(oldProxy) in CellList.
User creates one proxy(newProxy) and send to the server.
Client receives the success response and CellList begins to request newest data from server.
CellList filled with newest data, and the row in step 1 is still selected.
But i want to select the the newest row in step 4, i use
selectionModel.setSelected(newProxy);
but seem it does not work and still select the row in step1.
I tried deselect the row before step 2:
selectionModel.setSelected(oldProxy, false);
but at the end it still select the row in step1, it's weird. Any ideas about this?
Make sure you are passing a key provider (interface ProvidesKey) to the SingleSelectionModel constructor. If you don't use a key provider it will probably use equals() on your proxies to try to find a match, but since you've requested new instances from the server, the old instance will not match any of the new instances.
You can find an example here in the GWT doc.
See also: Select element in CellList using SelectionModel or ListDataProvider
Turned out to be a known GWT issue6310 , disable the KeyboardSelectionPolicy and it just works as i excepted, Thank Thomas for his great hint and David for the link.