Topic: Back links close window

I open my locally hosted FrontAccounting (v2.3.17) in a popup window generated as follows

<a href="javascript:void(0)" onclick="window.open('https://frontaccounting.myhomeserver.net','FrntAcc','scrollbars=yes,height=569,width=1032,left=1706,top=430');return false;">FrontAccounting</a>

Whenever I click on any of the "Back" links, my FrontAccounting window closes. This is happening in both Firefox (v22.0) and Chrome (Version 28.0.1500.71 m).

Any ideas how to fix this?

Many thanks.

Re: Back links close window

If you open FA in a popup window, this will happen. It is done inside a JavaScript routine.

/Joe

Re: Back links close window

Joe,

Is that to say it can't be fixed, or is that just why it's happening? Is such a thing a browser restriction or a code feature?

Re: Back links close window

This is the way FA works. FA was necer planned to be used in a popup window.

Joe

5 (edited by Strongman 08/17/2013 09:00:38 pm)

Re: Back links close window

FA was necer planned to be used in a popup window.

For you maybe.

Though I've found the code that controls this behaviour I can prevent the back links from closing my popup window, but at the expense of the close links not working.

I've no idea about javascript so I'm not sure how to get both to work. If there are no adverse affects by allowing both, could you, Joe, or someone with the right experience, provide the code that would work?

Currently it's...

function goBack(deep) {
    if (window.opener)
     window.close();
    else
     window.history.go(deep || -1);
}

Many thanks.

Re: Back links close window

@Strongman
Back link is FA navigation element which is designed to close popup windows. This is our design decision, and rationale here is rather obvious. All over the FA application popups are used as temporary windows opened to allow user some operations (transaction viewing, customer edition or selection etc) without abandoning current form in main browser window. Therefore in popup windows Back link  just abandon the auxiliary operation and return to main window, where the popup was triggered.
Janusz

Re: Back links close window

@itronics
I understand what's happening and why you choose to use popups and have them close to return to the main working window. I guess I'm wondering why you chose to use the same function for back and close. Is it not possible to write a function that allows both to happen for someone who chooses to run FA in a popup?

It's certainly not a big problem for me, and if you can't or won't change it I'll still use FA, but because I use popup windows a lot - I don't need every window to have menu, bookmarks, etc. - I opened this thread because I thought it was a bug because I've never had this problem before. Now I understand it's a design decision, but I feel that it must be possible to do both, if the code were changed. So I ask again, if there are no adverse affects by allowing both, could you, Joe, or someone with the right experience, provide the code that would work? You don't have to change the application for everyone, I'll just change the code in my little setup, and the solution can be available here to anyone else wanting the same ability.

Thanks again.

Re: Back links close window

Some pages are used in FA both in main and popups windows, so the 'Back' link have to support both situations differently (see customer_inquiry.php which is available under 'Customer Transactions'  menu option, and used in popup under  'Current Credit' link in Direct Sales Invoice).

If you can provide a patch ready to apply on current FA code, which would be both usefull for you and would not interfere with current user interface, we will consider integrate it in the next FA release.

Janusz