PDA

View Full Version : Unable to override method



R.J
12 Jan 2010, 8:59 PM
I have created a database using Ext.ND database and following is my code written on head content of my page.


thisWebDbName := @WebDbName;
extndDbWebPath := "/extnd_b3.nsf/";
extUrl := extndDbWebPath + "ext/3x/";
extndUrl := extndDbWebPath + "extnd/3x/";
sViewName := "vwDiscussionBoard";
sOutlineName := "mainoutline";
bShowSearch := "true";
mode := @If(@UrlQueryString("debug") = "true"; "-debug"; "");
unid := @If(@IsNewDoc;"";@Text(@DocumentUniqueID));
editMode := @If(@IsDocBeingEdited;"true";"false");

"<!-- Ext JS library -->" + @NewLine +
"<script type='text/javascript' src='" + extUrl + "adapter/ext/ext-base.js'></script>" + @NewLine +
"<script type='text/javascript' src='" + extUrl + "ext-all" + mode + ".js'></script>" + @NewLine +
"<!-- Ext.nd JS library -->" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + "extnd-all" + mode + ".js'></script>" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + "Session.js?OpenAgent&db=" + thisWebDbName + "'></script>" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + "UIDocument.js?OpenAgent&db=" + thisWebDbName + "&unid=" + unid + "&editmode=" + editMode + "'></script>" + @NewLine +
"<script type='text/javascript'>" + @NewLine +
" var ExtndApp = function() {
return {
init : function(){
this.ui = new Ext.nd.DominoUI({
uiOutline : {outlineName: '" + sOutlineName + "'},
uiView : {viewName: '" + sViewName + "', viewTitle: '" + sViewTitle + "', showSearch: " + bShowSearch + "}
});
//remove the outline panel and refresh the viewport
this.ui.outlinePanel.hide();
this.ui.viewport.doLayout();
} // init
} // return
}();" + @NewLine +
" Ext.onReady(ExtndApp.init, ExtndApp, true); " + @NewLine +
"</script>" + @NewLine +
"<link rel='stylesheet' type='text/css' href='" + extUrl + "resources/css/ext-all.css' />" + @NewLine +
"<link rel='stylesheet' type='text/css' href='" + extUrl + "resources/css/xtheme-gray.css' />" + @NewLine +
"<link rel='stylesheet' type='text/css' href='" + extndUrl + "resources/css/domino.css' />"



I have tried hiding the outline region using the code marked in red for db using ext.nd 2.x version, but the same code is not working for db using Ext.nd 3.x version.

Is the overriding method modified ??.

If yes, what is it? . If No, where am I making a mistake?

Please Help..!!

Thanks a lot in Advance.!!!

jratcliff
13 Jan 2010, 8:40 AM
The DominoUI class is just a convenience class to help a developer quickly setup an Ext BorderLayout with an outline in the west region and a view in the center region. So if you don't want that type of layout, you can build your own from any of the Ext layouts available.

So, for instance, you can use Ext.Viewport and only include an Ext.nd.UIView since that sounds like what you want.

R.J
25 Jan 2010, 12:35 AM
i.c. Jack,

Thanks for your help, please check my code below, I am unable to get the view displayed in the center panel. I will like to know whether am I using correct attribute of viewURL.

Below is my code in Html Head Content.

thisWebDbName := @WebDbName;
extndDbWebPath := "/Apps/AP/HK/QMTool/extnd_b3.nsf/";
extUrl := extndDbWebPath + "ext/3x/";
extndUrl := extndDbWebPath + "extnd/3x/";
sViewName := "vwDiscussionBoard";
sOutlineName := "mainoutline";
bShowSearch := "true";
mode := @If(@UrlQueryString("debug") = "true"; "-debug"; "");
unid := @If(@IsNewDoc;"";@Text(@DocumentUniqueID));
editMode := @If(@IsDocBeingEdited;"true";"false");

"<!-- Ext JS library -->" + @NewLine +
"<script type='text/javascript' src='" + extUrl + "adapter/ext/ext-base.js'></script>" + @NewLine +
"<script type='text/javascript' src='" + extUrl + "ext-all" + mode + ".js'></script>" + @NewLine +
"<!-- Ext.nd JS library -->" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + "extnd-all" + mode + ".js'></script>" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + "Session.js?OpenAgent&db=" + thisWebDbName + "'></script>" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + "UIDocument.js?OpenAgent&db=" + thisWebDbName + "&unid=" + unid + "&editmode=" + editMode + "'></script>" + @NewLine +
"<link rel='stylesheet' type='text/css' href='" + extUrl + "resources/css/ext-all.css' />" + @NewLine +
"<link rel='stylesheet' type='text/css' href='" + extUrl + "resources/css/xtheme-gray.css' />" + @NewLine +
"<link rel='stylesheet' type='text/css' href='" + extndUrl + "resources/css/domino.css' />"

