Binding text of one window to another window

Do I need to share save button script too?

that looks like the save button code already.
and ple use performatted text press this button before posting the code
image

in popup view it is still displaying default value …not passed value from main view :upside_down_face:

ah yes they will only be passed through if you open the popup through the script. Which you can only do in runtime xd
Try running it in the browser and open the popup there

1 Like
com.inductiveautomation.ignition.common.script.JythonExecException
Traceback (most recent call last):
  File "<function:runAction>", line 32, in runAction
java.lang.Exception: java.lang.Exception: Error executing system.db.execSProcCall()

	caused by org.python.core.PyException
Traceback (most recent call last):
  File "<function:runAction>", line 32, in runAction
java.lang.Exception: java.lang.Exception: Error executing system.db.execSProcCall()

	caused by Exception: Error executing system.db.execSProcCall()
	caused by ClassCastException: Error trying to coerce 'value' to a number.

Ignition v8.1.9 (b2021080617)
Java: Azul Systems, Inc. 11.0.11

      ```

but i am getting error on console plz help /error has been shared

not even running on browser aftr opening popup.
and on console i m getting belowerror after erasing default string “value”.
now empty string is being passed
`com.inductiveautomation.ignition.common.script.JythonExecException
Traceback (most recent call last):
File “function:runAction”, line 12, in runAction
ValueError: invalid literal for int() with base 10: ‘’

caused by org.python.core.PyException

Traceback (most recent call last):
File “function:runAction”, line 12, in runAction
ValueError: invalid literal for int() with base 10: ‘’

Ignition v8.1.9 (b2021080617)
Java: Azul Systems, Inc. 11.0.11
`

welh yes you will have to provide a number here.

Are you testing this in the broswer?

The main problem however seems like that your popup doesnt get the params so can you provide the code that openes the popup.

Yes, I have tested in browser too …nothing is happening …the popup just blinked once after clicking on yes/proceed button.
below code in which i have added params which gets values from text field and then assigned to variable so I have mentioned variables here
system.perspective.openPopup("PopupScreen/ConfirmationPopup",'PopupScreen/ConfirmationPopup', title="CONFIRMATION!", modal="True", backgroundDismissible="True", params={"LotId":LotAutoIdResult, "MatlName":vMatlAutoId, "SourceLoc":vSourceAutoId, "Qty":vQuantity, "DestLoc":vDestinationAutoId, "Remarks":vRemarks

The confirmation popup?

or this one? as its normal here since you are closing it again

You only copied half a line here thats not very usefull xd

oke so to help debugging why dont you do this

params = {"LotId":LotAutoIdResult, "MatlName":vMatlAutoId, "SourceLoc":vSourceAutoId, "Qty":vQuantity, "DestLoc":vDestinationAutoId, "Remarks":vRemarks ...} 
system.perspective.print(params) 
system.perspective.openPopup("PopupScreen/ConfirmationPopup",'PopupScreen/ConfirmationPopup', title="CONFIRMATION!", modal="True", backgroundDismissible="True", params=params)

i am talking about this below popup which blinked aftr clicking on popup button

I removed closepopup from script then got save msg popup but data not got saved into database.

as per your suggestion to debug, i did and below o/p got in console:
'MatlName': 22957L, 'LotId': 4, 'SourceLoc': 2L, 'DestLoc': 3L, 'Remarks': u'', 'Qty': u'1000'

I guess, i am nearest to the solution coz of you thanks a lot :slight_smile:

L stands for "long", which is not the same as integer. Im not sure if the db has any problems with it though.
You could put int() (ex: int(vMatlAutoId) ) around all the integer variables just to be sure.
Though even better is to do this in the accept button itself call.registerInParam("@pLot_Autoid", system.db.INTEGER, int(LotAutoIdResult))

im guessing you are making the same mistake as with the accept button which is you are closing it right after calling it.
dont do this:
system.perspective.closePopup("")

1 Like

Thank u so much for your help.
now data is getting saved into database as expected.
I have removed closepopup from script
one more thing, if you could help then plz
the saved data should get updated into table component as well which is in main view so i am unable to add table props from popup view …as we use table.refreshbinding(“props.data”) to refresh the table but how to do in this case by passing param of table as well?

you can not do that by passing down the param of the table.
to refresh you will have to send a message in the save button and handle the refreshbinding(“props.data”) in a message handler in the main view

something like

system.perspective.sendMessage("refreshTable") on the button
and then on the table

2 Likes

Just a question: where do all these "v" variables come from? (vQuantity etc.) where are they set from? you haven't shown that in your posts that I can see

1 Like

You are a genius. Thanks a lot for your help. this is what I wanted :slight_smile:

Thanks for your reply! the problem has been solved
Now pending is to refresh table component which I am gonna follow as per @victordcq reply
and will confirm once done
Thanks to all for your replies:)

@victordcq
done as per your suggestion but data not updated on the table component (view 1)

this is on save button view 2:

system.perspective.sendMessage("refreshTable")

am I doing any mistakes?

the scope page should be checked

i have done the same param process for the below lot number value to pass from view 1 to view 3 and the output is correct

system.perspective.openPopup("PopupScreen/NewLotEntryPopup",'PopupScreen/NewLotEntryPopup',title="New Lot Entry", modal="True", backgroundDismissible="True", param={"LotnewId":vLotNo})

Here, whatever value I am passing in param lotnewId getting passed to lot number’s text field

but the issue is, it’s not working on browser, the “testm” not passed from view1 to view3