🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #8451

blocking the edit of jdbTable row in modifying event?

#8451
From: X_Aki Nieminen_X
Date: Tue, 22 Aug 2000 00:00
20 lines
1290 bytes
I want to prevent editing of record in a table based on "Locked" column. I
made the following code and it works reasonable good.

If I type in the text in one of the columns for locked record, key presses
go to a cell and I can continue editing the single cell. JBuilder copies the
original value back to a cell, when moving to another row or cell.

This will display me two times the validation error dialog (when starting to
edit cell and when focus is lost from the cell).

How to prevent this and really make a row as read only?

===
  void ProcedureDataSetOstoVrk_modifying(DataSet dataSet) throws Exception {
    if (dataSet.getBoolean("Locked")) {
      throw new ValidationException(ValidationException.UPDATE_NOT_ALLOWED,
        "Record is locked.", dataSet.getColumn("Lukko")
      );
    }
  }
Technical Details
Message-ID: <39a29416$1_2@dnews>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,5fe65dd6aaa397e5,start
X-Google-Attributes: gid111d45,public
From: "X_Aki Nieminen_X" <no@email.abc>
Subject: blocking the edit of jdbTable row in modifying event?
Date: 2000/08/22
Message-ID: <39a29416$1_2@dnews>
X-Deja-AN: 661157151
X-Trace: 22 Aug 2000 07:54:14 -0800, 194.142.156.86
Newsgroups: borland.public.jbuilder.java.swing
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3