Page 1 of 1

Change field background when ignored?

PostPosted: Thu May 13, 2010 3:37 pm
by lhat
Hi, All--

In the edit-mode, I'd like to reset the background color for those fields in my table marked with ignore=1 in that table's fields.ini. This would give users additional visual cues as to what they cannot change. I thought this must be done through a combination of a delegate class function and some element in the stylesheet, but I'm not finding a way to check the ignore state for a field in a record, nor what style element I should reset the color on if I knew. Any ideas?

Re: Change field background when ignored?

PostPosted: Thu May 13, 2010 3:47 pm
by shannah
This is really something that should be changed in Xataface to automatically hide the ignore fields from any edit form. If you mark a field as 'ignore' then it really has no place on the edit form because any changes you make to it won't be saved.... Xataface simply ignores these fields when it is saving the record.

Until this is actually fixed, there are a couple of solutions:

1. Set widget:type=hidden on any fields that you intend to ignore.
2. Use widget:atts:class or widget:atts:style to set a style on the widget to mark it.
3. Use widget:atts:disabled to disable the widget.

-Steve

Re: Change field background when ignored?

PostPosted: Thu May 13, 2010 5:00 pm
by lhat
Thanks, Steve--

Actually, in our usage we've got the situation where the user needs to see some information that he/she can't change, even though editing the record--so being able to set styles in the ways you've indicated will be exactly what we need. I really appreciate it!

Re: Change field background when ignored?

PostPosted: Thu May 13, 2010 5:11 pm
by shannah
I wonder if perhaps using permissions in this case might be more appropriate. Just make the fields in question read only.