Update cfdiv in Parent Window from popup window

I need help trying to update a cfdiv in the parent window
from a popup window.
The parent window displays a color (red by default)
The popup gives you a radio selection which would let you
select a different color.
I need to have this submit button update the cfdiv called
"main" in the parent window by lby displaying the corresponding
color AND I want this window to hide.

<!--- POPUP.CFM --->
<cfif NOT structkeyexists(form, 'color')>
<cfform action="popUp.cfm" method="post" name="form1">
<cfinput type="radio" name="color" value="red"
required="yes">Red
<cfinput type="radio" name="color" value="blue"
required="yes">Blue
<cfinput type="radio" name="color" value="green"
required="yes">Green
<br />
<cfinput type="submit" name="submit" value="submit">
</cfform>
<cfelse>
<script type="text/javascript">
updateColor(<cfoutput>'#form.color#'</cfoutput>);
</script>
</cfif>
<!--- MAIN PAGE --->
<!--- Add this js function to the HEAD section of the
page: --->
<script type="text/javascript">
updateColor = function(color){
document.getElementById('main').innerHTML = color;
ColdFusion.Window.hide('mywindow');
</script>
hth
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Similar Messages

  • Call functions in parent(?) from popup window(?)

    I'm not sure the terms parent or window in flex 4.
    I want to call functions in parent from parent window.
    it seems to be hard.
    Help me please.
    Thanks in advance.
    ========================== index.mxml ==========================
    (root element : <mx:Application> - xmlns:mx="http://www.adobe.com/2006/mxml")
    has Main.mxml in it
    ========================== Main.mxml ==========================
    (root element : <s:NavigatorContent> - xmlns:s="library://ns.adobe.com/flex/spark" )
    public function functInMain():void
    //do something
    protected function dataGrid_itemDoubleClickHandler(event:ListEvent):void
    var arr:ArrayCollection = event.currentTarget.dataProvider;
    var titleWindowInstance:Popup =
      Popup(PopUpManager.createPopUp(this,
       Popup,
       true));    
    titleWindowInstance.rowData =  arr.getItemAt(event.rowIndex);
    PopUpManager.centerPopUp(titleWindowInstance); 
    ========================== Popup.mxml ==========================
    protected function buttonClickedInpopup():void
    Application.application.parentDocument.functInMain(null);//<<- here I want to correct

    Thanks.
    Your callback function works ok
    why calling public functin won't work?
    here are neet examples.
    index.mxml : front page
    SearchEvents.mxml : inside index.mxml
    UpdateEvent.mxml : poped up from SearchEvents.mxml
    ========index.mxml===========
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application pageTitle="CA Management"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:i="test.*"
        width="100%" height="100%" creationComplete="application1_creationCompleteHandler(event)" >
    <mx:Script>
      <![CDATA[
       import mx.events.FlexEvent;
       protected function application1_creationCompleteHandler(event:FlexEvent):void
        myViewstack.selectedIndex = 0;
      ]]>
    </mx:Script>
    <mx:ViewStack width="100%" height="100%" id="myViewstack">
        <s:NavigatorContent id="EventManagement" label="Event Management"><i:SearchEvents x="0" y="0"/></s:NavigatorContent>
    </mx:ViewStack>
    </mx:Application>
    ========SearchEvents.mxml=========
    <?xml version="1.0" encoding="utf-8"?>
    <s:NavigatorContent xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         xmlns:mx="library://ns.adobe.com/flex/mx" 
         x="113" y="163"  
         height="100%" width="750">
    <fx:Script>
      <![CDATA[
       import mx.collections.ArrayCollection;
       import mx.controls.Alert;
       import mx.events.FlexEvent;
       import mx.events.ListEvent;
       import mx.managers.PopUpManager;
       import mx.rpc.events.ResultEvent;
       public function parentFunction(param:String):void{
        Alert.show("parent function called with " + param);
       protected function btnSearch_clickHandler(event:MouseEvent):void
        var titleWindowInstance:UpdateEvent =
         UpdateEvent(PopUpManager.createPopUp(this,
          UpdateEvent,
          true));    
        PopUpManager.centerPopUp(titleWindowInstance);
      ]]>
    </fx:Script>
    <s:Button x="637" y="70" label="Popup" id="btnSearch" click="btnSearch_clickHandler(event)"/>
    </s:NavigatorContent>
    ========UpdateEvent.mxml=====
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:incl="incl.*"
        showCloseButton="false"
        title="Update Event" width="432" height="500"
        xmlns:subscription="services.subscription.*"
        xmlns:core="services.core.*"
        horizontalAlign="left" xmlns:vo="vo.*"
        >
    <fx:Script>
      <![CDATA[
       import mx.core.Application;
       protected function parentFunctionCall(event:MouseEvent):void
        Application.application.parentFunction("param from popup");
      ]]>
    </fx:Script>
    <fx:Script>
      <![CDATA[
       import mx.collections.ArrayCollection;
       import mx.controls.Alert;
       import mx.controls.dataGridClasses.DataGridColumn;
       import mx.core.Application;
       import mx.events.FlexEvent;
       import mx.formatters.*;
       import mx.managers.PopUpManager;
       import popup.*;
       [Bindable] public var rowData:Object ;//to get the parent row
      ]]>
    </fx:Script>
    <s:Button label="parentFunctionCall" id="btnPar" click="parentFunctionCall(event)"/>
    </mx:TitleWindow>

  • Update select in parent window

    Hi there
    I have a window thats been opened through window.open(...). What I now want to do is to, form the new window update a select object in the first/parent window. I've tried do do this through this javascript:
    var option = new Option("test","test");
    opener.document.form1.selectbox.options[1] = option;But when it runs I get a error message: Server has thrown an exception
    Does anyone know why this happens or have any other suggestion on my problem?
    Thanks / Daniel

    <!--- POPUP.CFM --->
    <cfif NOT structkeyexists(form, 'color')>
    <cfform action="popUp.cfm" method="post" name="form1">
    <cfinput type="radio" name="color" value="red"
    required="yes">Red
    <cfinput type="radio" name="color" value="blue"
    required="yes">Blue
    <cfinput type="radio" name="color" value="green"
    required="yes">Green
    <br />
    <cfinput type="submit" name="submit" value="submit">
    </cfform>
    <cfelse>
    <script type="text/javascript">
    updateColor(<cfoutput>'#form.color#'</cfoutput>);
    </script>
    </cfif>
    <!--- MAIN PAGE --->
    <!--- Add this js function to the HEAD section of the
    page: --->
    <script type="text/javascript">
    updateColor = function(color){
    document.getElementById('main').innerHTML = color;
    ColdFusion.Window.hide('mywindow');
    </script>
    hth
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • Button(in parent) click from popup component

    the popup window add some data.
    after finish the job the popup window closes.
    right after the popup window closes I want to call click event(like btnList.click() in javascript)
    any ideas?
    Thanks.

    Hi ltambs,
    Make use of the ExternalInterface API to call your javascript function once your popup is closed.
    //In ActionScript
    private function closePopUp():void
         PopupManager.removePopUp(this);
         ExternalInterface.call("yourJavaScriptFunction");
    //In HTML wrapper your JavaScript
    function yourJavaScriptFunction()
         alert(" JavaScript Function Called...");
    Hope this is what you're looking for...If not please elaborate on this...
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

  • Visual Composer : Sending a signal from popup to iview

    Hello,
    I would like to refresh a table in a parent iview from popup iview. I think about a timer. What Can I do that ? Do you have a good example or can you explain in details the process ?
    Best regards,
    Aurélien

    Hi Aurélien,
    you have to use a timer. Connect the timer with a dataservice which refreshes your value, e.g. in a table. Then return from your popup a value,e.g. into a field. Define a guard condition to the timer so that it will be fired, when you return the certain value. Your data service must change the value from your popup so that the timer fire the event once.
    Best Regards,
    Marcel

  • Tab focus progressing to parent window from popup

    Hi,
    I am using JDeveloper 11.1.1.7.0 version.
    I have a bounded task flow with .jsff fragments and I am trying to call another bounded taskflow(with .jspx files) as "Run As Dialog" from this taskflow.
    Here I am able to set initial focus to the required input element using <af:document> tag's "initialFocusId" property. Up to this, it is working fine.
    When I tried to tab, cursor is moving to next fields as expected. But after completing all the fields and buttons in the popup, tab focus is progressing to the parent window links and buttons.
    Is there a way to block the cursor progression to parent window and make it to rotate within the popup window.
    Thanks,
    Gopal.

    This is a bug in ADF Framework. Filed a bug with ADF Framework and they have accepted this as a bug.
    I'll update this post once I get the resolution from ADF team.

  • How to pass the values from popup window to parent's window

    Hi Experts,
    in my application i need to develop one popup window in that i have created 4 dropdowns and one ok button , if i willl click on that ok  button the values should pass to parent window dropdownlistboxes
    can any body suggest how i will get the popup window values
    thanks in advance,
    ramani.

    Hi Ramani,
    I can provide few inputs on how can we control JSP 2 from JSP1.
    Here is the code. Check if you can convert this to make useful to you. I am not passing values but control.
    here it is:
    JSP 1.
    <h1>Page One</h1>
    <br>
    <a href="/irj/portalapps/<PAR_FILE_NAME>/images/<HTML_PAGE_NAME>.html#part1">part 1</a>
    <br><br><br>
    <a href="/irj/portalapps/<PAR_FILE_NAME>/images/<HTML_PAGE_NAME>#part2">part 2</a>
    <br><br><br>
    <a href="/irj/portalapps/<PAR_FILE_NAME>/images/<HTML_PAGE_NAME>#part3">part 3</a>
    JSP 2.
    <h1>Page Two</h1>
    <br>
    <a name="part1">
    <h3>Part 1</h3>
    </a>
    <a name="part2">
    <h3>Part 2</h3>
    </a>
    <a name="part3">
    <h3>Part 3</h3>
    </a>
    This way you can move from one JSP to other.
    regards
    -Kedar Kulkarni
    reward points if useful.
    Message was edited by:
            Kedar Kulkarni

  • How do I populate a popup window with data from the parent window

    I am brand new to JSF so please help me. I have a JSF page where users enter some search criteria and it displays the results in a matrix table. I need to have a PRINT button or link on this page that pops up a new window that displays the same data but in a printer-friendly format.
    The parent page is already created and works fine. Now, what is the best way to populate the same data in the popup? The data is stored in a hashmap and retrived by a managed bean with session scope. Below is the XHTML code for displaying the table in the parent page.
    <tbody>
                             <c:forEach items="#{inventoryManagedBean.inventoryColors}" var="row">
                                  <tr id="matrixColor">
                                       <c:forEach items="#{inventoryManagedBean.sizeList}" var="column" varStatus="cellStatus">
                                            <c:if test="#{cellStatus.index == 0}">
                                                 <th width="70px"><h:graphicImage value="../graphics/styles/#{row.color}.jpg"
                                                      alt="#{row.color}" width="70" height="40"></h:graphicImage></th>
                                                 <th width="100px"><h:outputText value="#{row.colorDescription}" />
                                                 <h:outputText value="#{row.color}" /></th>
                                            </c:if>
                                            <td width="70px"><c:if
                                                 test="#{inventoryManagedBean.inventoryMap[row.color][column.size] != null}">
                                                 <c:if test="#{inventoryManagedBean.inventoryMap[row.color][column.size].label != '-1'}">
                                                      <span class="matrixText"><h:outputText
                                                           value="#{inventoryManagedBean.inventoryMap[row.color][column.size].label}"
                                                           title="#{inventoryManagedBean.inventoryMap[row.color][column.size].title}" /> </span>
                                                      <t:htmlTag value="br" rendered="#{userManageBean.user.loggedIn}" />
                                                      <a4j:region renderRegionOnly="false">
                                                           <h:inputText
                                                                value="#{inventoryManagedBean.inventoryMap[row.color][column.size].quantityOrdered}"
                                                                rendered="#{userManageBean.user.loggedIn}" maxlength="6" size="6">
                                                           </h:inputText>
                                                      </a4j:region>
                                                 </c:if>
                                                 <h:outputText value="Call"
                                                      rendered="#{inventoryManagedBean.inventoryMap[row.color][column.size].label == '-1'}" />
                                            </c:if> <h:outputText value="N/A"
                                                 rendered="#{inventoryManagedBean.inventoryMap[row.color][column.size] == null}" /></td>
                                       </c:forEach>
                                  </tr>
                             </c:forEach>

    call javascript window.open("pagename"); & add some printer button there,
    and put rendered attribute to button & in backing bean generate boolean getter setter for variable use same variable in jsp printer button in rendered attribute, in bean constructor pass some parameter throuh jsp page,
    if parameter is match then it rendered attribute to true for button else not,
    it means that in parent window you can not see printer button, but in same window in popup you will see printer button,
    good luck
    <h:commandButton rendered="#{bean.renderedButton}"/>
    bean
    private boolean renderedButton= false;(generate getter setter)
    also pass parameter from UI to bean constructor

  • Eventing across windows (from popup to parent)

    On click of a button in the popup I want to be able to fire a plug on a particular view in the parent window.
    Is there any way to do that? I notice that I cannot create outbound plugs across windows? (Am i missing something here?)
    thanks,
    rakshit

    Hi Rakshit,
    Make one action on any button click.
    Make one method in your component controller.
    Make one event in your Component controller from Event tab. Now, for calling this event, write following code in method created above.
    wdThis.wdFireEvent<Event name>();
    Now, call this component method from your popup view based on whatever action.
    Now, in your parent view, make one event handler from methods tab.Here, select your event source as your component controller select event in Subcribed event field.
    Now, write code whatever you want like changing the view, inside this event handler.
    I think its clear to you. If you get some problem, with this then come back to me.
    Regards,
    Bhavik

  • How to send data from popup window to parent window

    Hi,
    I need help some like this
    I have parent window ,in that i am clicking + button one dynamic row should add and one popup window has to diplay .Popup window contain 3 comboboxes and 5 text boxes. Once i am clicking OK button in popup window those values has to display at specified row in parent window
    Kindly help me ,
    Thanks
    jyothi

    See this
    http://www.oracle.com/technology/products/jdev/101/howtos/jsfdrilldown/index.html

  • Passing Value from a Popup Window Back to the Parent Window

    I am using JSF. I try to pass a value that is entered by users in the popup window back to a text field in the parent window.
    quote: document.forms[ ].elements[ ] is null or not an object.
    The relevant code snippets are shown below. The screen1.jsp is the parent window:
             <script language="JavaScript1.1">
               function doPopup(source)
                    popup = window.open("externalFilePopup.jsp",
                        "popup",
                         "height=300,width=200,toolbar=no,menubar=no,"                    + "scrollbars=yes");
                    popup.openerFormId = source.form.id;
                    popup.focus();
               </script>
    <h:outputText value="Enter the external system file name"/>        <h:inputText value="#{dataManagementBean.ip}" size="18" />
    <h:commandButton value="..." onclick="doPopup(this); return false;" />
    ..........The externalFilePopup.jsp is the popup window:
            <script language="JavaScript1.1">
                function doSave( value )
                   var formId = window.openerFormId;
                   opener.document.forms[ formId ].elements[ formId + ":ip" ].value = value;
                   window.close();
            </script>
         <h:outputText value="IP Address: "/>
         <h:inputText size="25" value="#{dataManagementBean.ip }" required="true"/>
         <h:commandButton value="OK" onclick="doSave('#{dataManagementBean.ip}');"/>
            .......... The script error occurs when I click on this OK button.
    Please point out the mistakes in my code. Thank you.

    I have made some modifications to the code in the popup window. The error reported in my previous posting is gone. But, I still have several problems:
    1. syntax error in the popup window jsp page: line 45, char 21, syntax error, ..., Do you want to continue running script on this page?2. The popup window does not close after I click on the OK button that I coded in the popup window jsp.
    3. The value that I entered in the popup window eventually gets passed back to the text field in the parent window only if I re-run the application.
    The relevant JavaScript code snippets are:
            <script language="JavaScript1.1">
                function doSave( value )
                   var formId = window.openerFormId;
                   opener.document.forms[ formId ].form[ formId + ":ip" ].value = value;
                   window.close();
            </script>
                                       <h:outputText value="IP Address: "/>
         <h:inputText size="25" id="ip" value="#{dataManagementBean.ip }" required="true"/>
         <h:commandButton value="OK" onclick="doSave('ip'); return=false;"/>
    ......What are the mistakes that I made?

  • How to populate a Value in popup based on value selected in Parent window

    Hi Gurus,
    I have done a custumization to generate a PDF report for a given DocType and Document ID.
    I have 2 fields in xxxQuoteDevPG.xml (Parent Window) called DocType and Document Number.
    Doctype is dropdown list which has 2 values i.e. Sales Quote and Manual SOW Number and Document Number is a text field with search option.
    when i select the doctype as Sales Quote and search for docnumber , i will get a popup where i have "Search By" dropdown list in this i have 2 values i.e "Quote Number" and "Customer PO".
    When i select a Sales Quote as Doctype i need to populate Quote Number as defualt in Search by dropdown list.
    and When i select Manual SOW Number from parent window i need to defualt Customer PO in popup.
    Now it is always shows Quote Number as defualt one for the doctypes.
    Actually thr is only one controller atatched to xxxQuoteDevPG.xml and popup is a OA Region.
    Can somebody help me on this issue.
    Thanks,
    MMR

    This should be a custom java class containing that method.
    Try on java or jdbc forum - Java Database Connectivity (JDBC) , Java Programming

  • How to pass the data from a pop up window to the parent window

    Hi All,
    I have a jsp page which contains a add button, while clicking it a popup will come out(which is a another jsp page). There are some input fieldsand a submit button. Now how could I send the data from the pop up to the parent winow. Also I have to check that if the pop up is open and I click add button then another pop up must not open.
    Plz reply its urgent
    Thanks and Regards
    Rajib Sharma

    Thanks for the reply
    But it not worked
    I have a jsp page and the popup is also a jsp page the data that is passed from the popup window to the parent must be send to the server from the parent window to get a data from the data base as search result. Its of no use to get it as js data
    Thanks and regards
    Rajib Sharma

  • How to parse parameter from child window to parent window in JSP

    I have two JSP i.e. course1.jsp and course2.jsp. I would want to find out how I could parse the parameter/value from child window to the parent window when the child window get closed.
    What I am trying to do is actually a file upload process. The child windows will open for user to upload the file, and when close, the file name will be parse into the parent form for database update. Is this something possible at all? or is there any other better approaches.
    Thank you.
    These are the two files:
    --------course1.jsp ------------
    Attach File <p>
    <FORM name="courseForm" action="course2.jsp" method="post" enctype="multipart/form-data">
    <TABLE cellSpacing=1 cellPadding=3 border=0 WIDTH=500>
    <TR >
    <TD>
    <input type="text" NAME="f_file_name" size="30" VALUE="this value should be taken from child windows">
    get file name
    <p>
         <INPUT class="buttons" TYPE="submit" NAME="submit" VALUE="Submit">
    </TD>
    </TR>
    </TABLE>
    </FORM>
    ---- course2.jsp -------
    <%
    String filename = "this is the string needs to go back to parent windows when I click on close";
    %>
    <p>
    close

    In course2.jsp, you have to write some javascript code to reload the parent window document to reload the document with an added parameter. But, instead of doing this, you can also do simple thing; in course2.jsp, you can reference course1.jsp controls via javascript object, "parent". On closing event of course2, you can write:
    parent.courseForm.f_file_name.text = '<%=filename%>' ;
    window.close() ;
    But for this to work, you must open your course2.jsp document thru window.open() function instead of simple hyper link (as you did thru ).
    So, modify the hyperlink line like below:
    get file name
    Hope it helps.

  • How to pass a data from child window to parent window

    Hi,
    I have a jsp page with two hidden fields and a button, On clicking the button a popup will come out. There are two combobox in the popup and a search button. After putting a value in the comboboxes,if I click the search button, I need the datas of the combobox to pass to the parent's hidden fields then I need to do a data base search with that values of hidden fields and display the result in the parent page.
    I could I solve this problem, Please help, Its urgent.
    Thanks and Regards
    Rajib Sharma

    I think that you can use the JavaScipt as follow to pass a data from child window to parent window
    <HEAD>
    <script>
    function passData(){
    opener.form1.test1.value=form2.test2.value; //pass the value of test2 to the parent's test1
    window.close();
    </script>
    </HEAD>
    <BODY>
    <form name=form2>
    <input name=test2 type=text>
    <input type=button onclick="passData()" value=CLOSE>
    </form>
    </BODY>

Maybe you are looking for

  • I want to send a value from JSP file to another JSP file without..

    I want to send a value from one.JSP file to another two.JSP file without to show the content HTML of the one.JSP in two.JSP (with include), only take the values processed in a Bean : =================== Bean package pck; import java.io.*; public clas

  • How do you exit out of full screen mode for FCPX? ESC does not work.

    Hi guys. I cannot seem to find the exit to full screen viewing mode in final cut pro x. Escape key doesn't do the trick. There are no "exit full screen" buttons that pop up. It is confusing and I have to force quit the program every time I use full s

  • Security: Adobe Standard X can sign, Adobe Reader 9 Cannot

    Hi all, I need some help with an issue I'm having. I have a PDF document that when viewed internally using Adobe Acrobat Pro X, the document security is displaying that everything is allowed (including signing). When I then email the same document ou

  • Dealer Portal

    Hi, How to Start with dealer Portal ? I know what is to be done at Portal side but dont know about SPRO settings . Is there any special authorisation required for the users of Portal ? What else I should keep in mind ? Regards, Sanjay

  • Pacman -Syu and now keyboard only works as root kde

    I did a pacman -Syu and now keyboard only works as root kde Users can use keyboard in the basic console and this is a failure within KDE or the X-server. On this upgrade I needed to add the portmap daemon to rc.conf. I am running kerrnel 2.6.5-2. The