Ticket #2521 (new enhancement)

Opened 8 years ago

Last modified 8 years ago

Finer control for is_required

Reported by: gracinet Owned by: gracinet
Priority: P2 Milestone: CPS 3.5.7
Component: CPS (global) Version: 3.5.2
Severity: normal Keywords:


All widgets have a boolean property is_required. If true, the widget is supposed to forbid empty values. This is done by the actual widget class, not the base class, of course, since the notion of empty values depends on the

Now in some cases, more flexibility would be useful. I propose to introduce a new standard property to complement is_required : the optionnal list of layout modes for which it is actually required (or the list of layout modes for which it exceptionnally is not)

Two example use cases:

  • reusing an edition layout as a search layout -> the layout mode normally differs
  • CPSUserForms (main motivation) : in the current UI, setting a widget as required makes it required on the form manipulation page, which means forcing to set a value in there (in turn that makes a default value for the end user, quite the opposite of "requiring" an input)

We'd need this in CPS 3.5.x series ASAP, but this is a bit too dangerous for a stable series without extra testing. Therefore, I'll implement in a branch and merge after the CPS 3.5.5 release.

Change History

comment:1 Changed 8 years ago by gracinet

Just merged th branch in CPS 3.5

Note: See TracTickets for help on using tickets.