Re: Alert MIP Proposal

Hello Steven and co,

Would something like this by okay too:

<bind ref="age" type="integer">
	<alert level=“subtle”><output ref=“longwinded-error-report/en-gb”/></alert>  
	<alert level=“in-your-face”><output ref=“pithy-error-report/en-gb”/></alert>
</bind>

Hint and help too?

Best wishes

Mark

P.S. I’ve had severe depression for a long time, but a change of medication and better support seems to be helping and I’m finding that I am suddenly more interested in the world around me again :)

Still using XForms (XSLTForms) in the wild, probably not very effectively, but hey ho. Here is an example: http://www.aocarchaeologygroup.uk.wizzdns.com/darkAgeScot/


I will try to pay more attention and maybe feel up to joining in again in the coming weeks. 


> On 21 Jun 2017, at 08:51, Steven Pemberton <steven.pemberton@cwi.nl> wrote:
> 
> It seems to me that the Alert text of an Alert on a control really belongs
> with the data in most cases. As it currently is, the message and the
> condition are far apart.
> 
> Therefore a proposal.
> 
> ====
> The Alert Property
> 
> This property associates an alert message with a constraint or type model
> binding.
> 
> Computed Expression: Yes.
> 
> Legal Values: Any string expression.
> 
> Default Value: none.
> 
> Inheritance Rules: does not inherit.
> 
> Description
> 
> This associates a message expression with a type or constraint property of
> a node. If a control is bound to the node, and the node is non-valid as a
> result of the type requirements or constraint, then the associated message
> is evaluated, and displayed as if a part of an <code>alert</code> element
> on the control.
> 
> Examples
> 
> <bind ref="age" type="integer" alert="'Must be a whole number'"/>
> <bind ref="age" constraint=". &gt;= 0" alert="'Must be greater than
> zero'"/>
> 
> <bind ref="wish" constraint="count(../wish) &lt; 4" alert="'You can't have
> more than 3 wishes'"/>
> 
> <bind ref="card" type="card-number" constraint="cardnumber(.)"
>         alert="'Not a valid card number'"/>
> 
> <bind ref="card" type="card-number" constraint="cardnumber(.)"
>            alert="instance('messages')/cardnumber"/>
> 
> <bind ref="pin-code" constraint="matches(., '^\d{4}$')" alert="'must be 4
> digits'"/>
> 
> ====
> 
> Steven
> 

Received on Wednesday, 21 June 2017 08:57:38 UTC