PDA

View Full Version : Error on UIView action toolbar if no UIDocument present



RonaldBrinkerink
24 Aug 2009, 1:09 AM
Hi there,

I am getting an error when creating a UIView with an ShowActionbar set to true.
The error occurs on line 5299 where the class presumes the presence of a UIDocument. That is not there as I am only using UIViews in this case. I'm not sure why the test on UIODocument in editmode occurs, but probably to see whether or not the action should be shown on the web.

// private
5268 addActionsFromDxlSuccess : function(o){
5269 var arActions;
5270 var q = Ext.DomQuery;
5271 var response = o.responseXML;
5272 arActions = q.select('action', response);
5273
5274
5275 if (this.noteType == 'view' && this.getTarget() && this.useViewTitleFromDxl) {
5276 this.setViewName(response);
5277 }
5278
5279 var curLevelTitle = '';
5280 var isFirst = false;
5281
5282 for (var i = 0; i < arActions.length; i++) {
5283 var show = true;
5284 var action = arActions;
5285
5286 var title = q.selectValue('@title', action, "");
5287 var hidewhen = q.selectValue('@hide', action, null);
5288 var showinbar = q.selectValue('@showinbar', action, null);
5289 var iconOnly = q.select('@onlyiconinbar', action);
5290 var icon = q.selectNumber('@icon', action, null);
5291 var imageRef = q.selectValue('imageref/@name', action, null);
5292 var syscmd = q.selectValue('@systemcommand', action, null);
5293
5294
5295 if (hidewhen) {
5296 var arHide = hidewhen.split(' ');
5297 for (var h = 0; h < arHide.length; h++) {
5298 if (arHide[h] == 'web' ||
[I]5299 (arHide[h] == 'edit' && Ext.nd.currentUIDocument.editMode) ||
5300 (arHide[h] == 'read' && !Ext.nd.currentUIDocument.editMode)) {
5301 show = false;
5302 }
5303 }
5304 }
5305

The consequence of this errir is that there is no actinbar shown on the view.
It can be solved by checking the presence of the UIDocument but i'm not sure what consequences this has.

Any suggestions?

Regards Ronald

jratcliff
24 Aug 2009, 8:22 AM
what is the exact error? On a view, the check on Ext.nd.currentUIDocument.editMode should never happen since the check on arHide[h] == 'read' or 'edit' never should return true on a view.

RonaldBrinkerink
24 Aug 2009, 11:03 PM
Hi Jack,

Thank you for your reply.

The error from from firebug:

Ext.nd.currentUIDocument is undefined
anonymous(Object tId=2 status=200 statusText=OK)extnd-al...-debug.js (regel 5299)
handleResponse(Object tId=2 status=200 statusText=OK)ext-all-debug.js (regel 8550)
f(Object conn=XMLHttpRequest tId=2, Object scope=Object argument=Object timeout=30000, Object name=r, Object name=q)ext-base.js (regel 7)
anonymous()ext-base.js (regel 7)


(arHide[h] == 'edit'... Ext.nd.currentUIDocument.editMode) ||\r\n

I thnk that because the test for arHide[h] and Ext.nd.currentUIDocument.editMode) are tested in the same line the error occurs.

Regards, Ronald

jratcliff
25 Aug 2009, 5:27 AM
what are you including in the HTMLHead section of this page/form? I've tested this out on a page that does not make a call to the UIDocument.js agent (where Ext.nd.currentDocument would get set) and I don't get an error.

jratcliff
25 Aug 2009, 5:32 AM
also, what version of Ext.nd are you using? Is it Beta 3 or one of the previous versions?

RonaldBrinkerink
25 Aug 2009, 5:53 AM
I don't use the setup with a domino-page and the html section, I just serve up normal html files stored as attachment in a notesdocument as I really hate the way Domino ios generating HTML. In the HTMLHead section I just include the proper librarys and initialize Ext.nd. Everything else works fine with this setup.
I think I have found something else though: The error only occurs if there is an action in the viewdesign where the 'Include action in actionbar' option is not checked. If all actions are shown in the actionbar I do not get the error.

RonaldBrinkerink
25 Aug 2009, 5:55 AM
it's Ext.nd beta 3.... and Ext 3.0

jratcliff
25 Aug 2009, 6:58 AM
I think I have found something else though: The error only occurs if there is an action in the viewdesign where the 'Include action in actionbar' option is not checked. If all actions are shown in the actionbar I do not get the error.

ok, then. I'll go down that path then to see what I find. thanks for the info to help debug this!

jratcliff
25 Aug 2009, 7:25 AM
ok, then. I'll go down that path then to see what I find. thanks for the info to help debug this!

Still worked for me. I may have to try your setup of serving up an attachment from a notesdocument. Before I do though, what is the value arHide[h] that you are getting? Again, for a view, it never should equal read or edit so I'm wondering if for your setup it is equaling "edit".

jratcliff
25 Aug 2009, 8:02 PM
Found the issue! **Shared** actions can have hidewhens for edit/read mode and they can be added as actions to views and this is how this issue can happen. So I'll add a check to first see if the Ext.nd.currentUIDocument exists before checking its editMode property and that should take care of this issue.

Thanks again for finding this bug!