how to lock all fields on a form?

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

how to lock all fields on a form?

Postby RobertMeyer » Fri Jul 23, 2004 9:02 pm

my client would like to 'lock' a form, under certain circumstances.

my first thought was to just disable all the fields on the form,
but there are actually several forms (8 at the moment) and
most of them have a lot of fields; so i'ts starting to turn into
a big job.

could anyone suggest a way to lock out all the fields on a specific form
with "one fell swoop", while still allowing the user to view the
data in the fields?

thanks in advance
rm.
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

Postby Westy » Fri Jul 23, 2004 9:30 pm

I believe the built-in security options are granular down to forms, fields, and tables, although I have not fully tested them. Try going to Tools/Security and setting up user accounts with the security limitations you need.
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby RobertMeyer » Sat Jul 24, 2004 12:32 am

thanks for responding westy;

the problem with using security for this is, we want to lock
out all users due to certain criteria, llike if a record is 'checked out'
for example.

i don't think the security settings would work that way (but i'll
check just in case)

thanks.
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

Postby IT2Be » Sat Jul 24, 2004 12:47 am

Robert,

For this there is:

controller.readOnly() to set/unset fields readOnly

or

controller.enabled() to enable/disable fields and buttons

That should do the trick
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby RobertMeyer » Sat Jul 24, 2004 4:21 pm

Hi Marcel;

that sounds like it might do the trick, but it's not in my list
of methods in the method editor.

i'm running b276, and can't change right now (because the
project is late and the client is testing, and we don't have
any spare time in our schedule). is the readOnly() method
somethat that was added after build 276?

rm.
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

Postby IT2Be » Sun Jul 25, 2004 11:33 am

Wow, don't know... If you don't see it I guess it has been added afterwards but why can't you change.

When you are working on 2.0 final you have it. I can't think of any reason why you can't use 2.0...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby RobertMeyer » Sun Jul 25, 2004 6:09 pm

IT2BE wrote:I can't think of any reason why you can't use 2.0...

i tried once, a month ago to upgrade to a newer version of servoy, and
was unalble to open my solution. i didn't have (and still don't have) time
to work with it yet, since we're so overdue on this project.

i'll bet i'm missing out on a lot of great new features!
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

oops!

Postby RobertMeyer » Fri Jul 30, 2004 5:12 pm

that sounds like it might do the trick, but it's not in my list
of methods in the method editor.


my mistake! it's there as a property; i was looking for it as a method.

now, it seems to do exactly what i want, but with one problem:
some of the items on my forms, a few comboboxes, don't actually
get disabled when setting the controller to readonly;

the behavior is very strange; when setting the readonly property,
a few of the combos change in appearance from having two arrows,
one pointing up and one pointing down, to having just one arrow
pointing down; and, they're not disabled!

now here's something even more strange: i just copied and pasted one
of these combobox fields, and switched back to "run" mode, and the
copied version works perfectly! but the original does not.

can anyone give any clues on this??

thanks very much in advance.
rm.
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

Postby IT2Be » Fri Jul 30, 2004 5:20 pm

Again this worked well in 2.0. When you work on a beta version I can imagine some issues. There were some for sure before the final release...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby RobertMeyer » Fri Jul 30, 2004 5:31 pm

that brings up another question:

i keep thinking of servoy versions in terms of build numbers;
i'm currently using build #276.

when you say "use RC2" or something like that, how does that
translate into a build #?

and, does anyone know if this problem with combos can be worked-around?
i need to deliver something with the 'disabled' feature in place in
a few days, and i have to find a way to make this work reliably.

thanks!
rm.
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

Postby IT2Be » Fri Jul 30, 2004 5:34 pm

well, your build/version issue is something I can't help you with.

What you can do with the combo's is see what happens with controller.enabled instead of controller.readonly.

Other than that Jan Aleman posted somewhere a loop (don't know where and when anymore) that showed how to do that conviently with elements[index].readOnly...

Hope this helps a little...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby RobertMeyer » Fri Jul 30, 2004 5:38 pm

i found it!

and it was all my fault! :oops:

in another part of the code, i adjust various interface elements on
the screen, and i was 're-enabling' these few combos for another
reason.

so sorry to bother you with all of this; but thanks very much for
the quick responses.

hopefully i'll be able to help you someday in return!

thanks again.
rm.
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 38 guests

cron