Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: How to synchronize tables  (Read 12409 times)
FREDERIC T.
Posts: 3


« on: May 15, 2012, 02:35:25 pm »

Hello,

 I wonder if it is possible with BDL to manage the following issue?

 I want to manage an entry table with dates in abscissa (dialysis days), but also doctors (one doctor = one date ) and in ordinate the patients. (look at the screenshot in attached file)
 For each tuple date-doctor-patient,  the user can enter or not an act.
 The actions on this table are :
 - the user has not the ability to edit the patient list and the list of days (pre-defined list based on the dialysis days)
 - the user can enter the doctor and the medical consultation by selecting from a dropdown list (combobox)

 With one table I have failed to manage the column headings (multiple, dynamic and modifiable ).
 With three tables: I do not see how to synchronize column widths: they should have the same size, and if we change a column width in a table,  the columns  widths in other tables should be also changed.

 Thank you in advance for your advice.
 
Jacques Corneloup
FONDATION TRANSPLANTATION


* screenshot.png (122.55 KB, 1365x728 - viewed 1829 times.)
Reuben B.
Four Js
Posts: 1113


« Reply #1 on: May 17, 2012, 03:22:57 am »


Quote
With one table I have failed to manage the column headings (multiple, dynamic and modifiable ).

You can modify the column headings using ui.Form.setElementText, and you can have a dynamic number of columns by picking an arbitrary maximum and programmatically hiding the columns you don't need at run-time.
However you will run into problems with 1 table I suspect because the Nom ui Medecin row of the array you are going to want a different widget in use then for all the Patient rows

Quote
With three tables: I do not see how to synchronize column widths: they should have the same size, and if we change a column width in a table,  the columns  widths in other tables should be also changed.

You could set UNSIZABLECOLUMNS, UNMOVABLECOLUMNS, UNHIDABLECOLUMNS etc so that the user can't alter the columns.


My first instinct is that the solution for this is a WEBCOMPONENT solution. 

It might be an interesting exercise to go through.  Can you mock up some test data / data structures.

I'm thinking I'd need ...
a list of dates
a list of doctors
a list of codes/couleurs
a complex record to hold the info entered and displayed

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
FREDERIC T.
Posts: 3


« Reply #2 on: May 21, 2012, 08:31:33 am »

Is it possible to determine in advance the column width so that it is identical for the three tables?
Currently though I forbid the user to change the column size, column size of the three tables will not have the same width and will be slightly offset.
Sebastien F.
Four Js
Posts: 545


« Reply #3 on: May 21, 2012, 10:20:59 am »

Hello Jacques,

I suggest that we help you directly on this (quite complex) need, instead of having long discussions in this forum.
Genero has it's limits, and it's not a good idea to make tricky things, that will make your code difficult to maintain.
Maybe we can find a good compromise, by changing a little bit the GUI ergonomics of your application.
But we are willing to help you, and if possible, we can extend the product to satisfy your needs.

Seb
Reuben B.
Four Js
Posts: 1113


« Reply #4 on: May 31, 2012, 01:16:12 am »

Hi Jacques,

I'm not sure if you've been in contact with your local support center in the interim but ...

I mentioned earlier, I believed Web Components may provide a solution.  Based on your screenshot I've quickly created something that illustrates what I was thinking.  The schedule.html needs to be copied to GDCDIR/webcomponents/schedule/schedule.html (refer to Notes: section of this documentation that says where this file can live https://4js.com/online_documentation/fjs-fgl-manual-html/User/WebComponent.html#webcomp-in-forms).  You should get a picture like the attached screenshot, and if you click on any of the drop-downs in the Web Component, they change a value back in the 4gl variables.

Genero Tables/Arrays have some limitations...

- fixed number of columns (you can't have a variable number of columns)
- same widget must be used on each row for individual columns
- same widget attributes must be used on each row for individual columns
- can't do groups of columns/rows with headings/footers
etc

... using Web Components like this is one way to overcome those limitations.

Hope that helps,

Reuben

Quote
Is it possible to determine in advance the column width so that it is identical for the three tables?
The answer to that is a guarded Yes.  I did it on my first Genero migration back in 2004 but I wouldn't do it again.  The technique I used then was to pre-populate the registry with the column widths for a particular table.

So if you look in the registry HKEY_CURRENT_USER\Software\Four Js\Genero Desktop Client\Forms\<form name>\<table name> you may see the column width in pixels for each column.  We ran regedit via a frontCall to reset the column widths for a particular table.  It was a POS application and we wanted to allow the users to change the column widths as required, but we didn't want there changes to affect the next person who came along and used that same POS terminal.  That code is still going strong 8 years later but if they ever upgrade to Vista or W7, they may find that everytime that regedit frontCall runs, they get a UAC prompt, hence the reason I wouldn't do it now.

* complextable.per (0.48 KB - downloaded 1014 times.)
* complextable.4gl (7.64 KB - downloaded 941 times.)

* complex_table_screenshot.png (79.36 KB, 1347x338 - viewed 1803 times.)
* schedule.html (2.03 KB - downloaded 946 times.)

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Rene S.
Four Js
Posts: 112


« Reply #5 on: May 31, 2012, 09:33:14 am »

Yes, you can take a sledgehammer to crack a nut.

Or you can try to keep your programs simple and use 4gl. See the attached sample.
- use two tables: one table for doctors and there "operating times", and another table for patients and there therapy/medicaments.
- Even this sample can be simplified: There is no need (from my perspective) to change the header of the patients table dynamically.

Jacques, when using 4gl you should learn an important lesson: never try things not possible with 4gl.

A word about web components.
- the "web component" can be a simple solution if a company byes a java-script library fitting there requests to render some special data in a prober way. An ("the") example are business graphics. 
- the "web component" is not and has never been designed for replacing Tables, Lists, Edits ... by a home-brewed solution.
- the usage of "web components" for screen interactions is a clear misusage: you will lose all the advantages of the existing screen-interactions.

I would never suggest you the usage of web components to solve your problem.

 


* sample.png (34.76 KB, 690x365 - viewed 1830 times.)
* sample.tgz (9 KB - downloaded 913 times.)
FREDERIC T.
Posts: 3


« Reply #6 on: May 31, 2012, 02:53:47 pm »

Hello Reuben and René,

Indeed, I have contacted support (Sebastien Flaesch).
Thank you all for your advice and for the time that you have spent.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines