Is it possible a searched combox effect?

Dear Mr Maarten,

I refer to Your dynamicValuelist.

Suppose that i have to use it in a form whose name is orders :

  1. After i have clicked the button A, and I see the filtered Valuelist in companyValuelist,
  2. I want to select, with the mouse, the companyname “Antonio Moreno Taqueria” and,
  3. I want that the cutomerid, companyname, address are inputed in 3 field that i have created in the same form(orders) of name customerid_selected, companyname_selected , address_selected. The fields appartain to the table order.

How have I to do?
Please could You write code?
Tanks in advance
Gianni Pinna

see attached solution

1)created columns
-selected_customer_id
-selected_company
-selected_contact

2)attached the valuelist to selected_customer_id

3)created a relation selected_customer_id<>customer_id

4)set column property of selected_company and selected_contact to auto enter lookup values based on relation selected_customer_id<>customer_id

NOTE: I did a selfjoin here just for showing “how to”.
In your case you will probably build the lookup relation like
orders.customer_id<>companies.customer_id

Dear Mr Maarten,

tank You very much, for Your “wisched” work. I am going to download an to study it.
Compliments

Gianni Pinna

Dear Mr. Maarten,

I downloaded and executed Your solution. The result is perfect. But after the values are auotoentered in select_company and select_contact, if i click on “New Record”, i see :

Error
cannot save Form.

Details
com.sybase.jdbc2.jdbc.Syb.SQLException::ASA error -193:Primary key for table ‘customer’ is not unique ASA error -193:Primary key for table ‘customer’ is not unique.

Sure You will discover ty wy.

Best Regards
Gianni Pinna

Ejemplo de automata 001.pdf (61.1 KB)

yeah, that’s the (stupid) datamodel from the MS Northwind database.
The customers table has a text field as Primary key and no sequence linked to it.

You’ll have to use a database tool to change the primary key of the table.
If your not familiar yet with database tools, I’d say forget about this for now, and create your tables and columns from within Servoy.

Main thing is that you understand the example in order to adapt it in other solutions.

Dear Mr Maarten,

tanks again for Your prompt reply. My work will be exactly in accord to Your specifications. They are precious for me.

Best regards


Gianni Pinna

Dear Mr. Maarten,

According to Your application and specifications, i made a solution with two related tables: orders_to_customers.

But if i use as primary Key selcted_customerid anf foreign Key customerid, and theese keys are of Type INTEGER and servoy seq, i do not have whished effect.

If i use, as You used, keys of type TEXT, no proplem. But in this case the problem is that i need INTEGER and seq servoy keys.

Does a solution exist?

Tanks in advance


Gianni Pinna