Window.open now opens new window 'behind' current one

Posted by: tazardou on 8 September 2017, 8:43 am EST

  • Posted 8 September 2017, 8:43 am EST

    Hi,

    To my knowledge, I didn’t change anything, except load v 2.0 of farpoint, but now my popup windows immediately popup ‘behind’ my main form.  This is not good.



    Nothing special about my code:

    newwindow=window.open(‘renameform.aspx’,‘rename’,‘width=490,height=400,left=100,top=100,screenX=100,screenY=100’);



    Taz

  • Posted 8 September 2017, 8:43 am EST

    Taz,



    How are the new windows being opened? What event are you using to trigger them opening? How dows Spread Web 2 have anything to do with this?

  • Posted 8 September 2017, 8:43 am EST

    Scott,



    What event are you using to trigger them opening?

    The mouse doubleclick is the trigger.



    How are the new windows being opened?

    function myOnload() {

    var ss = document.all(“FpSpread1”);

    ss.ondblclick = MyDblClick;

    FpSpread1.onDataChanged = dataChanged;

    FpSpread1.onSelectionChanged = dataChanged;

    FpSpread1.onmousedow = selectcell;

    FpSpread1.onChange = cmbochange;

    }



    var newwindow;

    function MyDblClick() {

    var ss = document.all(“FpSpread1”);

    FpSpread1.onChange = cmbochange;

    ss.ondblclick = MyDblClick;

    //FpSpread1.onDataChanged = dataChanged;

    FpSpread1.onmousedow = selectcell;



      var c = ss.ActiveCol;

      var r = ss.ActiveRow;

      var span = ss.all(“FpSpread1_colHeader”);

      var t = span.firstChild; //table of column headers

      var header;



        var row=event.srcElement.parentElement.rowIndex - 1;

        var col=event.srcElement.cellIndex ;

        if(row==-1)

        {

          header = t.rows(0).cells(col).innerText;

          document.cookie = “oname=” + escape(header) + “;”;

                window.open(‘renameform.aspx’,‘mywindow’,‘width=490,height=400,left=100,top=100,screenX=100,screenY=100’);

        }

    }





    How does Spread Web 2 have anything to do with this?

    As I stated in the original text, to my knowledge nothing has changed, EXCEPT  the version of farpoint.



    Taz

  • Posted 8 September 2017, 8:43 am EST

    Taz,



    I was able to reproduce the problem. The problem is a bug in Spread. We are making the first cell active in the column when you double click on the Spread. I have written this up as a bug in the Spread for the development team to fix for the next maintenance release.



    For now, yuo can map the ondblclick for the document instead of the Spread and it will work for you.



    document.ondblclick = MyDblClick;

     

  • Posted 8 September 2017, 8:43 am EST

    Scott,

    I am glad you were able to reproduce the behavior, however, I replaced my

    ss.ondblclick = MyDblClick;

    with

    document.ondblclick = MyDblClick;

    and the popup still opened behind the main window.



    You should see the same effect from the project I sent you.

    However, please let me know if you do.  I suppose I should uninstall 2.0 and use 1.07 in lieu of a solution.



    Taz

  • Posted 8 September 2017, 8:43 am EST

    Taz,



    With the project you sent, I am seeing the window pop on top (with the 2.0 version). I am wondering if this is because of the combobox control that is being used in the control is keeping the Spread editor from being created on the double click (like in my test project I was using). Could you tell me the steps to reproduce the problem in the test project you sent?

  • Posted 8 September 2017, 8:43 am EST

    Scott,

    Specfically what I do is double click on one fo the recently added columns to change its’ name.  If I click on the first column (label Events) the window stays in front.

    Have you tried double clicking on a column header of the just created column?



    Taz

  • Posted 8 September 2017, 8:43 am EST

    Hello,



    I had not tested on the added column before. I tested it and it is having the problem. Mapping the document ondblclick event did not work for me as a work around. This bug should be fixed in the next maintenance release of Spread for Web Forms.

  • Posted 8 September 2017, 8:43 am EST

    Scott,

    Per our discussion yesterday I am trying the work around for this issue by issuing the following statement at the time I create the new column.

    (This is an attempt to lock the column header (row -1) so that we don’t drop into editmode when the user double clicks on the header.  cells in the remaining column (rows 0 and up) should remain unlocked so the users can make changes, but the user never needs to do anything the header except double click, at which point a new window pops up to guide the user into renaming the header.)



    FpSpread1.Cells(-1, fpcol).Locked() = True



    When I do this, I get an error that states:

    Invalid row index: -1 (must be between 0 and 4)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.



    Exception Details: System.IndexOutOfRangeException: Invalid row index: -1 (must be between 0 and 4)



    What this tells me, is that I can not lock the header row.  Since there is the header row (-1) and five ‘data’ rows (0 thru 4) in this instance.  Is this correct?  And if so, then am I to assume that this workaround will not work?



    taz

  • Posted 8 September 2017, 8:43 am EST

    Tax,



    That line of code is not correct. What I mentioned on the phone was to lock the entire column. But, locking just the first row’s cell should be enough. So, try this with one of the following two lines of code.



    FpSpread1.Columns(fpcol).Locked() = True



    FpSpread1.Cells(0, fpcol).Locked() = True



  • Posted 8 September 2017, 8:43 am EST

    Hi Scott,

    Thanks for the additional suggestions.



    I used:



    FpSpread1.Cells(0, fpcol).Locked() = True



    and it works for us.



    Taz

  • Posted 8 September 2017, 8:43 am EST

    Scott,



    I have the same probalem with different scienario. Spread sheet is one of the control on the form and all the cells are button celltype. My application is trying to open a new window when any button is clicked.



    Ying

  • Posted 8 September 2017, 8:43 am EST

    This looks like the same problem.  I will reply to the email message you sent to fpsupport@fpoint.com after I do some more testing with the code you sent.

  • Posted 14 October 2018, 4:59 pm EST

    It is good to know that window.open now opens new window ‘behind’ current one as it makes our work easy & also save lots of time. But still anyone want to know about its process then i recommend you to read this Blog once:

    https://www.windowstechnicalsupportnumbers.com/, to get more information.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels