Log in

View Full Version : Thinlet table in Pocket PC app


wrappingduke
04-18-2008, 07:47 PM
Trying to determine what cell is clicked in a thinlet table. I'm aware that a cell is not selectable in the table. I tried using the setMethod to pass a thinlet cell java file that permits access to the XML file.

Here's a sample:


<CODE class="jive-code jive-java">cell = thinlet.create("cell");
thinlet.setString(cell, "name", String.valueOf(1) + String.valueOf(i));
thinlet.setString(cell, "text", "some data");
thinlet.add(row, cell);
thinlet.setMethod(table, "action", "getSelectedCell(cell)", row,thinlet);
</CODE>

However, object (cell) is null in getSelectedCell.

I'm able to use place the method call in the action attribute of the
XML file, i.e. action="getSelectedCell(item)", which of course returns
the row.

Actually, I would like to get the column if the cell can't be determine from a mouse click. Is this possible if the mouse click event is overriden?

any help is appreciated

wrappingduke
05-03-2008, 07:43 PM
Found solution to problem w/ the use of Object Wrapper Thinlet. With the wrapper was able to determine the width of a column and as a result, determine what column a cell belongs to when clicked.

First the processEvent was overriden to capture mouse events. Then, retrieved x-coordinate from event. Lastly, determined column from x-coordinate.