Populating a textbox in v9 from an external app using Javascript
I am guess I probably know the answer to this having trawled through this and other forums and not found a solution but I thought I'd post just to clarify. Having seen another posting this week also it suggests the better practice now in 9.0 is to do this all within Metastorm and using an admin form but before starting this sequence off and closing this one I thought I'd post on some forums.
Anyway, another developer in our firm using 7.0 had previously created a lookup feature in his Metastorm app, which was in actuality a standalone .Net application that was called from a button on a form. The requirement was to replicate this in 9.0.
This called a javascript function to display the app(site) in a popup using the window.showModelDialog function assigning the result to a variable. The last part of the function populated a Metastorm form field with the value of the variable. Further processing then within metastorm happens using this value.
The app itself had a javascript function in it that when a button was pressed a value was got from a selected item in a control, assigned to the window.returnVariable() method and then window.close() called to remove the popup. We have tried to replicate this functionality using the same js methods but have encountered problems returning a value back to Metastorm. And I wondered if this was now still achievable or relevant in 9.0 - and if so, my present failure down to my choice of js methods, handling of postback in Metastorm, etc.
For the record, I can successfully replicate opening a popup, retaining focus (using jscript in metastorm), and closing the window (using js in .Net). If I create a dummy parent page instead as an aspx page this also opens, closes, sends and recieves the value fine.
I have tried opening the window using:
- showModalDialog
- Window.Open
I have tried returning the value and closing the window using:
- Window.ReturnValue
- Window.dialogArguments.callback
- Window.opener.document.getElementById(
Using both a selected item value and a hard coded value. Each time the window closes, so the javascript does get called from the child.
Within metastorm to check I am setting the right name of the field (as I noticed the id is slightly different in 9 - suffixed by _Editor - in view source), I hardcoded the value using setField, and it worked.
I am now guessing this is something to do with postback or just 9.0 isn't built in the same way.
Can anyone shed any light on any of these issues, or if it is not achievable anymore let me know ?
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