Drop down did not update value

Hi,

I have a dropdown inside the table row. All other field update with new values but Dropdown value did not updated. On Dropdown change item it is not updated.
"compatibility": row["COMPATIBILITY"], is dropdown. the field name is correct.

def runAction(self, event):
		    
	table = self.parent.parent.getChild("Table_0")
	table.commitEdits()	
	data = table.props.data    
   
	for row in data:
		system.db.runNamedQuery(
		"gestione_produzione/Consumption/Update_tableMpDefine", 
		{
            "description": row["DESCRIPTION"],
            "compatibility": row["COMPATIBILITY"],
            "itemId": row["ITEMID"]
        }
        )

All your script there is doing is firing off a named query.
If you're displaying the results of whatever that named query is updating somewhere else in your session, you would have to poll the database for results to see any updates.

I am sorry i could not undestand.
Here i can share the data when click the save button we have in table.props.data is as below.
You can see the DropDown did not change he value.

[{"COMPATIBILITY":"P","DESCRIPTION":"CATALIZZATORE AMMINICO POLIFUNZIONALE PU ESPANSO 1 (PUR)","ITEMID":"MCATAMMI0102","bit":"P"},{"COMPATIBILITY":"","DESCRIPTION":"CATALIZZATORE AMMINICO POLIFUNZIONALE PU ESPANSO 2 (PIR7","ITEMID":"MCATAMMI0103","bit":""},{"COMPATIBILITY":"K","DESCRIPTION":"CATALIZZATORE AMMINICO DI BLOWING PU ESPANSO (PIR)","ITEMID":"MCATAMMI0104","bit":"K"},{"COMPATIBILITY":"","DESCRIPTION":"CATALIZZATORE ORGANOMETALLICO PER PU ESPANSO (PIR)","ITEMID":"MCATORGMI0101","bit":""},{"COMPATIBILITY":"I","DESCRIPTION":"CICLO/ISOPENTANO- DENATURATO 70% / 30%","ITEMID":"MESPMIX02001","bit":"I"},{"COMPATIBILITY":"A","DESCRIPTION":"CO-ESPANDENTE PU A BASE H2O 40%","ITEMID":"MESPMIX03001","bit":"A"},{"COMPATIBILITY":"","DESCRIPTION":"CICLO/ISOPENTANO- PURO 70% / 30%55","ITEMID":"MESPMIX05001","bit":""},{"COMPATIBILITY":"V","DESCRIPTION":"PMDI FUNZIONALITA’ 2,6 PER PU ESPANSO","ITEMID":"MISOMBF00001","bit":"V"}]

Did you add a custom method to the table called commitEdits, or is this an LLM hallucination? There's no such function on the Perspective table:

If you didn't add a custom method by this name, then your script is failing on this line and never even attempting to run your named query.

This was a solution Chatgpt said. table.commitEdits().
It shows error also but while pasting code i forget to delete this.
Thanks for helping i will go through the link and let you update if got the solution..

You didn't say so in your OP, which is required by this forum's rules (in the FAQ). LLMs make so many mistakes with Ignition that this "heads up" helps us help you. (Or ignore you, because the LLM problems with Ignition are so frustrating. Consider learning to write your own code.)

2 Likes

Thank you for your advice. I understand your perspective. Could you please help me with using a dropdown as an inline column? I’m currently using it, but the column data isn’t updating.

This is my best guess as to what might be going on, but you're providing virtually no information about your actual setup. All we can do is guess unless you provide more information about what you've actually got set up.

The expected implementation is to implement the table's onEditSomething actions, passing fresh changes directly to the DB as you go. After each, you must use the table components .refreshBinding() method on props.data to update the display.

Hi,

I’m using a message handler. In the DD change event, I call the table message handler and update the row with the new data. This approach works well and also gives me the opportunity to extend it with more functionality.

Thanks a lot paul-griffith & pturmel for your support and advice!