PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Absurd behaviours of components
Absurd behaviours of components
Iniciado por guest, 29,may. 2015 10:28 - 2 respuestas
Publicado el 29,mayo 2015 - 10:28
I have an exe (menu) calling N other components (application modules). If the name of the first window of 2 or more components is the same, the OpenChild / Open called from the menu.exe opens always the same module/component, even if I use the component prefix in the opening.

Example. Menu.exe includes componentA and componentB. The first window of each component is named WIN_Search. So in menu I have 2 buttons:
button1 - on click do OpenChild(componentA.WIN_search)
button2 - on click do OpenChild(componentB.WIN_search)

At runtime, If I click on button1 it opens ComponentA but if I close that and next I click on button2 it still opens ComponentA. Viceversa, if I click on button2 it opens ComponentB but if I close that and next I click on button1 it still opens ComponentB.
It's very weird... Am I missing something?
Publicado el 29,mayo 2015 - 11:06
I discovered that if I set "isolated / independent context" in compoents' configuration the behaviour is ok. But I can't do it otherwise the components cannot "talk" with the caller, cannot see variables global to the whole application (defined in the exe project) and they open a connection (each one) to the DB for queries.
Publicado el 29,mayo 2015 - 14:12
The only solution is giving different names to entry forms of different components...

Then the following specification in OpenChild function doc is nonsense...

If a conflict occurs with a project element, the name of the element must be prefixed by the name of the component. For example:
Open(MyComponent.MyWindow)

To use the name of the element in a variable, you must specify the name of the component. For example:
sWindow is string = "MyComponent.MyWindow"
Open(sWindow)
No specific WLanguage function is required to handle the component.