PDA

View Full Version : View in a form



tarikonen
13 Sep 2007, 6:36 AM
I'm trying to put a grid that get data from a view in a form, but i receive this error

fn has no properties
EventManager(undefined, function(), true)ext-all.js (line 18)
onload(load )

The form have just a Text and a div <div id="vista"></div>

In the HTML Head Content i have put this code:


dbPath := "/" + @WebDbName + "/";
ServerName := @ServerName;
unid := @Text(@DocumentUniqueID);
extndUrl := @GetProfileField("Ext.nd.Profile"; "ExtNDDb"; ServerName);
mode := @If(@UrlQueryString("debug") = "true"; "-debug"; "");

uidoc := @If(@IsNewDoc;
"Ext.nd.UIDocument?ReadForm";
"($Ext.nd.SwitchForm)/" + unid + "?OpenDocument&form=Ext.nd.UIDocument");


"<!-- Ext JS library -->" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + "ext/adapter/ext/ext-base.js'></script>" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + "ext/ext-all" + mode + ".js'></script>" + @NewLine +

"<!-- Ext.nd JS library -->" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + "extnd/extnd-all" + mode + ".js'></script>" + @NewLine +
"<script type='text/javascript' src='" + dbPath + "Ext.nd.Session.js?ReadForm'></script>" + @NewLine +
"<script type='text/javascript'>" + @NewLine +
" Ext.nd.init({extndUrl : '" + extndUrl + "'});" + @NewLine +
"</script>" + @NewLine +
"<script type='text/javascript' src='" + dbPath + uidoc + "'></script>" + @NewLine +


"<link rel='stylesheet' type='text/css' href='" + extndUrl + "ext/resources/css/ext-all.css' />" + @NewLine +
"<link rel='stylesheet' type='text/css' href='" + extndUrl + "ext/resources/css/xtheme-aero.css' />" + @NewLine +
"<link rel='stylesheet' type='text/css' href='" + extndUrl + "extnd/resources/css/domino.css' />"

and in the onLoad event i have put this code:


var DemoApp = function()
{
return {

init : function(){

var cm = new Ext.grid.ColumnModel([
{header: "Nome", width: 60, sortable: true, locked: true},
{header: "Cognome", width: 150, sortable: true},
{header: "Indirizzo", width: 100, sortable: true},
{header: "Data", width: 100, sortable: true}
]);

var ds = new Ext.data.JsonStore({
url: 'http://myserver.com:8088/test.nsf/BEA5990D8C0C77D8C125735500494FCB?ReadViewEntries&OutputFormat=JSON',
root: 'entrydata',
fields: [{name:'Nome', type:'string'},{name:'Cognome', type:'string'},{name:'Indirizzo', type:'string'}, {name:'DataNascita', type:'date'}]
});

var grid = new Ext.grid.Grid("vista", {
ds: ds,
cm: cm,
// selModel: mySelectionModel,
autoSizeColumns: true,
monitorWindowResize: false,
trackMouseOver: true
});
// set any options
grid.render();
} // init
} // return
}

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

What's wrong?

Thanks to all in advance

becomcs
13 Sep 2007, 7:27 AM
I use ext.nd uiview as follow

in the form:

<div id='LIACRef' style="margin:20px; width:500px; height:200px; position:relative">Loading view, please wait...</div>

in the HTML Head Content:

dbPath := "/" + @WebDbName + "/";
ServerName := @ServerName;
unid := @Text(@DocumentUniqueID);
extndUrl := @GetProfileField("Ext.nd.Profile"; "ExtNDDb"; ServerName);
mode := @If(@UrlQueryString("debug") = "true"; "-debug"; "");

uidoc := @If(@IsNewDoc;
"Ext.nd.UIDocument?ReadForm";
"($Ext.nd.SwitchForm)/" + unid + "?OpenDocument&form=Ext.nd.UIDocument");

"<!-- Ext JS library -->" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + "ext/adapter/ext/ext-base.js'></script>" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + "ext/ext-all" + mode + ".js'></script>" + @NewLine +

