pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lello <rborre...@gmail.com>
Subject Re: TextInput and Validator issues
Date Mon, 07 Mar 2011 22:10:26 GMT

anton dos santos wrote:
> 
> I have done it this way:
> 
> public class ValidationRowEditor extends TableViewRowEditor {
> 
>    @Override
>    public void endEdit(boolean result) {
>      boolean valid = true;
>      if (result) {
>        Dictionary editors = getCellEditors();
>        Sequence cols = getTableView().getColumns();
>        for (int i = 0, n = cols.getLength(); i < n; i++) {
>          Component comp = editors.get(cols.get(i).getName());
>          if (comp instanceof TextInput) {
>            valid &= ((TextInput) comp).isTextValid();
>          }
>        }
>      }
>      if (!(result && !valid)) {
>        super.endEdit(result);
>      }
>    }
> }
> 
> if one of the TextInput editors is not valid, user can only leave the
> editor by pressing ESC.
> It seems to work also with mouse, so it may also solve Lello's issues (
> haven't tested completely)
> 
> 

The code suffers in any case the problem that I have: text not valid +
double click outside the row editor and you get a null pointer error.

--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/TextInput-and-Validator-issues-tp2641141p2648202.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Mime
View raw message