|
FOROS PROFESIONALES WINDEV, WEBDEV y WINDEV Mobile |
| | | | | |
| New user question on Combos & tables |
| Iniciado por guest, 07,oct. 2015 04:15 - 4 respuestas |
| |
| | | |
|
| |
| Publicado el 07,octubre 2015 - 04:15 |
Hello all,
I am using the Express version to get a taste of WinDev and want to get an idea on how to:
- change the contents of a table based on a selection made in a combo box (both in same window).
The combo box reads from a file called events. The file contains an EventId and a Name. The table reads from a file called EventLocations and contains fields called EventId, LocationID, and Location. I want the table to show only those locations that have the same EventId as selected in the Combobox.
I am lost ... I am very familiar with Clarion, but cannot figure it out in WinDev.
Also are the printed manuals more descriptive for people needing a jumpstart? I thumbed through the tutorial examples and printed matter and don't see much written on this topic and I imagine a bunch of others. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 07,octubre 2015 - 12:05 |
Mark How are you filling the table?
If you are data binding directly to the EventsLocation file then check out HFilter and ..Filter in the help.
My preferred method is to use a query to fill the table then in the combo 'on selection' Set the query param - MyQuery.param = idfrom combo followed by ListDisplay(MyTable,taReExecuteQuery) |
| |
| |
| | | |
|
| | |
| |
| Publicado el 09,octubre 2015 - 04:45 |
I was filling by the table, but am now trying the way you are suggesting. Do I need to create a variable called param, or do I refer to the name of the field in the query I want to compare to? i.e.
MyQuery.param = idfrom combo becomes ...
MyQuery.Location.EventID= Combobox
where combo box returns the value Events.EventID |
| |
| |
| | | |
|
| | |
| |
| Publicado el 09,octubre 2015 - 10:27 |
Hi
MyQuery.Location.EventID= Combobox
In the combo box you can set what it returns ( 7 tab s)
For this kind of thing I use "internal queries" for the table. In the ini code of the table you can then place the code of the querie
mysource.parameter = combo
In the combo you can then put code to refresh the table:
tabledisplay( tablename, tainit) The tainit will run the initiation of the table
regards
Allard |
| |
| |
| | | |
|
| | |
| |
| Publicado el 09,octubre 2015 - 10:39 |
Mark On the assumption you have 2 queries. 1. qryListEvents - for the combo 2. qryLocationByEventID - for the table, this will expect the parameter pnEventID.
Bind the combo to the qryListEvents, in the Description\Content tab set the 'Stored item:' to the EventID.
You will find that WD usually offers a number of ways to achieve a result so you do have options.
You can declare a variable (in the global declarations of the window) say 'wnEventID is int' In the Description\Link tab select this from the Variables\SimpleTypes
In the 'Selecting a row' code block of the combo you can then use this variable qryLocationByEventID.pnEventID = wnEventID TableDisplay(EventLocations,taReExecuteQuery)
If you have not used a global variable then qryLocationByEventID.pnEventID = MySelf will suffice to set the parameter.
You may of course place this code in a local procedure say 'lpEventOnSelect' called from the 'Selecting a row' code block In this case then MySelf will not operate correctly so you need qryLocationByEventID.pnEventID = cmbEvents or (belt and braces) qryLocationByEventID.pnEventID = cmbEvents..StoredItem
HTH |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|