Posting back to Metastorm 9 from an external ASP.NET page hosted in an iFrame
In version 7.6 I was able to use the following code from an external page to post data back into Metastorm
parent.top.frames('eFormContents').document.getElementById('FIELDNAME).value = NEWVALUE;
In version 9 when I test this with an alert it shows me the value being updated, but I do not see it update on the form and am then unable to take action against the new value.
The interesting thing is that the following click action does work
parent.top.frames('eFormContents').document.getElementById('BUTTONNAME').click();
Anyone doing a similar function and have it work in v9?
Comments
-
In M9, there is no longer the Metastorm element name and HTML id atribute the same. HTML ID is concatenated Metastorm name and some suffix, depending on element type (text, datetime, memo etc). But generated HTML is much more complex than that, so I wouldn' recommend to hack it. But if you will try, Firebug addon (or simillar in other browsers) can help you with that.
0 -
thanks. Worked this out with Tony Wheeler in support today:
In v7
If you made a field memOnDemandData
You could post back to it with the following
Parent.top.frames('eFormContents').document.getElementById('memOnDemandData').value = "DeShoran Smith";
in v9 the name of the field only represents the Span so to actually post back or read the text the following is now needed
Parent.top.frames('eFormContents').document.getElementById('memOnDemandData_Editor_text').value = "DeShoran Smith";
So, for at least text fields you have to include _Editor_Text as the end of the field.
0 -
I have had a similar problem and posted a separate thread on the issue: (http://communitycentral.metastorm.com/t5/Metastorm-BPM-Version-9/Populating-a-textbox-in-v9-from-an-external-app-using-Javascript/td-p/275269)
I am trying to do the same but via opening a separate window from within Metastorm first using either window.open() or window.showModalDialog. I am not locked down to do it in that way, but I wouldn't know how to redesign the interface to add frames so I could then re-reference the parent (Metastorm) page. I have tried
window.opener.document.getElementById(
'txtHidden_Editor_text').value = "XXXX"; but this doesnt seem to work like it does with your format.
Obviously you have had some success in this field, so I just wondered if you could please give me some tips on how I might go about changing our design to do it like your (successful) way,
0 -
Hi Jonhart,
If I understand correctly, it sounds like you are trying to programmatically interact with 1 open browser window from another window and I don't think this is possible. The web would be a very dangerous place if my website could enter fields and click buttons on another website without the user's knowledge.
The reason the technique described here works is because the iFrame shares a parent (the window object) with the metastorm form. There's even a school of thought that says this is too much interaction between an iFrame and its parent window object!
You may have success if your input is relatively simple and you use the window.showModalDialog(). You would not be "pushing" buttons from the dialog, however, you would be entering values and confirming the dialog and using the returnValue object of the modal dialog in the calling form. This would not be a separate form… this is a feature of the browser to get modal input.
var MyResponse = window.showModalDialog("subDoc.html",argsVariable, "dialogWidth:300px; dialogHeight:200px; center:yes");
…
…
…//Assign MyResponse to some Metastorm fields with SetField(); After dialog confirmation, focus would return to the metastorm form and you would have to click the button
The other option would be to use a calculated label field to render an iFrame whose src attribute points to your custom form. In that case, you would be able to use the technique described above.
0 -
I've used the Iframe pushing value into the V7.6 form
For V9, I've found it easier to pull the value from the iframe by running the following script in the client side script on submit.
This code pulls HTML text from a hosted HTML editor
function SaveHtml()
{
var bodyField7 = GetField("tmpBodyField","");
var frame = document.getElementById("HostFrame");
var content = frame.contentWindow;
var text = content.oboutGetEditor('_corresEditor').getContent();SetField(bodyField7,"", text);
SetField("tmpTextChanged","","Yes");return true;
}Cheers
Graham
0 -
//If your returning from an ASP.NET page hosted in a Metastorm from via an iFrame: function ReturntoMetaStorm(DataObject) { //All forms in Metastorm are contained within a frame. That Frame is called eFormContents //We will use a Generic MemoField named 'memOnDemand' - this field must exist on the Metastorm form in order to accept the value //This sets the value that Metastorm can use in Client Side Code parent.top.frames('eFormContents').document.getElementById('memOnDemandData_Editor').value = DataObject; //This sets the value that is updated on screen in Metastorm parent.top.frames('eFormContents').document.getElementById('memOnDemandData_Editor_text').value = DataObject; parent.top.frames('eFormContents').document.getElementById('btnSave').click(); } //If your returning from an external ASP.NET page function IReturntoMetaStorm(DataObject) { //All forms in Metastorm are contained within a frame. That Frame is called eFormContents //We will use a Generic MemoField named 'memOnDemand' - this field must exist on the Metastorm form in order to accept the value / window.opener.document.getElementById('memOnDemandData_Editor').value = DataObject; window.opener.document.getElementById('memOnDemandData_Editor_text').value = DataObject; window.opener.document.getElementById('btnRefresh').click(); self.close(); }
0 -
Update -
After Installing the latest service release 9.1.2 with hotfix 2
The following no longer works for the post back from iFrames
parent.top.frames('eFormContents').document.getElementById('').value = DataObject;
I was able to locate the change and you should be able to use this instead if posting back from an iFrame fails after you update.
parent.top.frames.eFormContents.document.getElementById('').value = DataObject;
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 152 General Questions
- 148 Thrust Services
- 57 Developer Hackathon
- 37 Thrust Studio
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 190 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 10 XM Fax
- Follow Categories