Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: New problem with containers

$
0
0
Re: New problem with containers
FoxInCloud
Re: New problem with containers
Feb. 4, 2013
07:11 am
3PI0FECJ4Show this entire thread in new window
Gratar Image based on email address
From:Thierry Nivelet (FoxInCloud)
To:Michele
this is important in the following cases:
- you need to address the objects you added dynamically, e.g. execute an event and/or change some properties such as color, position, etc.
- when adding new appointments to for a given user, you need to rebuild all his appointments

Here is what you could do:
- hold a user's appointments in a cursor, a form array or even better a view
- create a method to build all user's appointments based on this cursor - say .AppointsAdd():

* Clear all appointments (.removeObject()) * For each appointment for this user, add to thisForm.

- implement form.wUserSet() like this:

LPARA twUser, tlTempLOCAL llResult llResult = DoDefault(m.twUser, m.tlTemp)IF m.llResultthis.AppointsAdd()ENDIFRETURN m.llResult

(FAS calls form.wUserSet() before any action on the form, such as executing an event)

I think we'll be able to save / restore containers' dynamic content in FAS so that you won't need to care about this anymore.


So where i have to put the code where i read the appointments for the active user ? which method of the form ?


Michele,
please keep in mind that each form is shared by all users; so you can't be sure that the objects you added in a previous request (event) are still in the form.
Thus you need to add all the objects required on each request.
thanks,



I have a form with some containers in it. With a button i add runtime some objects in one of thiese container, in the first.
The code to add this object is

ThisForm.D1.clearApps ThisForm.D1.AddObject("A1","_appointment")With ThisForm.D1.A1 .Height = 200 .Tag = "APP" .Top = 250 .Left = 1 ._Label1.Caption = "Demo COGEN" .Visible = .T.EndWith ThisForm.D1.wlContentChanged = .T. ThisForm.Refresh

Where clearApp is a method that clean all the objects already contained in D1 that is the container

When i open the form the first time it appears as in this image

after i click the button to add objects it changes, but the object is not added where i ask (the object has top=250 while in the form it seems at 0 and also the height is not correct. Iy has the properties i defined in the object class)

If i close the form (with the button we found in awcmdok) and the i open the form again i see the form without object in the container (even if in the debug it has still the object)

and when i add newly the object with my button (as i do the first time) the object is added in the correct position

What do i need to do to add the object without problems. This form must show user's appointment in week view....

Thanks





Thierry Nivelet (FoxInCloud)
Never explain, never complain (Queen Elizabeth II)


Viewing all articles
Browse latest Browse all 10393

Trending Articles