Hello! I am trying to set up a drop config Valve UDT that dynamically pass tag path from Dropconfig into a popup window that will let the user be able to change setpoints/open close the valve etc. My drop config works fine; it populates the few values perfectly but no matter what I seem to try I can’t get the values to write back properly to the PLC from the PopUp.
On whatever view you're wanting to use for your drop config (guessing it's your "Digital_Valve" view?), it should have the UDT binding to your datatype that you're using for your digital valves, and it should pass a parameter into your view under a parameter named something like "tagPath" (not a binding).
Then that "tagPath" parameter on your faceplate can be used to do indirect bindings for all your buttons or anything else you need. If you're using a majority of your tags in the UDT, you can also create a custom property that's named like "tag" that's indirectly bound to your "tagPath" directly to pull in all your tag values. Either way, make sure they're bidirectional bindings for the tag writes to work.
Edit: Your onClick event is passing the TagPath incorrectly. It should be a full tag path and linked to "{view.params.tagPath}" or something similar depending on how you named the parameter in your Valve view. You don't need the device name to be passed because it will be part of your tag path already.
So what value would I send on the onclick event? On my valve popup/faceplate I have my faceplate indirectly bound to “{View.Custom.TagPath}/AlarmAck, is this correct?
I think the root cause of your issue lies in the way you have your Digital_Valve drop config set up. You need to have a parameter named something like 'tagPath' on your Digital_Valve view. The drop config needs to use a 'path' action instead of a 'bind' action, and point to the 'tagPath' parameter. Get rid of your ValveUDT parameter on your Digital_Valve as it will slow down your view and instead use indirect bindings on your Digital_Valve view.
Your drop config should look similar to this (this is an analog input view template I created)
"{TagPath}/AlarmAck" should work assuming you're passing the path to the UDT instance into "view.custom.TagPath". Note that you have to hit the Enter key when you set property part of the indirect tag binding for it to register. Your screenshot shows the error "Bad_NotFound" which makes me suspect you need to click on the property binding and press enter to ensure it actually wrote the property. You can confirm you wrote the property correctly by reopening the binding and ensuring the property is populated.
Your other screenshot looks like you're passing a lot of properties from your UDT as parameters. You don't need to do that and shouldn't for the reasons Michael Flagler explained. Just pass a partial tag path and indirect bind everything in the popup. If you're using expressions that are looking at multiple UDT properties you can add custom properties to the view and indirect bind them and reference them from your expressions.
You may need to set your designer to read/write mode for the write to work from the designer.
You're using the "onClick" event. If you have inconsistent results with a touchscreen I would recommend putting a translucent button (opacity 0 style applied) with height and width of 100% and put your code in the "onActionPerformed" event. Make sure the hitbox is the topmost element on the view. I've seen some touch screen drivers miss click events with "onClick"
Your outer view has a UDT parameter. You need a string tagpath property there, not a UDT parameter. Your UDT, if brought in anywhere as a whole, needs to be custom property, not a parameter. Passing a UDT as a parameter obscures its origin, so you cannot easily pass its path to any inner component. And you need to, so the inner component (popup in this case) can use the string to make a bidirection indirect tag binding.
In other words, you cannot fix the popup problem without fixing the outer view's structural problem.
{ Yes, IU encourages this structure, unfortunately. It is wrong. }
Here is my popup or “Inner View”, I created a parameter called it “TagPath” and bound it to “View.Params.TagPath”, I get an error saying “[TagPath] did not produce a value”
For testing, your TagPath is blank, so everything will show an error. So you can right click one of your tags and "Copy Path" and paste it into your TagPath parameter to test out your tagging if you need to (and blank it out when you're done testing).
On your faceplate, you created a binding on your TagPath (that's trying to bind to itself), and that shouldn't have a binding at all, that's just the string parameter of the tag path that gets passed from your valve graphic to your popup. Once you remove that binding, you can either add custom properties with bindings or do indirect tag bindings on your buttons directly, but either way, those should start working (and you can paste that same tag path into that parameter if you want to test out the faceplate as well).
When testing your popup in the designer, you must provide a tagpath string in the popup view's parameter. The string should be a typical string that you expect to use. That string would be replaced at runtime (real client) with the actual string supplied by your navigation action.
In your outer view, make sure you are actually supplying a tag path string. Perhaps use system.perspective.print() to log the popup parameters to the browser console.
You guys are superstars and are what makes ignition special! Changing it from {view.custom.TagPath} to {view.params.TagPath} fixed the issue. Along with the other many changes you guys suggested. I appreciate the help!