Skip to main content

Posts

Showing posts with the label Runbase class field mandatory

Indicating mandatory field in a dialog (RunBase) class.

A classical problem is indicating that a field is mandatory in a dialog, when the field is not bound to a datasource/field in a datasource. Normally fellow developers will tell you that, that is not possible. I found a way to do this. In your Runbase-based class you can implement the putToDialog-method e.g like this: protected void putToDialog() { super(); fieldMask.fieldControl().mandatory(true); } where fieldMask is a DialogField object in your dialog. This will make the field act like it was a mandatory field from a datasource in a form, showing a red-wavy line under the field, and requiring the field to have a value. Attention: Your class has to run on the client.If you set your class to run on the server, you get a run-time error, when the fieldMask.FieldControl()-call is made.