I am stuck with my Sort dropdown.
I need Sort dropdown data to update both when
writing a value to my sort dropdown from on a copy button event script
and when choosing a different line to filter the Sort dropdown options.
Sort dropdown options are bound to a query that uses Line to filter the options.
I attempted using a change script on the Sort dropdown sets the self.props.value to 'Select...'.
Without the change script,
if I pick a line, pick a sort, and pick a line again without a change script
then the Sort dropdown shows 'Select...' and data is not updated.(retained from previous)
With the change script,
if I use a copy button to write to a value to the Sort dropdown while there is a change script
then the Sort dropdown shows 'Select...' and data is not updated.(retained from previous)
You mention the dropdown data, do you mean the selected value or the list of possible values(Dropdown Options)?
How are you selecting the line? Another dropdown? A button? If either of those two, put a script in the onActionPerformed
event of that component, and have it set your filter dropdown value to default. Have it check to make sure that the newly selected line is different than what is currently selected so you don't reset your filter by accidentally selecting the same line.
1 Like
I select the line as a dropdown.
I will try to rewrite it this way for clarity.
Without the change script,
if I pick a line, pick a sort, and pick a line again without a change script
then the Sort dropdown shows 'Select...' and references to the value is not updated.(retained from previous)
With the change script,
if I use a copy button to write to a value to the Sort dropdown while there is a change script
then the Sort dropdown shows 'Select...' and reference to the value is not updated.(retained from previous)
I can only seem to get picking the line to work as intended or writing to the property from a script to work properly when I use a change script or don't use it.
I need a way to make both work.
Just want to confirm I understand the expected interaction flow:
Interaction A: Operator(user) selects line, then selects item from filter. Operator then changes line selection and filter selection resets.
Interaction B: Operator copies Line and Filter selection from somewhere else (via Copy button) and the Line and Filter selection are changed to values sourced from this 'copy' action.
Do I have these interaction flows correct?
Have you confirmed that whatever value you are passing to the dropdown exists in the options returned from your query? Are your line selection value and filter selection bound to anything?
1 Like
Yes.
A: without the change script, doesn't work right
B: with the change script, does work right
My queries working.
The updating of them is working conditionally I think based on my setting of the value and if I use the change script.
My line selection is not bound.
It is a regular dropdown with options typed in.
Line dropdown is used in Sort options
Sort is used in the pallet weight.
From my Sort binding, query, and when I try the change script



I might try a script instead of a query, and have the script do the querying Monday.
I prefer the query because it is faster I think with less gateway overhead I think.
A query binding is probably (definitely?) less overhead than a script (I'll wait for pturmel to jump in and confirm/correct me)
I don't think anything is wrong with your query, is there a reason why you are setting this hardcoded "Line" to a value of "Select..."?
You mentioned the sort value is being used in the pallet weights, are you handing the selected value from the sort dropdown to another query to fetch the weight? Or is the weight data contained in the query you are using to populate the sort options?
I would still recommend doing this:
on the Line selection dropdown and get rid of the valueChanged script on the data property of the sort dropdown.
The problem you are probably running into is that the change script is overwriting whatever value you are transferring into the filter value when using the copy button. The query will take longer to execute and set the data value than it takes for your copied value to come in. So your copied value is put in, only to be wiped by the valueChanged script.
By utilizing the actionPerformed
event of the Line selection dropdown, you are guaranteeing that the filter value will only be set to default on user selection of a line via the dropdown.
1 Like
Thanks for hanging in there with me.
I see what you are saying.
The submit button writes sort to default from a script and works with the change script.
So therefore if the line dropdown writes sort to default from a script, then it would also work with the change script. OnActionPerformed is the way to run that script.
Tested and Sort values worked great. Thanks so much.
1 Like