Calling a Function in the Parent Window from the Child Window

QUESTION: How do I call a function resident in the parent
window from a child window?
BACKGROUND
I have a JavaScript function resident in the parent window
that reformats information obtained from the Date object and writes
the result to the parent window using the document.write( ) method.
I would like to call this function from the child window and have
it write to the child window instead. Is this possible? If not,
must I rewrite the entire function and nest it in the below code?
If so, what is the proper form of nesting?
CODE: The code that creates and fills the child window is
provided below. The highlighted area indicates where I would like
to enter the information from the function resident in the parent
window. I have tried every imaginable permutation of code that I
can imagine and nearly destroyed my parent document in the process.
I am very happy that I had a back-up copy!
function openCitationWindow() {
ciDow = window.open("", "", "width=450, height=175, top=300,
left=300");
ciDow.document.write("A proper way to cite a passage of text
on this page:<br /><br />Stegemann, R. A. 2000.
<cite>Imagine: Bridging a Historical Gap</cite>. " +
document.title + ". [<a href='" + location.href + "'
target='_blank'>online book</a>] &lt;" + location.href
+ "&gt; (");
MISSING CODE;
ciDow.document.write(").<br /><br /><input
type='button' value='Close Window' onclick='window.close()'>");
ciDow.focus();

Never mind - I was doing something very stupid and wasn't
calling the function as a method of a movie clip. I was simply
calling checkTarget(event) rather than
event.currentTarget.checkTarget(event); which seems to work.

Similar Messages

  • Is it possible to call a function in a parent component from a child component in Flex 3?

    This is probably a very basic question but have been wondering this for a while.
    I need to call a function located in a parent component and make the call from its child component in Flex 3. Is there a way to access functions in a parent component from the child component? I know I can dispatch an event in the child and add a listener in the parent to call the function, but just wanted to know if could also directly call a parent function from a child (similar to how you can call a function in the main mxml file using Application.application). Thanks

    There are no performance issues, but it is ok if you are using the child component in only one class. Suppose if you want to use the same component as a child to some bunch of parents then i would do like the following
    public interface IParentImplementation{
         function callParentMethod();
    and the parent class should implement this 'IParentImplementation'
    usually like the following line
    public class parentClass extends Canvas implements IParentImplementation{
              public function callParentMethod():void{
         //code
    in the child  you should do something like this.
    (this.parent as IParentImplementation).callParentMethod();
    Here using the Interfaces, we re decoupling the parent and the child
    If this post answers your question or helps, please mark it as such.

  • How do you call a function in an attached MovieClip from the current MovieClip?

    Hi there,
    I have this MovieClip A (converted as a symbol) and put in my
    main MovieClip B using attachMovie() , and I am wondering how I can
    call a function defined in A from within B.
    Is it possible?
    Thanks

    Hi kglad,
    yes, I did the attachMovie of the symbol B and it seems like
    none of the ActionScript written in B was not carried over.
    This is how I built B into a symbol :
    (1) Two layers ( one for the ActionScript only, the other for
    the Components)
    (2) I defined the functions to be called remotely by A in the
    ActionScript layer
    (3) I selected all the components in the Components Layer and
    did a Convert To Symbol
    (4) I added the Symbol into A's Library
    (5) I used attachMovie to instantiate the Symbol of B
    I must have missed out something somewhere
    Thanks

  • How can we retrieve the name of the Parent Space from the subspace?

    We wish to use a hyperlink in a subspace template which allows a user to link back from the subspace to its parent space.
    This hyperlink should show the name of the parent space.
    These Expression Language Expressions return parent information, but they so not show the Name of the parent space or other details like the Parent Space URL.
    #{spaceContext.currentSpace.parent}
    #{spaceContext.space['bpo'].parent}
    How can we retrieve the name of the Parent Space?

    I agree!
    I can't top this approach.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Calling a method in the view controller from the component controller

    Hi
    Is there anyway to call a method in the view implementation from the component controller??
    Thanks
    jack

    Thanks for all your replies. I want this kind of a functionality because Im trying to invove a DC (Child DC) from a Parent DC such that the Child DC's view is displayed onto the view container of the Parent DC. I have embedded using 'interface view of a component instance' in the Parent Window and am able to create the component and set usage though the onPlugDefault of the Child View.
    But I observe that when i make a call from the parent, the flow is like this:
    1. The wdDoInit of the Child Component Controller gets triggered first.
    2. Then the wdDoInit of the Child's <b>VIEW</b> gets triggered
    3. and <b>THEN</b> the onPlugDefault of the Child Component Interface View
    What I had actually wanted was to Fire onPlugDefault where Im calling a method LoadData(), after which the Child DC's view must be triggered so it can display the fetched data.
    What is actually happening is the view gets displayed, but no data is displayed in the view.
    Right now I have just given a work around where Im triggering <b>LoadData()</b> of the <b>COmponent COntroller</b> from the <b>wdDoInit</b> of the <b>VIEW</b>.
    Is there a better way to do this? I find it strange that I have to load the Data from the view.
    Thanks
    Jack

  • The value returned from the load function is not of type numeric  errors after migration to Coldfusion 11

    I am currently testing our website with CF11. It is currently working with CF8 however after migrating it to a new server running CF11 I have encountered the following error.
    The value returned from the load function is not of type numeric.
    The error occurred in
    D:/Applications/CFusion/CustomTags/nec/com/objects/address.cfc: line 263
    Called from D:/Applications/CFusion/CustomTags/nec/com/objects/contact.cfc: line 331
    Called from D:/Applications/CFusion/CustomTags/nec/com/objects/user.cfc: line 510
    Called from D:/Applications/CFusion/CustomTags/nec/com/objects/user.cfc: line 1675
    Called from D:/website/NECPhase2/action.validate.cfm: line 54
    261 : <cfif isNumeric(get.idCountry)>
    262 : <cfset rc = this.objCountry.setID(get.idCountry)>
    263 : <cfset rc = this.objCountry.load()>
    264 : </cfif>
    265 : <cfset this.sPostcode = get.sPostcode>
    Have there been any changes between CF8 and CF11 that could  cause this error?
    Does anyone have ideas?

    This is the code in file object file country.cfc (nec.com.objects.country):
    <cfcomponent displayname="Country object" hint="This is a Country object, it allows you to access and set values in the Country.">
    <!---
    // Construct this object
    --->
    <cfset this.objFunctions = CreateObject( 'component', 'nec.com.system.functions' )>
    <cfscript>
      this.idCountryID = 0;
      this.sCountryName = "";
      this.sISOCode = "";
      this.sDHLCode = "";
      this.iErrorID = "";
    </cfscript>
    <!---
    // The following functions are the setters and getters. offering us a better way to get
    // at the contents of the object
    --->
    <!---
    // Getters
    --->
    <cffunction name="getID" displayname="Get ID" returntype="numeric" output="false" hint="This returns the ID of the current item.">
      <cfreturn this.idCountryID>
    </cffunction>
    <cffunction name="getsCountryName" displayname="Get sCountryName" returntype="string" output="false" hint="This gets the sCountryName value of this item.">
      <cfreturn this.sCountryName>
    </cffunction>
    <cffunction name="getsISOCode" displayname="Get sISOCode" returntype="string" output="false" hint="This gets the sISOCode value of this item.">
      <cfreturn this.sISOCode>
    </cffunction>
    <cffunction name="getsDHLCode" displayname="Get sDHLCode" returntype="string" output="false" hint="This gets the sDHLCode value of this item.">
      <cfreturn this.sDHLCode>
    </cffunction>
    <cffunction name="iError" displayname="Get iError" returntype="numeric" output="false" hint="This returns the iError of the current item.">
      <cfreturn this.iError>
    </cffunction>
    <!---
    // Setters
    --->
    <cffunction name="setID" displayname="Set ID" returntype="boolean" output="false" hint="This sets the ID value of this item.">
      <cfargument name="idCountryID" required="true" type="numeric" displayname="ID" hint="The ID to use.">
      <cfset this.idCountryID = arguments.idCountryID>
      <cfreturn true>
    </cffunction>
    <cffunction name="setsCountryName" displayname="Set sCountryName" returntype="boolean" output="false" hint="This sets the sCountryName value of this item.">
      <cfargument name="sCountryName" required="true" type="string" displayname="sCountryName" hint="The sCountryName to use.">
      <cfset this.sCountryName = arguments.sCountryName>
      <cfreturn true>
    </cffunction>
    <cffunction name="setsISOCode" displayname="Set sISOCode" returntype="boolean" output="false" hint="This sets the sISOCode value of this item.">
      <cfargument name="sISOCode" required="true" type="string" displayname="sISOCode" hint="The sISOCode to use.">
      <cfset this.sISOCode = arguments.sISOCode>
      <cfreturn true>
    </cffunction>
    <cffunction name="setsDHLCode" displayname="Set sDHLCode" returntype="boolean" output="false" hint="This sets the sDHLCode value of this item.">
      <cfargument name="sDHLCode" required="true" type="string" displayname="sDHLCode" hint="The sDHLCode to use.">
      <cfset this.sDHLCode = arguments.sDHLCode>
      <cfreturn true>
    </cffunction>
    <!---
    // Clear, to empty out the contents of this object
    --->
    <cffunction name="clear" displayname="Clear items Details" returntype="boolean" output="false" hint="Clears out all of the items details.">
      <cfscript>
       this.sCountryName = "";
       this.sISOCode = "";
       this.sDHLCode = "";
       this.iErrorID = "";
      </cfscript>
      <cfreturn true>
    </cffunction>
    <!---
    // The following functions deal with the load, save and deleting of objects
    --->
    <!---
    // Load
    --->
    <cffunction name="load" displayname="Load items details" returntype="numeric" output="false" hint="This loads in all the information about an item.">
      <cfset rc = this.clear()>
      <!---
      // First of all we need to get the name of the data source we are going to be using
      --->
      <cfscript>
      objDS = CreateObject("component","nec.com.system.settings");
      sDatasource = objDS.getDatasource();
    </cfscript>
      <!---
      // Check to see if it exists
      --->
      <cftry>
       <cfquery name="checkID" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("load: checkID: '#this.idCountryID#' #cfcatch.detail#");
        </cfscript>
        <cfset this.iErrorID = iErrorID>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif not checkID.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         if(isDefined("session.afr")){
          whichOne = "#session.afr.getsAFRNumber()#";
         } else {
          whichOne = "";
         iErrorID = objError.addError("A Country with that id doesn't exists.[#this.idCountryID#][#whichOne#]");
        </cfscript>
       <cfset this.iErrorID = iErrorID>
       <cfreturn iErrorID>
      </cfif>
      <!---
      // If we got past all then then load in the details
      --->
      <cftry>
       <cfquery name="get" datasource="#sDatasource#">
        SELECT idCountryID, RTRIM(sCountryName) as sCountryName, RTRIM(sISOCode) as sISOCode, RTRIM(sDHLCode) as sDHLCode
        FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("load: get: #cfcatch.detail#");
        </cfscript>
        <cfset this.iErrorID = iErrorID>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfset this.idCountryID = get.idCountryID>
      <cfset this.sCountryName = get.sCountryName>
      <cfset this.sISOCode = get.sISOCode>
      <cfset this.sDHLCode = get.sDHLCode>
      <cfset this.iErrorID = "">
      <cfreturn true>
    </cffunction>
    <!---
    // Save
    --->
    <cffunction name="save" displayname="Save items Details" returntype="numeric" output="false" hint="Saves (to some source) the current details for the ID of the item.">
      <!---
      // First of all we need to get the name of the data source we are going to be using
      --->
      <cfscript>
      objDS = CreateObject("component","nec.com.system.settings");
      sDatasource = objDS.getDatasource();
    </cfscript>
      <!---
      // Now check to see if ithat ID exists
      --->
      <cftry>
       <cfquery name="checkID" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("save: checkID: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <!---
      // If it doesn't exist, then add the record, otherwise update the record
      --->
      <cfif not checkID.recordCount>
       <cfreturn this.add()>
      <cfelse>
       <cfreturn this.update()>
      </cfif>
    </cffunction>
    <!---
    // Add
    --->
    <cffunction name="add" displayname="Add Country" returntype="numeric" output="false" hint="This adds a Country.">
      <!---
      // Check to see if that a different item isn't already using the same unique details
      --->
      <cftry>
       <cfquery name="checkUnique" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE sCountryName = '#this.objFunctions.scrubText(this.sCountryName)#'
        OR sISOCOde = '#this.objFunctions.scrubText(this.sISOcode)#'
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("add: checkUnique: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif checkUnique.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("A Country with that name or ISO code already exists. idCountryID=#checkUnique.idCountryID#");
        </cfscript>
       <cfreturn iErrorID>
      </cfif>
      <cftry>
       <cfquery name="add" datasource="#sDatasource#">
        SET nocount on
        INSERT INTO tblCountry(sCountryName, sISOCode, sDHLCode)
        VALUES('#this.objFunctions.scrubText(this.sCountryName)#','#this.objFunctions.scrubText(t his.sISOCode)#','#this.objFunctions.scrubText(this.sDHLCode)#')
        SELECT @@identity as autoID
        SET nocount off  
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("add: add: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfreturn add.autoID>
    </cffunction>
    <!---
    // Update
    --->
    <cffunction name="update" displayname="Update Country" returntype="numeric" output="false" hint="This updates a Country record.">
      <!---
      // Check to see if that a different item isn't already using the same unique details
      --->
      <cftry>
       <cfquery name="checkUnique" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE (sCountryName = '#this.objFunctions.scrubText(this.sCountryName)#'
        OR sISOCOde = '#this.objFunctions.scrubText(this.sISOcode)#')
        AND idCountryID <> #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("update: checkUnique: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif checkUnique.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("Another Country with that name already exists. idCountryID=#checkUnique.idCountryID#");
        </cfscript>
       <cfreturn iErrorID>
      </cfif>
      <!---
      // Attempt to update the record to the datasource
      // if this fails for any reason then we submit an error message
      // to the error component and return the ID of the error
      --->
      <cftry>
       <cfquery name="update" datasource="#sDatasource#">
        UPDATE tblCountry
        SET sCountryName = '#this.objFunctions.scrubText(this.sCountryName)#',
        sISOCode = '#this.objFunctions.scrubText(this.sISOCode)#',
        sDHLCode = '#this.objFunctions.scrubText(this.sDHLCode)#'
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("update: update: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfreturn this.idCountryID> 
    </cffunction>
    <!---
    // Delete
    --->
    <cffunction name="delete" displayname="Delete Country" returntype="numeric" output="false" hint="This deletes a Country record.">
      <!---
      // First of all we need to get the name of the data source we are going to be using
      --->
      <cfscript>
      objDS = CreateObject("component","nec.com.system.settings");
      sDatasource = objDS.getDatasource();
    </cfscript>
      <!---
      // Now check to see if ithat ID exists
      --->
      <cftry>
       <cfquery name="checkID" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("delete: checkID: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif not checkID.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("A Country with that id doesn't exists, delete failed.");
        </cfscript>
       <cfreturn iErrorID>
      </cfif>
      <!---
      // Now check to see if there are any dependancies, if so we can't delete the item
      --->
      <cftry>
       <cfquery name="checkDependancies" datasource="#sDatasource#">
        SELECT idCountry
        FROM tblAddress
        WHERE idCountry = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("delete: checkDependancies: idCountry: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif checkDependancies.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("That Country is being used by an address, delete failed.");
        </cfscript>
       <cfreturn iErrorID>
      </cfif>
      <!---
      // Now attempt to remove the record.
      // if this fails for any reason then we submit an error message
      // to the error component and return the ID of the error
      --->
      <cftry>
       <cfquery name="delete" datasource="#sDatasource#">
        DELETE FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("delete: delete: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfreturn this.idCountryID>
    </cffunction>
    </cfcomponent>

  • How to open a new window from the login window?

    hi,
    can someone tell me how to open a new window from an existing window, here by window i mean frame. The case is i hv two java files - oracle.java and FDoptions.java. The first frame is in the Login.java. The oracle.java file has a button "Login", when it is clicked, i want to open the next frame which is in the file FDoptions.java. Can some one help me with this? I m giving the code below -
    oracle.java
    import java.awt.BorderLayout;
    import java.awt.FlowLayout;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JPasswordField;
    import javax.swing.JTextField;
    * The application's main frame.
    public class oracle {
        private JFrame frame;
        private JPanel logInPanel;
        private JButton clearButton;
        private JButton logInButton;
        private JButton newuserButton;
        private JButton forgotpasswordButton;
        private JTextField userNameTextField;
        private JPasswordField passwordTextField;
        public oracle() {
            initComponents();
        private final void initComponents() {
            JLabel userNameLabel = new JLabel("User name: ");
            JLabel passwordLabel = new JLabel("Password: ");
            userNameTextField = new JTextField();
            passwordTextField = new JPasswordField();
            JPanel userInputPanel = new JPanel(new GridLayout(2, 2, 5, 5));
            userInputPanel.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 20));
            userInputPanel.add(userNameLabel);
            userInputPanel.add(userNameTextField);
            userInputPanel.add(passwordLabel);
            userInputPanel.add(passwordTextField);
            logInButton = new JButton(new LogInAction());
            clearButton = new JButton(new ClearAction());
            newuserButton = new JButton(new NewUserAction());
            forgotpasswordButton = new JButton(new ForgotPassword());
            JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
            JPanel buttonPanel1 = new JPanel(new FlowLayout(FlowLayout.RIGHT));
            buttonPanel.add(logInButton);
            buttonPanel.add(clearButton);
            buttonPanel1.add(newuserButton);
            buttonPanel1.add(forgotpasswordButton);
            logInPanel = new JPanel(new BorderLayout());
            logInPanel.add(userInputPanel, BorderLayout.NORTH);
            logInPanel.add(buttonPanel, BorderLayout.CENTER);
            logInPanel.add(buttonPanel1,BorderLayout.SOUTH);
            frame = new JFrame("FD Tracker");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(500, 500);
            frame.setContentPane(logInPanel);
            frame.pack();
            frame.setVisible(true);
        private void performLogIn() {
            // Log in the user
            System.out.println("Username: " + userNameTextField.getText());
            char[] password = passwordTextField.getPassword();
            System.out.print("Password: ");
            for(char c : password) {
                System.out.print(c);
            System.out.println();
        private void performClear() {
            // Clear the panel
            System.out.println("Clearing the panel");
            userNameTextField.setText("");
            passwordTextField.setText("");
        private final class LogInAction extends AbstractAction {
            public LogInAction() {
                super("Log in");
            @Override
            public void actionPerformed(ActionEvent e) {
                performLogIn();
        private final class ClearAction extends AbstractAction {
            public ClearAction() {
                super("Clear");
            @Override
            public void actionPerformed(ActionEvent e) {
                performClear();
        private final class NewUserAction extends AbstractAction{
             public NewUserAction(){
                 super("New User");
             @Override
             public void actionPerformed(ActionEvent e){
                 JFrame newuser = new JFrame("NewUser");
        private final class ForgotPassword extends AbstractAction{
            public ForgotPassword(){
                super("Forgot Password");
            @Override
            public void actionPerformed(ActionEvent e){
                JFrame forgotpassword = new JFrame("Forgot Password");
        public static void main(String args[]) {
            new oracle();
         FDoptions.java
    import java.awt.FlowLayout;
    import java.awt.BorderLayout;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.BorderFactory;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    public class Fdoptions{
        private JFrame fdoptions;
        private JPanel fdoptpanel;
        private JButton enterfdbutton;
        private JButton viewfdbutton;
        public Fdoptions() {
            initComponents();
        private final void initComponents(){
            fdoptpanel = new JPanel(new BorderLayout());
            fdoptpanel.setBorder(BorderFactory.createEmptyBorder(80,50,80,50));
            enterfdbutton = new JButton(new EnterFDAction());
            viewfdbutton = new JButton(new ViewFDAction());
           JPanel enterbuttonpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
           JPanel viewbuttonpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
            enterbuttonpanel.add(enterfdbutton);
            viewbuttonpanel.add(viewfdbutton);
            fdoptpanel.add(enterbuttonpanel,BorderLayout.NORTH);
            fdoptpanel.add(viewbuttonpanel,BorderLayout.SOUTH);
            fdoptions = new JFrame("FD Options");
            fdoptions.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            fdoptions.setSize(1000,1000);
            fdoptions.setContentPane(fdoptpanel);
            fdoptions.pack();
            fdoptions.setVisible(true);
        private void performEnter(){
        private void performView(){
        private final class EnterFDAction extends AbstractAction{
            public EnterFDAction(){
                super("Enter new FD");
            public void actionPerformed(ActionEvent e){
                performEnter();
        private final class ViewFDAction extends AbstractAction{
            public ViewFDAction(){
                super("View an existing FD");
            public void actionPerformed(ActionEvent e){
                performView();
        public static void main(String args[]){
            new Fdoptions();
    }

    nice day,
    these lines..., despite the fact that this example is about something else, shows you two ways
    1/ modal JDialog
    2/ two JFrame
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    * Parent Modal Dialog. When in modal mode, this dialog
    * will block inputs to the "parent Window" but will
    * allow events to other components
    * @see javax.swing.JDialog
    public class PMDialog extends JDialog {
        private static final long serialVersionUID = 1L;
        protected boolean modal = false;
        private WindowAdapter parentWindowListener;
        private Window owner;
        private JFrame blockedFrame = new JFrame("No blocked frame");
        private JFrame noBlockedFrame = new JFrame("Blocked Frame");
        public PMDialog() {
            noBlockedFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            noBlockedFrame.getContentPane().add(new JButton(new AbstractAction("Test button") {
                private static final long serialVersionUID = 1L;
                @Override
                public void actionPerformed(ActionEvent evt) {
                    System.out.println("Non blocked button pushed");
                    blockedFrame.setVisible(true);
                    noBlockedFrame.setVisible(false);
            noBlockedFrame.setSize(200, 200);
            noBlockedFrame.setVisible(true);
            blockedFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
            blockedFrame.getContentPane().add(new JButton(new AbstractAction("Test Button") {
                private static final long serialVersionUID = 1L;
                @Override
                public void actionPerformed(ActionEvent evt) {
                    final PMDialog pmd = new PMDialog(blockedFrame, "Partial Modal Dialog", true);
                    pmd.setSize(200, 100);
                    pmd.setLocationRelativeTo(blockedFrame);
                    pmd.getContentPane().add(new JButton(new AbstractAction("Test button") {
                        private static final long serialVersionUID = 1L;
                        @Override
                        public void actionPerformed(ActionEvent evt) {
                            System.out.println("Blocked button pushed");
                            pmd.setVisible(false);
                            blockedFrame.setVisible(false);
                            noBlockedFrame.setVisible(true);
                    pmd.setVisible(true);
                    System.out.println("Returned from Dialog");
            blockedFrame.setSize(200, 200);
            blockedFrame.setLocation(300, 0);
            blockedFrame.setVisible(false);
        public PMDialog(Dialog parent, String title, boolean isModal) {
            super(parent, title, false);
            initDialog(parent, title, isModal);
        public PMDialog(Frame parent, String title, boolean isModal) {
            super(parent, title, false);
            initDialog(parent, title, isModal);
        private void initDialog(Window parent, String title, boolean isModal) {
            owner = parent;
            modal = isModal;
            parentWindowListener = new WindowAdapter() {
                @Override
                public void windowActivated(WindowEvent e) {
                    if (isVisible()) {
                        System.out.println("Dialog.getFocusBack()");
                        getFocusBack();
        private void getFocusBack() {
            Toolkit.getDefaultToolkit().beep();
            super.setVisible(false);
            super.pack();
            super.setLocationRelativeTo(owner);
            super.setVisible(true);
            //super.toFront();
        @Override
        public void dispose() {
            owner.setEnabled(true);
            owner.setFocusableWindowState(true);
            super.dispose();
        @Override
        @SuppressWarnings("deprecation")
        public void hide() {
            owner.setEnabled(true);
            owner.setFocusableWindowState(true);
            super.hide();
        @Override
        public void setVisible(boolean visible) {
            boolean blockParent = (visible && modal);
            owner.setEnabled(!blockParent);
            owner.setFocusableWindowState(!blockParent);
            super.setVisible(visible);
            if (blockParent) {
                System.out.println("Adding listener to parent ...");
                owner.addWindowListener(parentWindowListener);
                try {
                    if (SwingUtilities.isEventDispatchThread()) {
                        System.out.println("EventDispatchThread");
                        EventQueue theQueue = getToolkit().getSystemEventQueue();
                        while (isVisible()) {
                            AWTEvent event = theQueue.getNextEvent();
                            Object src = event.getSource();
                            if (event instanceof ActiveEvent) {
                                ((ActiveEvent) event).dispatch();
                            } else if (src instanceof Component) {
                                ((Component) src).dispatchEvent(event);
                    } else {
                        System.out.println("OUTSIDE EventDispatchThread");
                        synchronized (getTreeLock()) {
                            while (isVisible()) {
                                try {
                                    getTreeLock().wait();
                                } catch (InterruptedException e) {
                                    break;
                } catch (Exception ex) {
                    ex.printStackTrace();
                    System.out.println("Error from EDT ... : " + ex);
            } else {
                System.out.println("Removing listener from parent ...");
                owner.removeWindowListener(parentWindowListener);
                owner.setEnabled(true);
                owner.setFocusableWindowState(true);
        @Override
        public void setModal(boolean modal) {
            this.modal = modal;
        public static void main(String args[]) {
            new PMDialog();
    }

  • TS3297 I keep getting the error 306 cannot connect to the iTunes Network when downloading songs on iTunes. I've tried all the troubleshooting steps from the forums and my technical issues are still unresolved. I have Windows 7. Please help!!

    I keep getting the error 306 cannot connect to the iTunes Network when downloading songs on iTunes. I've tried all the troubleshooting steps from the forums and my technical issues are still unresolved. I have Windows 7. Please help!!

    iTunes Store loads partially or returns "Error 306" or "Error 10054"
    Proxies, parental control settings and software, security or filtering software, or a bad iTunes Store cache can cause this.
    To address proxies, Remove Internet Options proxy settings  ( http://support.apple.com/kb/TS1490 ) and connect to the Internet without a proxy.
    To reset iTunes Store cache:
    In iTunes, choose iTunes > Preferences (Mac) or Edit > Preferences (PC).
    Click the Advanced tab.
    Click the "Reset cache" button.
    Click OK and see if the issue is resolved.
    Adjust Parental Controls in iTunes:
    Open iTunes.
    Access iTunes preferences:
    On a Mac: From the iTunes menu, choose Preferences.
    On a Windows PC: From the Edit menu, choose Preferences.
    Click the Parental Controls tab.
    Remove restrictions on Parental Controls.
    For more information on parental controls or content filtering software, see iTunes 10.5 for Windows: May see performance issues and blank iTunes Store.
    http://support.apple.com/kb/TS4123?viewlocale=en_US

  • Calling C Functions in existing DLL's from Java

    Hi Guys ,
    The tutorial in this site talks about creating ur own DLL's and then calling them from Java . I need to call C functions in existing DLL's from Java . How do I go about doing this ? . Any help on this would be much appreciated.
    regards
    murali

    What you are interested in can be done with what's called "shared stubs", from the JNI book (http://java.sun.com/products/jdk/faq/jnifaq.html), although you don't need the book to do it (I didn't).
    The example code will call functions with any number and kind of parameters, but doing that requires some assembly language. They supply working examples for Win32 (Intel architecture) and Solaris (Sparc).
    If you can limit yourself to functions to a single function signature (number and types of parameters), or at least a small set that you know you'll call at compile time, you can modify the example so that the assembly language part isn't needed, just straight C code.
    Then you'll have one C library that you compile and a set of Java classes and you can load arbitrary functions out of arbitrary dynamic libraries. In my case you don't even have to know what the libraries and functions are ahead of time, the user can set that up in a config file.
    You mentioned doing this with Delphi. One thing to watch out for is C versus Pascal (Win32) function calling convention. A good rule of thumb; if it crashes hard, you probably picked the wrong one, try the other. :-)

  • How to call a function in one .js file from another .js file

    Hello Techies,
    I am trying to call a function in two.js file from one.js file.
    Here is my code
    one.js
    <script>
    document.write("<script type='text/javascript' src='/htmls/js/two.js'> <\/script>");
         function one()
                        var a;
                       two(a);
              }two.js
                  function two(a)
                          alert("two");
                      }But the function two() is not working.
    How can I do this one??
    regards,
    Krish

    I think there is a syntax error in line
    document.write("<script type='text/javascript' src='/htmls/js/two.js'> <\/script>");
    end tag <\/script> is wrong.

  • Calling a function in a flex app from a loaded SWF

    How can I call a function in a flex application from a loaded
    swf file?

    Two ways:
    Application.application returns a reference to the top-level
    application scope. You can access any public member, var, function,
    component, etc through that reference.
    Dispatch an event event form the loaded swf and use a event
    handler in the main app. All the gurus advise this as best
    practice, to ensure "loose coupling" It is also pretty easy,
    especially if you use a bubbling event.
    Tracy

  • Calling parent method from within child object

    Hello,
    A quick question! Is it possible to call a method in a parent object from within a child object.By child object I mean an object that was instantiated within the parent object.
    Thanks.

    A quick question! Is it possible to call a method in a
    parent object from within a child object.By child
    object I mean an object that was instantiated within
    the parent object.Since you are using ambiguous terminology, it would be much better if you provided a small sample of your code to avoid confusion. I am guessing that you are actually talking about an inner class when you say child class.
    If that is correct, then you can do something like this:
    class Parent {
      void foo() {}
      void bar() {}
      class Child {
        void foo() {}
        void test() {
          bar(); // No conflicts, just call the Parent method
          Parent.this.foo(); // Use explicit qualification to avoid conflicts.

  • Is there a way to open a new window from the "Go" menu in Mavericks?

    Before Mavericks, I was able to go from the Finder to the top menu "Go" -> "Utilities", or Applications or Home… and a new window would open.
    Now I have to manually open a new window to avoid loosing my existing window.
    Is there a way to open a new window from the "Go" menu?

    Before Mavericks, I was able to go from the Finder to the top menu "Go" -> "Utilities", or Applications or Home… and a new window would open.
    Now I have to manually open a new window to avoid loosing my existing window.
    Is there a way to open a new window from the "Go" menu?
    First, as others have already stated.....make sure the checkbox is deselected for "open folders in tabs instead of windows" in Finder Preferences.
    If you're like me and don't like tabs very much, there is a way to make folders always open in windows with a simple click (I'm using Mavericks 10.9.5).  Go to a root folder (for example, the Documents Folder), open it, and select View > Hide Toolbar, then all folders within that root folder will open in a new window.
    As an alternative method, any folder can be opened in a new window by holding down either Command Key while clicking the folder. But sooner or later you will forget to hold down that key, and then clicking on a folder will open in a tab (which will automatically resize the window and cause much aggravation).
    The Hide Toolbar trick will also work with any folder present on the Desktop. It will make all folders inside that folder open in new windows.
    To make the Applications Folder open in a new window when opening it from the menu bar at the top of the screen, you will have to open the main hard drive folder and use the Hide Toolbar trick. This will cause all folders inside it to open in new windows.
    Hope this helps.

  • I attempt to open a second window from the icon but it does not open then when firefox is closed it will not reopen because it is still running in processes but no window displayed until you kill the process and then restart firefox.

    I attempted to open a new window from the Firefox icon but nothing happens. I then went on browsing and closed Firefox but was later unable to open it. I checked processes and it was already running but there was no window displayed. I am running Windows 7 Professional.
    This is repeated any time I already have the browser open and wish to open a second instance.

    '''<u>Open a second window (not a second tab, that is different) when Firefox is already running and displayed on the monitor</u>'''
    *Firefox button > New Tab > New Window
    *CTRL+N
    *'''''If using the Menu Bar''''': File > New Window
    **To '''''temporarily''''' display and make choices from the Menu Bar press the ALT key or the F10 key
    **Also see: https://support.mozilla.com/en-US/kb/Menu%20bar%20is%20missing
    '''<u>Firefox "hang on exit"</u>'''
    #Stop the Firefox process:
    #*[http://kb.mozillazine.org/Kill_application Mozillazine - Kill application]
    #*Windows 7 users click [http://www.techrepublic.com/blog/window-on-windows/reap-the-benefits-of-windows-7s-task-manager/2576 here]
    #Why Firefox may hang:
    #*[http://support.mozilla.com/en-US/kb/Firefox+hangs Firefox hangs] (see Hang at exit)
    #*[http://kb.mozillazine.org/Firefox_hangs Firefox hangs (Mozillazine)] (see Hang at exit and Closing Firefox properly)
    #*[https://support.mozilla.com/en-US/kb/Firefox+is+already+running+but+is+not+responding Firefox is already running but is not responding]
    #Use Firefox Safe Mode to find a problem with an Extension or Plugin:
    #*Don't check anything when entering Safe Mode, just continue
    #*If the problem does not occur in Safe Mode it is probably and Extension or Plugin causing the problem
    #*See:
    #**[[Safe Mode]] and [http://kb.mozillazine.org/Safe_Mode Safe Mode (Mozillazine)]
    #**[http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes Troubleshooting extensions and themes]
    #**[http://support.mozilla.com/en-US/kb/Troubleshooting+plugins Troubleshooting plugins]
    #**[http://support.mozilla.com/en-US/kb/Basic+Troubleshooting Basic Troubleshooting]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • TS1424 HELLO! whenever i try to access the itunes store from the itunes on my laptop i get this message: ITUNES HAS STOPPED WORKING a problem caused the program to stop working correctly. windows will close the program and notify if a solution is availabl

    for a few weeks i have not been able to access the itunes store from the itunes on my laptop. every time i click on it it tells me it cannot access the store...not sure why. and says this: ITUNES HAS STOPPED WORKING a problem caused the program to stop working correctly. windows will close the program and notify if a solution is available.

    I had this exact same problem.  I found this fix and it worked for me. 
    Step 1:
    Browse to C:\Program Files (x86)\Common Files\Apple\Apple Application Support and copy the filen named QTMovieWin.dll. 
    Step 2:
    Browse and past that file into C:\Program Files (x86)\iTunes.
    Hope this helps you.  I wish I could remember where I saw this originally so I could thank them.
    Good Luck.
    Anthony

Maybe you are looking for

  • HP F380 All in one printer 64 bit driver fails to install

    I have a HP F380 All in one printer. I donwloaded the driver for Windows 7 (64 bit). The installation program abbruptly dies with an error  Please advise how I should proceed now.

  • Unable to create webservice system!!!

    Hi Friends, I am using SAP NetWeaver 2004s Visual Composer SP 08. My problem is, No matter whatever WSDL url i give to create the WebService System in the VC its throwing me the error '<i>Invalid Web Service URL: http://ws.invesbot.com/stockquotes.as

  • Drop-Ship Warehouses

    Hi! I wanted to ask an opinion: 1) You can use a Drop-Ship Warehouse in a credit note to pay the incentives for Business Partners (so as not to move the stock )? 2) What problems could there be in the accounts?

  • PutClientProperty("JTree.lineStyle", "Angled") in JDK 1.4.2

    In 1.4.2 the look of the tree has been updated to remove the ---- line handles on the tree by default. I would like to continue displaying those as they appeared in earlier versions without using the older classic windows look and feel for the rest o

  • Converting AS3 to AS2. Some movieclip buttons not working.

    25 movieclip buttons in frame 126 maintimeline. Buttons are on top layer above all other content. Buttons 1_1, 2_1, 3_1, 4_1, and 5_1 work. All buttons have correct instance name. The buttons are in a 5x5 grid. Hence the naming convention of column_r