problem re-setting editable property

Discuss all feature requests you have for a new Servoy versions here. Make sure to be clear about what you want, provide an example and indicate how important the feature is for you

problem re-setting editable property

Postby DFehrenbach » Thu Oct 30, 2003 9:41 pm

I get an error when the following code is executed. I'm trying to re-set a field as "un-editable" on a form.


if ( globals.returnedNameId )
{
tknameid=globals.returnedNameId
globals.fn=timekeeper_to_name.namefirst
globals.ln=timekeeper_to_name.namelast
globals.mn=timekeeper_to_name.namemiddle

forms.tkAdd.elements.fn.edit=false <--- Error says Java class "com.servoy.j2db.dataui.DataField" has no public instance field or method named "edit".
}
else
{
answer=plugins.dialogs.showDialog( 'Name record was not entered or selected...', 'Do you want to try again?', 'No', 'Yes' )
if ( answer= 'Yes' )
{
tkSearchNames();
}
else
{
return
}
}


It does not work with "editable" either. Can someone please tell me the correct syntax?
DFehrenbach
 
Posts: 252
Joined: Sat Sep 13, 2003 6:48 pm
Location: Cleveland, OH

Postby pbakker » Thu Oct 30, 2003 10:30 pm

I don't know much about this, but it look like the first If statment is missing a correct equasion. it says "if ( globals.nnnnnn)" instead of "if (globals.nnnnnn = x)"

But like I said, I don't know much about this
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby maarten » Thu Oct 30, 2003 10:50 pm

if ( globals.returnedNameId )

Good code...is a very easy way of doing
if(globals.returnedNameId != null && globals.returnedNameId != "")

forms.tkAdd.elements.fn.edit=false <--- Error says Java class "com.servoy.j2db.dataui.DataField" has no public instance field or method named "edit".


you can disable foields by doing this:
forms.tkAdd.elements.fn.enabled = false
So replace "edit" with "enabled"

BTW: how did you come up with this code?
If you use the auto generated code by clicking through the method editor
you'll never end up with that code, unless you manually type it.
I don't mean to be insulting here :) ,
because maybe you're misinformed by some docs or post out there ?
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands

Postby DFehrenbach » Thu Oct 30, 2003 11:19 pm

No insult taken. :oops: The code I sent was the result of a number of attempts to divine the correct syntax by trial and error typing. I started off with the "enable" property clicked from the Method editor, but abandoned it because it also greyed out the text.
I re-applied your suggested code, but now have to ask if the greyed-out foreground color can be overridden. I tried:

elements.fn.enabled=false;elements.fn.fgcolor='#000000'

but that does not work either.

What can I try next?
DFehrenbach
 
Posts: 252
Joined: Sat Sep 13, 2003 6:48 pm
Location: Cleveland, OH

Postby maarten » Fri Oct 31, 2003 12:00 am

hmm, I was already afraid you'd come back with this question. :wink:

You want the "editable"-property in the designer
to be changable through scripting

elements.fn.editable=false/true

I'll ask dev team if this is possible.

Thanks.
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands

Postby maarten » Fri Oct 31, 2003 2:26 pm

implemented in next release 1.2rc7 :)
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands

Postby DFehrenbach » Fri Oct 31, 2003 3:26 pm

Great! :D Thanks!
DFehrenbach
 
Posts: 252
Joined: Sat Sep 13, 2003 6:48 pm
Location: Cleveland, OH

Postby DFehrenbach » Thu Nov 13, 2003 12:25 am

I noticed using Version R2 1.2rc9-build 259 that comboboxes cannot have the editable property assigned on a form via a method. Is this an oversight or intentional?
DFehrenbach
 
Posts: 252
Joined: Sat Sep 13, 2003 6:48 pm
Location: Cleveland, OH


Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 5 guests