and the js header code is as below :



Ext.onReady(function (){
// Als alles geladen is dan loading scherm verwijderen
setTimeout(function(){
//Ext.get('loading').remove();
// Ext.get('loading-mask').fadeOut({
//remove:true
//});
},
350);
// Opbouw van het portaal
var oViewport = new Ext.Viewport({
layout: 'border',
id: 'viewport',
items:[{
xtype: 'tabpanel',
region:'center',
id: 'center-panel',
enableTabScroll: true,
shadow : true
},{
region : 'north',
id : 'north-panel',
collapsible : true,
titleCollapse : true,
split : true,
width : 250,
layout : 'accordion'
},{
region : 'south',
id : 'south-panel',
height : 20
}]
});

oViewport.on('show', function() {

// De widgets opbouwen
var oTakenView = new Ext.nd.UIView({
id: 'vwDiscussionBoard',
viewTitle: 'vwDiscussionBoard',
viewName: 'Discussion Board',
// viewUrl: '/' + sessionContext.workflowPath + '/Taken - Context',
viewUrl: 'http://devidc/Apps/IN/BAYER/HR/DiscussionBoard.nsf/Discussion%20Board?OpenView',
showActionbar : true,
showSearch : true,
showPagingToolbar : true,
// showSingleCategory : sessionContext.Session.commonUserName,
viewPort : this,
container : Ext.getCmp('north-panel'),
tabPanel : Ext.getCmp('center-panel')
// statusPanel : Ext.getCmp('south-panel')
})
}) // eo oViewport.on("show");
oViewport.show();

}) //eo onReady


I am unable to display my view in the above mentioned center panel. Please help.
its a lil urgent ..!!

Thanks In Advance.

jratcliff
26 Jan 2010, 10:06 AM
Why don't you use the Ext.nd.UIView's xtype? The xtype = xnd-uiview. You can then just include the uiview in the config.




var oViewport = new Ext.Viewport({
layout: 'border',
id: 'viewport',
items:[{
xtype: 'tabpanel',
region:'center',
id: 'center-panel',
enableTabScroll: true,
shadow : true,
items : [{
xtype: 'xnd-uiview',
id: 'vwDiscussionBoard',
viewTitle: 'vwDiscussionBoard',
viewName: 'Discussion Board',
showActionbar : true,
showSearch : true,
showPagingToolbar : true
}]
},{
region : 'north',
id : 'north-panel',
collapsible : true,
titleCollapse : true,
split : true,
width : 250,
layout : 'accordion'
},{
region : 'south',
id : 'south-panel',
height : 20
}]
});

R.J
2 Feb 2010, 1:11 AM
Hi Jack,

Your code has worked in a great way :) . Thanks a lot for the help.!!!

Do u know how to open the document directly into the tab by your code using the url from mail itself. I was unable to do that...
following is my url.


http://servername/DB.nsf/pgframeset?Open&link=Discussion%20Board/D5D43AEC462896D9652576BA003AC0ED/%3F?OpenDocument


the frameset is opened but the document with the unid: D5D43AEC462896D9652576BA003AC0ED is not opened automatically.

Also let me know if a document is opened in a new tab using @command([compose];"frmname"); , how to close the tab after saving the document. ?

Please help.!! thanks in advance.!!!

:)

jratcliff
2 Feb 2010, 6:44 PM
Well, to get docs in the view to open in a new tab in the same tabpanel that the view is loaded in, all you need to do is add a 'target' property and set it to the id of the tabpanel (which in your case is the center region).

So, make this change show in bold below:



var oViewport = new Ext.Viewport({
layout: 'border',
id: 'viewport',
items:[{
xtype: 'tabpanel',
region:'center',
id: 'center-panel',
enableTabScroll: true,
shadow : true,
items : [{
xtype: 'xnd-uiview',
id: 'vwDiscussionBoard',
viewTitle: 'vwDiscussionBoard',
viewName: 'Discussion Board',
target: 'center-panel',
showActionbar : true,
showSearch : true,
showPagingToolbar : true
}]
},{
region : 'north',
id : 'north-panel',
collapsible : true,
titleCollapse : true,
split : true,
width : 250,
layout : 'accordion'
},{
region : 'south',
id : 'south-panel',
height : 20
}]
});


As for auto loading from a link, let me see if I can come up with a more generic solution for everyone. We current have a solution if you use the Ext.nd.DominoUI class but we don't have one if a custom layout that doesn't use DominoUI is used.