How can I configure Popup propmpt for push button in PG2?
Hi
What is the requirement is if I click on push button one popup prompt should appear, and there will be 'Ok' and 'Cancel' button to execute the proper operation as required.
In VB graphics it is possible to write code for the popup prompt using 'MsgBox'.
But in PG2 graphics I am not abale to create such confirmation popup window.
Whether it is possible in PG2?
Ritwik Pradhan
ABB India
Voted best answer
It is possible.
Right-click pushbutton in PG2 item tree and select Add Item Hosted Input Item -> Popup Menu.
Then configure Popup Menu Item for 2 number of entries: for 'OK' and for 'Cancel'. Specify proper paramepers for Entry1Name and Entry2Name and you're done.
Answers
it is possible to call one faceplate from other faceplate, so one way to do that is to create one faceplate that have one button, if someone click this button appears one new faceplate with buttons that you mention ok and cancel.
I used this for one customer and work fine.
Can't attach file in comment so I post it as a new answer:
You do not need to specify value for the push button in this case. Keep value property is "empty".
Instead you need specify that value in the property writer that must be called from Item1Name (OK).
Example: suppose the target name is "Your_Target" and it's boolean type.
Add two propery writers for your graphic display: right-click in the item root and select Add Element Item Hosted Input Item -> Property Writer.
By clicking "OK" from popup menue we want to write to the target TRUE if initial value is FALSE and vise versa.
Also, we need avoid writing if target is read-only. Then change the properties of property writer as follow:
Enabled = Your_Target#IsWritable
Event = OnDemand
Name = PW_OK
Target = Your_Target
Value = !Your_Target
Ok. Now switch to the popup menu and set up Item1Name and Item2Name as follow:
Entry1Name = ItemEntry("PW_OK", "OK", True)
Entry2Name = ItemEntry("anything", "Cancel", True)
See example in the attached afw (for 800xA 5.1).
P.S. This is just an example to let your know how to call popup mene and write a value.
I'm sure I had miss something and you must debug and improve very well before put into operation.
Good luck.
Source:
Add new comment