readonly MIP [was RE: Hopefully simple question wrt case]

Hi Adam,

I didn't explain things clearly enough, so my apologies!

The feature you want is already in XForms, and it's the readonly attribute
on xf:bind. Just like @relevant it can be an XPath expression, so you can
say things like "this data is readonly if the user is not of type 'project
manager'". In addition you can use the @required MIP to say that "this data
must be provided if the user is of type 'project manager'."

A control that is bound to data that has this MIP set will receive
xforms-readonly and xforms-readwrite events at the control, and you can also
make use of the :read-only and :read-write pseudo-classes to style it. (I
know...the CSS has a hyphen, but the event name doesn't...)

Note that some implementations don't have pseudo-classes, but there has been
general agreement on using ordinary classes, called .pc-read-only and
.pc-read-write.

My comments were purely about the way this was presented to the user, and
that you might have trouble on some implementations in making a readonly
input not look like an input...formsPlayer being one of them!

But there is nothing missing in XForms.

Regards,

Mark


Mark Birbeck
CEO
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
b: http://internet-apps.blogspot.com/
w: http://www.formsPlayer.com/

Download our XForms processor from
http://www.formsPlayer.com/

> -----Original Message-----
> From: www-forms-request@w3.org 
> [mailto:www-forms-request@w3.org] On Behalf Of Flinton Adam
> Sent: 08 June 2006 09:21
> To: Mark Birbeck; www-forms@w3.org
> Subject: RE: Hopefully simple question wrt case
> 
> 
>  
> 
> > -----Original Message-----
> > From: www-forms-request@w3.org
> > [mailto:www-forms-request@w3.org] On Behalf Of Mark Birbeck
> > Sent: 07 June 2006 13:53
> > To: www-forms@w3.org
> > Subject: RE: Hopefully simple question wrt case
> > 
> > 
> > Adam,
> > 
> > Sorry to be the bearer of bad news, but XForms 1 doesn't 
> support XPath 
> > 2, and the xf:case element doesn't have a condition attribute.
> > 
> 
> Rats. Are there any plans to do this as it would appear that 
> setting the "editable status" of fields as a result of values 
> carried in an instance/model is a fairly common use case 
> requiring a std way to achieve it rather than a workround.
> 
> Another example we have is to allow only certain people to 
> edit certain fields where again we determine the user on the 
> server (via an initial logon etc) & then the instance/model 
> provided has value field which determines the user's role & 
> thus how many/which fields he/she can edit.
> 
> 
> > Ideally you should be able to do what you want simply via the 
> > @readonly MIP in combination with CSS. However, it will depend on 
> > which processor you are using as to how close you will get to your 
> > ideal in terms of the actual appearance.
> > 
> 
> A) I'm using Chiba on the server (in combination with JSF to 
> deliver XHTML
> B) Could you explain this in slightly more detail?
> 
> > For example, with formsPlayer, when an input is readonly 
> you can still 
> > edit the contents of the control, but the change won't be committed 
> > when you navigate away from the control--which is at least 
> the correct 
> > behaviour, even if it doesn't look great. (Basically, it's because 
> > readonly is processed in the model not the view, but it's 
> on our list 
> > of things to improve :)
> > 
> > Other processors may completely lock down the control when it's 
> > readonly, in which case it will 'feel' more like an 
> xf:output. So if 
> > you can use the :readonly pseudo-class to style the control 
> so that it 
> > doesn't look like an xf:input, then you've got pretty much what you 
> > want (without having to use lots of switches and cases).
> > 
> 
> Thanks. I'll have a dig.
> 
> 
> Adam
> 
> This e-mail is confidential and privileged. If you are not 
> the intended recipient please accept our apologies; please do 
> not disclose, copy or distribute information in this e-mail 
> or take any action in reliance on its contents: to do so is 
> strictly prohibited and may be unlawful. Please inform us 
> that this message has gone astray before deleting it. Thank 
> you for your co-operation.
> 
> 
> 
> 

Received on Thursday, 8 June 2006 09:12:05 UTC