PDA

View Full Version : Basic problem with UIView



David Grossi
29 Dec 2009, 7:06 AM
Hi,

I'm trying to use ext.nd to web enable an existing application.
I'm using an extremely simple code as a beginning, and everything seems to work well :
- my outline is converted
- my views are converted but...
... nothing appear in the columns.

This "small" detail made me busy all the day... and I could not troubleshoot it myself, so I'm trying the forum help ! A little clue would be appreciated.

Here is the simple code used in the JS Header of my 'main.html' page :


var ExtndApp = function() {
return {
init : function(){
this.ui = new Ext.nd.DominoUI({
uiOutline : {
outlineName: 'Documents'
},
uiView : {
viewName: 'Navigation_User',
viewTitle: 'My first view',
count: 10,
showSearch: false
}
});
} // init
} // return
}();

Ext.onReady(ExtndApp.init, ExtndApp, true);

The screenshot shows an attempt with a categorized view, but the problem occurs with any views, even the flat ones.
Same problem with Internet Explorer / Firefox.
No errors shown in debug.
No errors in Domino console.

Environment :
- Extnd_b3.nsf
- Domino 7.0

Any idea ?


Best regards.

David Grossi
29 Dec 2009, 7:30 AM
Finally found the problem, but I can't explain "why".

It comes from the HTML Head declarations.

If I point to the extnd-all.js included in the extnd_b3.nsf database like THIS, it doesn't work :

...
"<script type='text/javascript' src='" + extndUrl + "extnd/3x/extnd-all" + debugExtND + ".js'></script>" + @NewLine + ...

If I create an extnd directory in the html directory of domino, and then add the extnd-all.js library in it, like THIS, then it works :
...
"<script type='text/javascript' src='http://192.168.0.2/extnd/extnd-all" + debugExtND + ".js'></script>" + @NewLine +...


Note that I've checked with the source code of the generated page that the first way using "extndUrl" variable returns a valid link (with Chrome, when you check the source code of the page, you can click on the links to check if they're valid).

I now wonder what's the difference between the 2 methods, and why the first one is not OK.

Cheers.

jratcliff
30 Dec 2009, 9:27 AM
Finally found the problem, but I can't explain "why".

It comes from the HTML Head declarations.

If I point to the extnd-all.js included in the extnd_b3.nsf database like THIS, it doesn't work :

...
"<script type='text/javascript' src='" + extndUrl + "extnd/3x/extnd-all" + debugExtND + ".js'></script>" + @NewLine + ...

If I create an extnd directory in the html directory of domino, and then add the extnd-all.js library in it, like THIS, then it works :
...
"<script type='text/javascript' src='http://192.168.0.2/extnd/extnd-all" + debugExtND + ".js'></script>" + @NewLine +...


Note that I've checked with the source code of the generated page that the first way using "extndUrl" variable returns a valid link (with Chrome, when you check the source code of the page, you can click on the links to check if they're valid).

I now wonder what's the difference between the 2 methods, and why the first one is not OK.

Cheers.

So in the case where it does not work you are pointed to the extnd-all.js file in the DATABASE and in the case where it does work you are pointed to the extnd-all.js file on the FILE SYSTEM?

So what is the ACL to the database? Maybe that is the issue?

David Grossi
30 Dec 2009, 9:49 AM
Exact, Jack, you understood exactly what I mean, despite my * very poor * English.

ACL =
**************************
Anonymous : no access
Default : reader
David Grossi (me ;-) : Manager
**************************

I'm logged in with *myself* while performing my tests.


What's strange is the following. When I'm looking at the source code with Chrome, the url links to the js files are highlighted and active :

>> if I'm using the FILE SYSTEM method, clicking on the link directly opens the javascript extnd-all.js

>> if I'm using the DATABASE method, clicking on the link asks me if I want to download the javascript file instead of opening it.

I guess the problem is somewhere here, but I can't understand exactly what's wrong.

TY@GP
10 Jan 2010, 12:04 PM
Are you sure the extndUrl is filled correctly? (because this is the most common problem I hear on this site).
What do you see when you enter the url to the js in de nsf from the browser directly

David Grossi
10 Jan 2010, 9:04 PM
Hello,

When I enter directly the URL of the JS file contained in the NSF, I see a "download" window asking me if I want to download the js file. If I accept, the JS file is downloaded correctly from the NSF database.

Instead, if I'm using the URL that point to the js file which is in the data\domino\html folder, I can see the javascript opened directly in the browser.


I still haven't found how to "not" have the download window when I point to the NSF database, but as the moment, it's not a real problem as I can work accessing the js file of the file system instead.

Thank you for your help.

jratcliff
11 Jan 2010, 7:18 AM
Hello,

When I enter directly the URL of the JS file contained in the NSF, I see a "download" window asking me if I want to download the js file. If I accept, the JS file is downloaded correctly from the NSF database.

Instead, if I'm using the URL that point to the js file which is in the data\domino\html folder, I can see the javascript opened directly in the browser.


I still haven't found how to "not" have the download window when I point to the NSF database, but as the moment, it's not a real problem as I can work accessing the js file of the file system instead.

Thank you for your help.

You shouldn't get the download window when the js is loaded via a script tag on the form/page. So what you can do is use something like FireBug and look at the Net tab to see if there are any 404 (resource not found) errors. Or, simply do a view source on your page/form and verify that the urls for the src attribute for each script tag is correct when pointed to the database.

Also, if you want, do you have a public site that I can look at this for you?

Zakaroonikov
11 Jan 2010, 3:13 PM
You are best to make your image, css and JS files anonymously accessible if possible. It may save round trips to the server. You can also try setting the mime type of the individual resource to text/javascript in the domino designer. Sometimes I have found the HTTP server gets confused so perhaps a restart if you can.

David Grossi
12 Jan 2010, 12:04 AM
You are best to make your image, css and JS files anonymously accessible if possible. It may save round trips to the server. You can also try setting the mime type of the individual resource to text/javascript in the domino designer. Sometimes I have found the HTTP server gets confused so perhaps a restart if you can.

The download window disappear if I set the js file to text/javascript type !
I would never have search here, for sure...

Thank you Zakaroonikov, thank you Jack.

jratcliff
12 Jan 2010, 7:07 AM
The download window disappear if I set the js file to text/javascript type !
I would never have search here, for sure...

Thank you Zakaroonikov, thank you Jack.

Just out of curiosity, what version of Domino are you running? and what browser/version are you using? I just haven't come across this issue before and I want to better understand why this was happening.

thanks!
Jack

David Grossi
12 Jan 2010, 9:30 AM
I'm using :
- Domino 7.0 FR
- Internet Explorer 7.0

I also would have been curious about the "why". I still don't understand the link between the mime format and this download window appearing instead of displaying the js file directly :-?
Maybe there are other reasons or a combination of factors, but I don't have time to investigate as it seems to work with this solution.

Zakaroonikov
12 Jan 2010, 1:10 PM
I'm using :
- Domino 7.0 FR
- Internet Explorer 7.0

I also would have been curious about the "why". I still don't understand the link between the mime format and this download window appearing instead of displaying the js file directly :-?
Maybe there are other reasons or a combination of factors, but I don't have time to investigate as it seems to work with this solution.

I have found it could be a whole range of things. With authenticated resource files (non anonymous access) the first time it requests access to the JS file Domino might send back a different content type you can check that in Firebug. See the image attached.

If you are using IE instead of firefox which it looks like you are download fiddler. It does the same thing and helps you trace the network communications between browser and server. I found it very useful for optimizing caching.