"<!-- Ext.nd JS library -->" + @NewLine +
"<script type='text/javascript' charset='ISO-8859-1' src='" + extndUrl + "extnd/extnd-all" + mode + ".js'></script>" + @NewLine +
"<script type='text/javascript' src='" + dbPath + "Ext.nd.Session.js?ReadForm'></script>" + @NewLine +
"<script type='text/javascript'>" + @NewLine +
" Ext.nd.init({extndUrl : '" + extndUrl + "'});" + @NewLine +
"</script>" + @NewLine +
"<script type='text/javascript' src='" + dbPath + uidoc + "'></script>" + @NewLine +


"<link rel='stylesheet' type='text/css' href='" + extndUrl + "ext/resources/css/ext-all.css' />" + @NewLine +
"<link rel='stylesheet' type='text/css' href='" + extndUrl + "ext/resources/css/xtheme-aero.css' />" + @NewLine +
"<link rel='stylesheet' type='text/css' href='" + extndUrl + "extnd/resources/css/domino.css' />"

in the HTML Body Attributes:

"class='x-form'"



in js header:


var REQUEST = function(){
var ws;
var showBtn, dialog;
var frm;

return {
init : function() {

var LIACRef = new Ext.nd.UIView({
viewName : 'LIACRef',
container : 'LIACRef',
height : 200
});

}

};

}();

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



The issue I have is to show single category.

tarikonen
13 Sep 2007, 7:49 AM
Thank you very much! It work!!

..but in this mode i have no control over grid... :-(( for example if i want to change header column or search text... there is a method?

Sorry for rookie questions and bad english...

becomcs
13 Sep 2007, 11:30 AM
As fare as I understode, header columns are retrieved from a ?readdesign command.

For improve search text, I dont have answer. Sorry.

It would be more efficient to post a new question.

mpete
15 Sep 2007, 4:39 AM
Hi !

UPDATED: I found the answer..
showActionbar : false,
count : 25

Question for becomcs


How do I spesify the number of documents to load ?
How can I turn of/remove the view action buttons on top ?

Thanks !

Fredric Berling
19 Sep 2007, 4:46 AM
When using this approach in a form it works great. Just like an old embedded view.. But when i open the dokument inside the DominoUI interface i get an error from firebug:


sess has no properties
[Break on this error] Ext.nd.UIView=function(config){var sess=Ext.nd.Session;var db=sess.CurrentDataba...

When looking in the DOM i see Ext.nd.Session alright... any ideas?

RWaters
19 Sep 2007, 7:55 AM
Some components require that you copy over the "Ext.nd.Session.js" form into your database. Sounds like this is missing.

EDIT: Also there's a subform "(Ext.nd.Database)" that the session form needs

Fredric Berling
19 Sep 2007, 10:39 PM
ext.nd.Session.js form was there and objects for sess was available in Firebug DOM browser.

BUT when opening a document in the DominoUI view the relative path pointer is moved to the current view and the ext.nd.session.js form was obviously not found. Changed the path to be absolute... now it works....

jratcliff
20 Sep 2007, 8:05 AM
which path did you change from a relative to an absolute path? The path to the Ext.nd db in the profile document?

Fredric Berling
2 Oct 2007, 12:47 AM
No. The path to the session form. The session form is in my application ..Not in the Ext.nd repository.

RWaters
2 Oct 2007, 6:42 AM
dbPath := "/" + @WebDbName + "/";
"<script type='text/javascript' src='" + dbPath + "Ext.nd.Session.js?ReadForm'></script>" + @NewLine +


This is how we have session included in every case I can see. This should be correctly building a relative path to your database and to the ext.nd.session.js form.

Dominoble
17 Oct 2007, 8:52 AM
The issue I have is to show single category.

Here's how to use the single category:


var LIACRef = new Ext.nd.UIView({
viewName : 'LIACRef',
container : 'LIACRef',
height : 200,
showActionbar : false,
count : 25
showSingleCategory : 'category_text_here',
toolbar : false //(to dev team) this does not seem to work
});