Change field background when ignored?

A place for users and developers of the Xataface to discuss and receive support.

Change field background when ignored?

Postby lhat » Thu May 13, 2010 3:37 pm

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?
lhat
 
Posts: 40
Joined: Thu Aug 06, 2009 3:31 pm

Re: Change field background when ignored?

Postby shannah » Thu May 13, 2010 3:47 pm

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Change field background when ignored?

Postby lhat » Thu May 13, 2010 5:00 pm

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!
lhat
 
Posts: 40
Joined: Thu Aug 06, 2009 3:31 pm

Re: Change field background when ignored?

Postby shannah » Thu May 13, 2010 5:11 pm

I wonder if perhaps using permissions in this case might be more appropriate. Just make the fields in question read only.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 20 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved