Announcement Announcement Module
Collapse
No announcement yet.
Plz help, my dead line is today X-( Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Plz help, my dead line is today X-(

    Hi all!!

    i know that it is more javascript problem, but i think that there is something with Spring:bind tag that will help me... may be i am whrong...

    so, i have one page where i need to set one field with a PopUp... i have already created a popup, that contains this script:
    Code:
    <script language="JavaScript">
    function setCurrency(cur){
    	window.opener.document.fxRateForm.fr_cu_iso_code.value = cur;
    	window.close();
    }
    </script>
    the code that calls the function above (in the popup)
    Code:
    <td>
    <a href="javascript:setCurrency(${lCurrency.cu_iso_code});">
     ${lCurrency.cu_iso_code}
    </a>
    </td>
    this is my code of the main window (that calls a PopUp with a code above):
    Code:
    <form name="fxRateForm" method="post">
    <table><tr>
    <td>Iso Code</td>
    <td>
    <Spring:bind path="fxRate.fr_cu_iso_code">
    <input type="text" name="fr_cu_iso_code" size="20" value="${status.value}" onclick="javascript:popupJSP();return false;"/>				</Spring:bind>
    </td>
    </tr></table>
    </form>
    pupup is opend, and script is called exactly as needed, but this iso_code field in the main window do not change... it doesnt even close the popup... i would very aprishiate any help.
    thank you
    Last edited by orusso; Jun 9th, 2006, 06:12 AM.

  • #2
    This worked for me (in the opened window):
    Code:
    if (opener.params["helperField"){ 
        opener.params["helperField"].value = helperValue;
        // alert("set value " + helperValue + " in field " + opener.params["helperField"]);
        if (opener.params["helperField"].onchange) {
            opener.params["helperField"].onchange();
        }
    }
    this.window.close();
    the params["helperField"] value I got from:
    Code:
    document.getElementById("customerNo");
    But directly accessing fields in the opener window ist also possible:

    Code:
     
    alert(opener);  // [window]
    alert(opener.document.getElementById("customerNo")); // [HTMLElement]
    opener.document.getElementById("customerNo").value = value; // works perfectly

    But I think your code should work, too?!
    Last edited by oochs; Jun 9th, 2006, 07:31 AM.

    Comment


    • #3

      that what i call "working under pressure"... i dont know why i have tried to do that, but the problem was:
      Code:
      <a ref="javascript:setCurrency('${lCurrency.cu_iso_code}');">
      ${lCurrency.cu_iso_code}
      </a>
      instead of :
      Code:
      <a ref="javascript:setCurrency(${lCurrency.cu_iso_code});">
      ${lCurrency.cu_iso_code}
      </a>
      very small difference, but it is the difference between my boss is or not happy :-D
      thks a lot for help !!

      Comment

      Working...
      X