xiaoftel

Q: Anyone knows how to call javascript function inside WOActionResult?

Hi,

 

I am new to webobjects and javascript. I have a AjaxUpdateLink action to change some value inside of an IFrame. I tried to put the IFrame into an AjaxUpdateContainer but seems not work.

Then I want to try

document.getElementById('iframe').contentWindow.document.getElementById('txt').v alue = 'test successful'

by put it in to

How can I trigger this or trigger the script inside WOActionResult java code.

 

Anyone can help? Many thanks

Mac OS X (10.6.5)

Posted on Dec 7, 2011 5:43 AM

Close

Q: Anyone knows how to call javascript function inside WOActionResult?

  • All replies
  • Helpful answers

  • by Ted Petrosky,

    Ted Petrosky Ted Petrosky Dec 7, 2011 7:17 AM in response to xiaoftel
    Level 4 (1,855 points)
    Dec 7, 2011 7:17 AM in response to xiaoftel

    can you show your code? both the html and the WOD .

     

    Ted

  • by xiaoftel,

    xiaoftel xiaoftel Dec 7, 2011 4:56 PM in response to Ted Petrosky
    Level 1 (0 points)
    Dec 7, 2011 4:56 PM in response to Ted Petrosky

    Hi Ted,

     

    For the main component:

    In the html:

    <wo:AjaxUpdateContainer id = "editform">

    <webobject name = "content" />

    </wo:AjaxUpdateContainer>

     

    <webobject name = "TagHpyerLink"> </webobject>


     

    In the wod:

     

    TagHpyerLink : AjaxUpdateLink {

      string = "change this";

      action = change;

      updateContainerID = "editform";

    }

     

    content : WOIFrame {

    id = "iframe";

    pageName = "Page";

    height = "400px";

    width = "1170px";

     

    the Page component:

     

    html:

    <div><webobject name = "pagestring"></webobject></div>


    wod:

    pagestring : WOString {

              value = html;

      escapeHTML = "false";

    }

     

    I want to change the value of pagestring by AjaxUpdateLink change action but do not know how to do pass that via Iframe

     

    Thanks