Turn off editing of a field

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

Turn off editing of a field

Postby jimr451 » Mon May 14, 2012 11:24 am

Hi,

I have a field that I'd like to "lock" once the record is created. It's a "username" field, and I'd like to not allow editing it once the record is created. I tried setting permissions, to no avail - is there a simple way to turn off editing of the field once the record is not new. Again, I tried all kinds of things from the manual, but nothing seemed to take.

-Jim
Jim Roberts
Roberts WebForge, Inc.
http://www.robertswebforge.com
jimr451
 
Posts: 20
Joined: Mon Jun 27, 2011 1:46 pm

Re: Turn off editing of a field

Postby Jean » Tue May 15, 2012 1:06 am

Hi Jim,

This is described in http://xataface.com/wiki/fieldname__permissions

Have a good day

Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: Turn off editing of a field

Postby jimr451 » Tue May 15, 2012 7:04 am

Wow - I swear I tried that (and a bunch of other combinations) to no avail - but now it works:

In the delegate class:

Code: Select all
function username__permissions(&$record) {
     return array('edit'=>0);
  }


turns off editing for the username field after the record has been created.

I wonder if something was cached somewhere, or I was testing too many things at the same time.

Thanks!
Jim Roberts
Roberts WebForge, Inc.
http://www.robertswebforge.com
jimr451
 
Posts: 20
Joined: Mon Jun 27, 2011 1:46 pm

Re: Turn off editing of a field

Postby Jean » Tue May 15, 2012 7:09 am

Jim,
It happens often when we have your head in our code :wink:

Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 9 guests

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