Configurator - Changes to one combo box changes another?

This make no sense to me but it’s very reproducible so there must be a reason. Changing the value of a combo box changes the values of other combo boxes on the page. There is no code in the events. Here is how to reproduce the problem:

  1. Add two combo boxes to a page
  2. Setup a BAQ to populate the list items. In my case I have one BAQ that takes an operation ID as input and returns resources associated to the operation.
  3. Set box 1 to the second item in the list.
  4. Set box 2 to the any item in it’s list.

You will see combo box 1 change it’s selected item to the first item in it’s list. What is going on here?

This problem occurs even if only the first box is dynamically populated from a BAQ and the second is left to default values, i.e. “Item 1”, etc.

the reason is because if the first combo box is used as a criteria for the second combo, the combo will automatically update the available values. This is a basic function of dynamic lists.
so… if you have combo 1 that asks “Which manufacturer:” (options are “Acme”, and “RFPaint”), and then a second combo that shows all the “Colors” that are available… the color combo could be filtered by supplier, and only show options available for Acme when you choose acme. If you then go back and choose RFPaint, it re-filters the combo automatically, which will then “change” the value because it is no longer valid.

I understand that there may be a scenario that would warrant that functionality. All I want it to do is, independently select options so my Configurator Rules can include the proper operations, standards and materials. My BAQ is querying which standard should be included with the selected operation. I don’t want any selection made by the users to change the selection anywhere else in Configurator.

I have a form with about half a dozen drop down boxes that are populated by BAQs. When I change any one of them, they all change. How do I prevent this?

So that second combo doesn’t need to be a combo. Make it a Label or R/O Text. Then use the OnFieldChange event of Combo1, using LINQ code to set the value of that Label or Text.

That is not the problem. I have half a dozen drop down boxes on the same page that are not related to each other. Each drop down corresponds to a different operation. If I change one standard for operation A, all drop downs for all other operations are reset to the first selection.

Also, it appears that OnFieldChange will only fire on the first selection of the drop down if populated by a BAQ. After that first selection, OnFieldChange will not fire again.

Here is an example of what it looks like…
image

If the Input Value of the Combo doesn’t change the event won’t fire. On the BAQ Setup sheet, the “Input Value” is misleading. That’s not a value input to the BAQ. Its the value that the Input control (epiPcUltraCombo1 in my case) will have.

For example: A Combo with a Dynamic List of BAQ

image

This controls value will be mfg regardless of which entry I pick on the combo. Because the WarehouseCode is mfg on every row of that BAQ’s result.

Adding an OnFieldChange of
MessageBox.Show(Inputs.epiPcUltraCombo1.Value);

And that only fires the first time I pick a row on that combo. Because it goes from <blank> to mfg. When I pick another row, it is still mfg, so it hasn’t changed.

So if changing the selection in a drop down box does not fire OnFieldChange, then I can’t copy the selection during OnFieldChange to populate a textbox or label.

Note that when using a statically populated drop down box, OnFieldChange will fire every time a selection in the box is changed. This mean that OnFieldChange is not consistent when used with a drop down box. It functions differently depending on how you populate the box. Not good from a design perspective. I am stuck with functionality available though.

Is it possible to use a User Defined Method to query the standards for an operation, return a string array and populate the combo boxes manually in On Loaded? If so, can you point me to an example of how to do this correctly?

Try adding a MessageBox to the OnFieldChange event. Then test it by:

  1. Test the form, and select the first item on that controls list. You should see that control’s value. Take note of it.
  2. Close the test form
  3. Launch the test form again, and this time select the 2nd item in the control’s list. Was the same value displayed as was shown in the first step?

Post a screen shot of the Dynamic lists Editor window for each of those two Combo’s. Make sure to also grab a shot of the BAQ Criteria tab for each, And the “C# Condition” code (if set).

Here you go…
image




From the 2nd and 3rd picts, it appears that this Dynamic list is populated from the BAQ cGetListOpStdFromOpCode; WHERE OpStd.OpCode = SHT.

So every row of that baq will have a value of SHT for it’s OpCode column.

Now you’re setting that combo’s value to OpStd.OpCode (which is always SHT), so it never changes when you pick a different row.

Change the Input Value from OpStd.OpCode to OpStd.OpStdID

image

1 Like

That was a long walk. Thank you!

You could also set it to OpStd.Description. Then Control’s value would match the text displayed.

Good to know. I was getting the text from Control.SelectedText.

Is there a way to make a field as client side only? Meaning I don’t need the content of every field sent back to the server and I want to be as efficient as possible.

If the field isn’t driving any dynamic fields/lists, then I don’t think Changing a field sends anything to the server. At run-time, every field’s value is saved (sent to the server) when the configurator saves via a “Save”. This is so the values can be used in Configurator Rules.

Make a test by adding a combo to a configurator, and running it with trace enabled, to see if there’s any traffic just from changing the selected field.

And maybe you already know this, but if you have a Dynamic List - with a single list - whose C# Condition is "return true;", it should only contact the server once, when the form loads.

If you have a BAQ Criteria connected to an control on the configurator, that will cause the BAQ to be executed again when that control changes.

Another time this BAQ would need to re-execute, is if you have several Lists (all in the same Control), and one of the other lists is required - because the C# Condition for that list is met.

Make Sense?