Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 6 Monaten, 4 Wochen
Letzter Beitrag:
vor 6 Monaten, 3 Wochen
Beteiligte Autoren:
Scott Daughtry, GuenterP, Ola, Allard, Paulo Oliveira

RAD with relational tables

Startbeitrag von Scott Daughtry am 20.01.2017 14:36

Good morning all,

Thus far in my WD21 learning curve I've only created non-relational applications. Now I need to create one with 3 related tables and don't know what is ahead of me. I use the RAD pattern to generate the generic windows + add/edit/delete code; in my previous (Clarion world) the RAD would generate the same - the Form window for the primary table would have tabs for each of the children tables with the requisite add/edit/delete buttons to add related records in the children tables.

Also in my previous world, it was very easy to display the parent/children table listboxes onscreen - when a new record was selected in the parent listbox the related children listboxes would refresh to show related data. Making this work was only 3-4 mouseclicks within the template extensions.

I looked through the majority of WD21 example apps to see if something is provided 'in the box' to dive into and see how WD21 handles this common requirement - and came up empty. The question is did I skip over a sample PC Soft application that shows the Windev way of doing this, and which sample app should I be playing with to learn?


I don't know how clarion works but check the type of windows created by rad in the help.

probably the Form with linked table or the Table with linked table can solve your problem.

von Paulo Oliveira - am 20.01.2017 15:21
Hi Scott Daughtry,

If you do the tutorial you will see how easy itis to do this in windev.

Do not use the rad. create the screens yourself is better is my opinion

With filetoscreen() and very few lines of code you can get exactly that functionality.

If you do the tutorial. it will save you time in the long run. Just do the tutorial it will give you insight in how wlanguage works .



von Allard - am 24.01.2017 00:14
Hi Paulo/Allard,

I ended up creating an empty window, added the tables and inserted the code into the primary table's embed for selecting a new record to then execute the filters on the 3 related tables.. took me some trial and error but now it works like a champ and I've documented how I did it in my Onenote repository :)

Kind of went through the same gyration when figuring out how to link the parent/child tables when adding child records - in other languages that I've used the engine handles all of that behind the scenes - with WD I added code to grab the unique integer for the parent table and assigned it to the matching integer in the child table if a record was being added. Some trial/error/colorful language for a little while but now works like a champ and added to Onenote :)

Thank you for pointing me in the right direction - I appreciate it :)

von Scott Daughtry - am 24.01.2017 15:11
Hi Allard,

RAD11 gives a good framework to make applications with windows of similar look. Customers don't love and will never love applications with windows of differing layouts and differing ways of usage.

Carving single windows out of nothing may seem to be easy if a project contains 30 windows or less. But. Commercial applications do contain many more windows. My smallest commercial program uses 27 data files and 184 windows. So, multiply the number of files by ~7 to get an idea of the size of the final product. I'm sure, it would work just as fine with 130 windows, but that's a minimum. For each window calculate 2 days of work. This gives you an overall estimate of the time needed to make, test and debug and document (includes to prepare a help file) the project. So, 184 windows do need ~368 work days. Putting Saturdays, Sundays, holidays and vacation into the calculation (230 work days per programmer net time / year) you will end up with about 1.6 years to finish and deliver the product. At about 50 Euros / hour (for a freelancer, as an example) this will result in 18.000,- Euros of total cost, multiply by 2 in order to get the end price for a "single customer product" = 36.000,- Euros excl. VAT.

True, there is a new RAD which one - probably - could prepare to do the same like RAD 11 does. Quite some time ago I invested a day of hard work into a new RAD pattern but ended up in nowhere-land. Maybe, I didn't understand it too well, maybe it takes a week or a month to prepare. I gave up. Partly because RAD11 already does what we need anyway.

von GuenterP - am 24.01.2017 15:59
Hi Guenter,

Reading between the lines of your excellent post, I agree that the WD RAD needs an overhaul... as a new WD programmer I rely on the RAD to generate the repetitive coding/window generation that is time consuming. I've noticed that each of the RAD-generated apps that I've created so far with WD21 that listboxes don't refresh properly and/or don't automatically highlight the added/edited database record in the listbox.. it is things like this that have me chasing my tail and burning up time that could be spent doing other things.. and RAD is supposed to let me know worry about things like this . Different example - one of the RAD windows that I tried to generate two days ago, after I answered all of the questions on what it was supposed to do/look like (e.g. yes, the user can add/edit/delete entries) then generated my new listbox window but didn't create the Add/Edit buttons. I copied them over from a different RAD window manually... not a showstopper, but something that leaves you scratching your head .

von Scott Daughtry - am 24.01.2017 16:42
Hi Scott,

ok, since I'm using RAD 11 for years now I do know each and every problem you can run into with it. I even wrote a cookbook for our guys - in German and for in-house use strictly. No, the refresh of combos is not done automatically, you have to do that in the "Gain Focus" event of the window yourself.
[attachment 2276 RefreshComboBoxes.png]

We have some windows with twenty and more combos to refresh, all is done here.

von GuenterP - am 24.01.2017 17:05
Hi Scott,

Clarion knew how to do a real RAD. Windev doesn't have the faintest idea of it. They have done a half-baked "RAD" only to be able to list it as one of their major properties. Don't waste time with it (like I did for many years). Clarion RAD is "two-way", as it should, Windev RAD is one-way only - no good. At least the "old" Windew RAD was one-way. I tried to have a look at the new one too, but couldn't get the head nor tail of it. Maybe I'm just dumb, or it is not up to my requirements.

Use the templates instead. They are good in Windev, and actually behave like a kind of two-way RAD. When you do a change in the template, it will effect all windows based on it, but does not destroy anything that you have built manually in the template-based windows.

First create good "prototypes" for different types on windows; tables, forms, maybe also tableforms and formtables etc, then make templates of them. Then, when you new window, you just select the proper template for it.

Considering the "lookup" fields; Windev cannot do them like Clarion did. I do them manually, but use indirection as much as possible -- then it is easy to copy them over and over again. Or you can also make control templates for standard type of controls.

Best regards

von Ola - am 24.01.2017 19:23
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.