You retreive the item by using the currentSelectedItem. But on click,
the row is actually not selected. So you will get the Item of the
previous selected row.
Is there not "normal" way for handling a click on a row of a
celltable?
On a flex table there is a "addTableListener" method. but this is
deprecated. On a HTMLTable there is the method "getcellforEvent". But
how I can do this with a CellTable??
I only want to have the index of the row that I have clicked.
Can somebody pleas help me????
On 31 Aug., 21:28, Juan Pablo Gardella <
gardellajuanpa...@gmail.com>
wrote:
> You can extend CellTable and overwritte onBrowserEvent2.
>
> @Override
> protected void onBrowserEvent2(Event event) {
> super.onBrowserEvent2(event);
>
> String eventType = event.getType();
> boolean isClick = "click".equals(eventType);
>
> // Get the event target.
> EventTarget eventTarget = event.getEventTarget();
> if (!Element.is(eventTarget)) {
> return;
> }
> final Element target = event.getEventTarget().cast();
>
> if (isClick) {
> int columnClicked = getCellIndex(target);
> boolean isExcludedColumn =
> this.excludedColumns != null
> && (Arrays.binarySearch(this.excludedColumns, columnClicked)>= 0);
>
> if (!"input".equalsIgnoreCase(target.getTagName())
> && !isExcludedColumn) {
> T item = getCurrentSelectedItem(target);
> //do something
> }
> }
> }
>
> 2011/8/31 Foermchen82 <
Juergen.F...@gmx.de>