Only one window open

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kamyk

    Only one window open

    Hello all again!

    On the main form I have a few fields and among of them there is button which
    opens additional window (named "Links") where user can delete and add data
    from the database.
    I want this user let open (from the main form) only one subform "Links". I
    hope you know what I mean. An example of my idea is Winamp program, which in
    the default version opens only once and
    when somebody wants to open two Winamp programs in the same time it is
    rather impossible or settings change is then needed. I do not even know in
    what language it is possible to do, maybe in javascript.

    Thank you in advance for your posts
    Best and kind regards
    Marcin from Poland



  • kaeli

    #2
    Re: Only one window open

    In article <d0n81s$8mq$1@n ews.onet.pl>, marcinzmyslowsk i@poczta.onet.p l
    enlightened us with...[color=blue]
    > On the main form I have a few fields and among of them there is button which
    > opens additional window (named "Links") where user can delete and add data
    > from the database.
    > I want this user let open (from the main form) only one subform "Links". I
    > hope you know what I mean. An example of my idea is Winamp program, which in
    > the default version opens only once and
    > when somebody wants to open two Winamp programs in the same time it is
    > rather impossible or settings change is then needed. I do not even know in
    > what language it is possible to do, maybe in javascript.
    >[/color]

    Is this an application for the web, a GUI written in Java, a .NET
    application, or...?
    Winamp is written for Windows. It is not an internet application. It can
    directly integrate with Windows API calls.

    This is not feasible for the internet (which is by it's very nature
    stateless). The others, sure, but not with javascript (unless you're talking
    ..net, and even then C# would be better for a windows forms app).

    Honestly, you should code your back end so that multiple instances don't kill
    it, regardless of front-end GUI. Make your back-end robust, scalable, and not
    easily killed. Anything else will get you into trouble later.

    --
    --
    ~kaeli~
    What if the Hokey Pokey IS what's it's all about?



    Comment

    • RobG

      #3
      Re: Only one window open

      kaeli wrote:[color=blue]
      > In article <d0n81s$8mq$1@n ews.onet.pl>, marcinzmyslowsk i@poczta.onet.p l
      > enlightened us with...
      >[color=green]
      >>On the main form I have a few fields and among of them there is button which
      >>opens additional window (named "Links") where user can delete and add data
      >>from the database.
      >>I want this user let open (from the main form) only one subform "Links". I
      >>hope you know what I mean. An example of my idea is Winamp program, which in
      >>the default version opens only once and
      >>when somebody wants to open two Winamp programs in the same time it is
      >>rather impossible or settings change is then needed. I do not even know in
      >>what language it is possible to do, maybe in javascript.
      >>[/color]
      >
      >
      > Is this an application for the web, a GUI written in Java, a .NET
      > application, or...?
      > Winamp is written for Windows. It is not an internet application. It can
      > directly integrate with Windows API calls.[/color]
      [...]

      I think you may have missed the point. My reading is that the
      OP is looking for a re-usable pop-up window and that WinAmp was
      used as an example of a program that if you try to start a
      second instance, it just keeps using the current one.

      There is a thread here that may help:

      <URL:http://groups-beta.google.com/group/comp.lang.javas cript/browse_frm/thread/bec21b9a095818c a/104e8bcd2f0b46b 5?q=reuse+popup +window#104e8bc d2f0b46b5>

      or search this new group for:

      "Closing a popup before opening another"


      --
      Rob

      Comment

      • Tomasz Cenian

        #4
        Re: Only one window open

        Kamyk napisa³(a):[color=blue]
        > Hello all again!
        >
        > On the main form I have a few fields and among of them there is button which
        > opens additional window (named "Links") where user can delete and add data
        > from the database.
        > I want this user let open (from the main form) only one subform "Links". I
        > hope you know what I mean.[/color]

        <button onclick="if (!w) w=window.open() ">Open</button>

        To things:
        1. make sure variable 'w' is declared before this function gets triggered

        2. Additional code (and not 100% reliable) is needed if you want the
        user to be able to reopen the popup window after once closing it.




        --
        tomasz cenian tcenian at wa dot home dot pl
        :::: :: : : http://cenian.boo.pl : : :: ::::

        Comment

        • Tomasz Cenian

          #5
          Re: Only one window open

          Kamyk napisa³(a):[color=blue]
          > Hello all again!
          >
          > On the main form I have a few fields and among of them there is button which
          > opens additional window (named "Links") where user can delete and add data
          > from the database.
          > I want this user let open (from the main form) only one subform "Links". I
          > hope you know what I mean.[/color]

          <button onclick="if (!w) w=window.open() ">Open</button>

          Two things:
          1. make sure variable 'w' is declared before this function gets triggered

          2. Additional code (and not 100% reliable) is needed if you want the
          user to be able to reopen the popup window after once closing it
          (without refreshing the main window)


          --
          tomasz cenian tcenian at wa dot home dot pl
          :::: :: : : http://cenian.boo.pl : : :: ::::

          Comment

          • kaeli

            #6
            Re: Only one window open

            In article <V8SXd.247$Zn.1 7972@news.optus .net.au>, rgqld@iinet.net .auau
            enlightened us with...[color=blue]
            >
            > I think you may have missed the point. My reading is that the
            > OP is looking for a re-usable pop-up window and that WinAmp was
            > used as an example of a program that if you try to start a
            > second instance, it just keeps using the current one.[/color]

            But if I start a second window in IE, it *will* allow 2 (or more) instances
            of that page.
            I think the OP was looking for a singleton instance, which simply cannot be
            100% ensured in a web app (at least I haven't found of a way or heard of
            one...).

            Perhaps I musunderstood the question. I do that sometimes.

            --
            --
            ~kaeli~
            "No matter what happens, somebody will find a way to take
            it too seriously."



            Comment

            Working...