Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Child Form / Rule Events
Message
From
09/01/2003 18:49:08
 
 
To
09/01/2003 17:52:34
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00739796
Message ID:
00740121
Views:
13
>Try putting it in the DM container. See if the behaviour changes.

I'll do this and get back to you. It's the end of the day and time to go home.

>>Following is the code I wanted to put in the IsEditAllowedRule()
>>
>>LPARAMETERS cWorkarea, cField
>>IF m.cWorkarea == "Frames" AND frames.groupshot
>> IF m.cfield $ 'Pack1,Pack2,Pack3,Pack4,Pack5,Pack6,Pack7,Pack8,Pack9,Pack10,Pack11,Lname,Fname'
>> this.replace("frames",m.cfield,"")
>> RETURN .f.
>> ENDIF
>>ENDIF
>
>When you toggle the checkbox, it calls the form.Refresh(), right? If so, does the check box's control source value have anything to do with the above logic?

Yes to both questions. The controlsource of the checkbox is frames.groupshot.



>. However, if the event isn't even firing, well thats another story. If you look in the Codmine help file, it specifically states that a rule class should be placed in the DM container if you are not using it in a CDE.

I don't remember seeing this in the help file, but I'll go back and try to find it. I was basically using the Pizza example as a guide.

>
>Just an observation, this code is primarily to return a True or False value to decide whether an edit state is permitted. It is not really the place to change data as per your replace() call. You should evaluate an expression or series of expressions and return a True/False value, nothing more.

You pass the test. I put the replace code in there just to make sure you were on your toes. <g> I came to the same conclusion when relooking at some of my code. I have moved the replace to the AfterChange() event in the rule class. It works much better there.

>
>>RETURN DODEFAULT(m.cworkarea,m.cfield)
>
>No need for this as there is no parent code (press F9 in the method code to see whether there is any parent code).

It's just a habit. I think I do remember the documentation saying that there isn't any code in any of the Before or After events.

>
>>I know there is a way to post formatted code. I just don't know how to do it.
>
>Just use the PRE and /PRE tags (wrapped with angle brackets).

I'll try to remember that. It looks like I may be using it enough to commit it to memory.
>

>HTH

Absolutely. I appreciate all of the time you take out of your day to answer my questions. I don't think that I can convey my gratitude by just the typed word. Thanks.
Previous
Reply
Map
View

Click here to load this message in the networking platform