Displaying a field twice

FRW

Well-known member
I want to display a select single field more than 1 time, because I want to seperate the information coming from the lookup table and the linked fields.

How to do? If I add another field to the DB I had to put a (maybe different) value in it, but I only want to show excisting data.
 

eugenio

Administrator
Staff member
Hello,
maybe you can use a view to replicate the field but can you describe the exact context? I don't understand why you need the field twice, if you provide the details I can understand better your final goal.

Best
 

FRW

Well-known member
I've made a view where I join two tables. In this view f.e. I have a customer with an address (street, telefon, a.so.)

Within the DB I created a field "customer_view" and with the formconfigurator I make this field to select_single and the view as lookup table for this field. I know, that I can add linked fields, to show the information belonging to the selected customer, as street, telefon... and to configure the seperator in the config.php. This will be shown in display within a single information f.e. "Hans Meier - Rathausweg 4 - 0049 431... - Kiel"

My wish for the display is to select the customer and show the belonging data at a different place in the display-form (for this I had thougt about showing this field "twice" and change the linked fields...)
 

eugenio

Administrator
Staff member
Hello,
if I have well understood, I don't think there is a solution to this. If repeat a field twice, you have to set it twice when you edit it.
Probably a (not very elegant, but working) solution could be:
- you add as many customer_view (customer_view_1, customer_view_2 etc) fields as you want in your table
- you show just one of the field in the insert/edit forms
- you show all the fields in the results grid and details page
- you add an after insert and after update hook that update customer_view_2, customer_view_3 and so on to the value of customer_view_1 after any insert/update

This should work if you ONLY use DaDaBIK to insert/update data on that table.

Best,
 
Top