Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Network:
Windows 2008 Server
>>>>Right now the process is just in a program. I intend to re-write it as a class, but for the time being I thought of just using a wrapper to create a session based class, switch to its datasession and then run this program. This didn't work.
>>>>
>>>>I'm afraid that even if I create it as a class, I would still have the same problem with my form. Are you sure that making this program a class based on the session is going to work?
>>>
>>>In the session based class add a method that runs your processing prg. It'll run in the private DS of the class.
>>
>>I exactly had the same problem as William has. In my case the problem was the grids of the form lost their databinding. Either I don't understand what you mean, Sergey, so forgive me then, or otherwise it seems to me it cannot be solved that way. Class or not. It seems VFP-behaviour to me. Switching to an other datasession means that when you come back to your original session the bindings have been lost. But maybe you mean something different and there is some solution after all.
>>
>>Lennert
>
>Did you try moving focus out of the grid? Though we tried it too and it didn't help.
In my case the focus was not on the grid (it was on a textbox) but the grid complained.
But in the meantime I think I understand what Sergey wrote, and I think he is right.
- Before the form opens, declare an new sessionobject
- Define a userdefined method for the session
- In that method of the session call your prg.
- Now from within your form, call loSession.Yourmethod. Now you don't do an explicit "set datasession to", but because the code is from within the sessionobject, it will operate in that session. Implicit you switch sessions now, and thereby may avoid the problem.
I think this is what Sergey meant. I didn't test it, by the way. If this is it, S. deserves the stars...
Lennert
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement