0

I'm using ValuesManager (can link multiple DynamicForms into one request) but to simplify this example let's assume I'm using simple DynamicForm with some DataSource.

When on DynamicForm I run method validate() it's use Client-Side Validators I wrote for my purposes. That's ok. But also I want to validate data on Server-Side.

I don't want to use method saveData() because I want to show pop-up window with confirmation entered data.

Is there any way to force ServerSide validation without calling saveData ?

PS. setUseLocalValidators(false) (on DataSource object) seems doesn't change this behaviour.

WBAR
  • 4,924
  • 7
  • 47
  • 81

2 Answers2

1

If you are using a dataSource you can call

validateData(values[, callback, requestProperties])

Smartclient 8.3 documentation DataSource.validateData

I use Smartclient on the client-side only but I've used this to call my own server-side validation.

I'm sorry I don't have any sample code available.

Insinbad
  • 108
  • 6
  • 1
    Simple... ;) Intuitive :) `validate()` on `ValuesManager` makes Client-side validation on fields in `DynamicForms` and `validateData` validate value on `DataSource`. Do You know any method to validate all fields in `DataSource` no one by one ? – WBAR Mar 20 '13 at 15:45
  • 1
    I'm still trying to track down my example but I think it submits the entire record. `dataSource.validateData(dynamicForm.getValues(),"if (OK) {dynamicForm.saveData();}",{actionURL:""}) ` – Insinbad Mar 20 '13 at 19:24
  • Thanks @WBAR. I'm not update to speed on it all. I hope it's all working out for you. – Insinbad Mar 22 '13 at 15:36
0

Could you try overriding validate of your DynamicForm and add inside the new method code calling the server validation code?

Alain BUFERNE
  • 2,016
  • 3
  • 26
  • 37