Project

General

Profile

Support #5341

WTableCell focus lost

Added by Gunnar Skogsholm about 6 years ago. Updated about 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
10/13/2016
Due date:
% Done:

0%

Estimated time:

Description

How do I catch when the user has clicked away or tabbed away (focus lost) from a WTableCell?

I've tried: blurred().connect( this, &WtTableCell::focus_lost );

#1

Updated by Gunnar Skogsholm about 6 years ago

Ok, I figured it by trial and error. For the click events, I attached to signals from WTableCell, but in this case, I needed to attach a function to the child widget of that WTableCell:

auto editWnd = new Wt::WTextArea( fieldData->string_value() );

auto tableCell = gridCtl->elementAt( Rec, left() ); // triggers WtTable::createCell

tableCell->addWidget( editWnd );

editWnd->blurred().connect( dynamic_cast<WtTableCell*>(tableCell), &WtTableCell::focus_lost );

The documentation should be updated to close this issue out.

Also available in: Atom PDF