When I try to click on the Report As link, I get an error:
Cannot GET report_as.html.
I have a directory structure as follows:
In customer.html, I have the following code:
// in constructor
// this.reportAsLink = 'report_as.html?aris_id=';
this.reportAsLink = 'http://aris2.myaris.net/report_as.pl?aris_id=';
window.open('./report_as.html?aris_id=' + aris_id, 'ReportAs',
+ ((screen.height/2) - (500/2) - 75) + ', left=' + ((screen.width/2) - (675/2))
The permissions on both customer and report_as are the same, but I can’t figure out why I get an error when trying to load this page?
Are you sure you’re serving the actual HTML file from your server? It seems like you want to forward the user to a pop-up of a components HTML. But these typically get bundled inside the resulting js files. Which bundler are you using?
By bundler, do you mean webpack vs something else?
If so, I am using webpack.
Is there a better way to serve an html file into a popup that you know of? I’ve tried googling, but I have not hit upon the right search terms to return answers.
Not that easy I fear. The trouble is that as seen by your example you’d like to navigate to a page in the pop-up that is also Aurelia enhanced. So essentially the bootstrap/enhance needs to happen there as well.
Take a look here for perhaps a few more inputs How to open and syncronize a pop-up window?
Is there a reason this has to be a window pop-up? From the name I expect this to be a report, perhaps a PDF file or such. Could you describe your use case?
Thanks for that link. I will give it a look.
My use case:
I have a form at the top of the page that you can enter a customer ID into.
It then loads a page of info on the customer.
There’s a Report As field that links it to other customers.
When you click on that link, it should open a small html page that shows all the other customers, each with a url to link to that customer.
So does it necessarily have to be a new window pop-up/tab? Could you instead display the info in an inline dialog using aurelia-dialog?
Oh that is a good idea - I was thinking about this last night too.
I’ve got some other popups that I need to figure out how to handle. Even if it’s just another tab on the page.
Yeah perhaps give that a try. It should be also easier to handle for you since you can pass all the necessary data along with params like the id to dialog. Refer for that to the official docs http://aurelia.io/docs/plugins/dialog#using-the-plugin
Let us know how this went. From an UX standpoint a dialog is typically always preferred to a native window pop-up. So it would be great if this works out for you