66
Views
8
Comments
Combo box to fill in input boxes
Application Type
Traditional Web

1. I have a combo box that stores names which works and all the names are showing, which are coming from the database

2. My input fields are: address, state, city, phone number, sales order, PO orders.

3. My issue is when I select the name from the combo box it is not filling in the input fields in the form. 

5. In the preparation I pulled in getcustomer and use a filter CustomerID = customerID



2021-07-14 09-27-33
Luís Cardoso

Hello Tom,

Are you filling the form with a result of a query?

If you are doing that, you need to call a action on Onchange property of the combo and do a query refresh and ajax refresh of the form. That should works. Can you try it?


BR,

Luís 

UserImage.jpg
Tim Roscoe

I do have a onchanged action with my combo box.

I am using a input parameter for the combo box. 

My combo box is in the action of the template.

My form is in the main part of the template.

The database  is the entities of  out systems but I did not think about trying to query it.

I have not used out systems in a while and I have forgotten a few things.

2021-01-19 14-07-32
Tom Zhao

HI Tim

Luís is right, you have to call ajax referesh action inside onchange action.

Can you share the oml file or some screenshot for detail? So we can look into it.

Kindly Regards

UserImage.jpg
Tim Roscoe

I try to cut this down and make it simpler with two input boxs

The database is the Entities from Outsystems
Custom
Id
Name
Age
NameId


1. Combo Box  (The combo box works)
 input parameter: nameId

OnChange -> Ajax Refresh


2 Form: GetCustomById.List.Current
       input box: GetCustomById.List.Current.Custom.Name
 input box: GetCustomById.List.Current.Custom.Age


Preparation -> GetCustomerrById

using filter nameID = Customer.Id

2018-10-29 08-31-03
João Marques
 
MVP

Hi Tim,


In Traditional Web, forms need to be explicitly binded. That means, that on your NameID action, after the refresh query, you should add an assign <Your Form Name>.Record = output of the query and after that have an AJAX Refresh of your form. You can remove the first AJAX Refresh you have there.


So, bottom line, your action should have the following flow:


1. Refresh query GetCustomById;

2. Have an assign <Your Form Name>.Record = output of the query;

3. AJAX refresh your Form.


Hope it helps.


Cheers,
João

2021-01-19 14-07-32
Tom Zhao

Hi Tim, 

Your sequence of the action is wrong, You should refresh the data firstly, then call ajax refresh.

Kindly Regards


2021-11-19 11-12-44
Rui Mendes

Hi Tim,

From your image I see that you refresh the screen before reading the data, so you should do the reverse, read the data and then refresh the screen.

UserImage.jpg
Tim Roscoe

Thank you all your help. It works. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.