I'm creating a custom control in OPA RN, a bit of HTML to render two text controls and it displays ok.
I've got a hidden OPA text field in which I transfer the output value of my custom control. This also works fine and when I debug I can see that OPA now has access to the value.
The problem manifests itself when I'm in the next screen and I press the 'back' button. Even though OPA still has the value, it is not displayed in my custom control.
This is my code:
<!-- Hidden OPA control -->
<input type="text" id="qs53c5845e-6be0-4afc-acb3-4df55cec99b7globalglobal1" name="qs%2453c5845e-6be0-4afc-acb3-4df55cec99b7%24global%24global1" type="text" style="display:none" class="owd-input" />
// Copy the custom control value from input2 to the hidden OPA field.
SetValue = function(newValue, controlID)
document.getElementById(controlID).value = newValue;
// Try to access the hidden OPA field and place the value in input2. This is the bit that doesn't work at the moment.
populate = function()
var v = document.getElementById("qs53c5845e-6be0-4afc-acb3-4df55cec99b7globalglobal1");
document.getElementById("input2").value = v.value;
window.onload = populate;
<!-- Some simple input controls, input2 needs to be pre-seeded with the existing OPA attribute value through the 'populate' function. -->
input1: <input id="input1" name="input1" style="width:200px;">
input2: <input name="input2" id="input2" style="width:200px;" onblur="SetValue(value, 'qs53c5845e-6be0-4afc-acb3-4df55cec99b7globalglobal1')">
The 'SetValue' function works fine and the custom control value is copied to the relevant OPA attribute.
As you can see in the code, when the form has loaded I call 'populate' to fill the custom control with the current value of the OPA object. Now I know the OPA value exists as I can see it in the debugger but it just doesn't seem to want to transfer it to the input2 control.
So I'm really interested to access the OPA value and copy it back into the custom control (input2). At the moment input2 stays empty.
Is the code you've pasted here from the source of the page (or frame)? The OPA control should either be visible or not exist at all on the page, using one our current releases, so I'm guessing you've hidden that via some code that you haven't displayed in this post? When selecting to hide a control in the Interview designer, controls shouldn't exist on a page at all if set to hide.
If these suggestions don't work or aren't what you're after, can you possibly supply a complete (not)working example policy model with the html source files you are using?