PDA

View Full Version : [ACTIONBAR] [FORM] Hidden Actions still appear



jchryssafis
27 Feb 2008, 12:38 PM
Hi, Let me begin by congratulating you guys on some amazing work here. You guys make me look good as a Lotus Web Developer. Cheers.

I'm currently using 'ext.nd Beta 1' and have noticed that when I use hide-when formulas on actions in a FORM, they still appear after the form render has occurred. What does work is when applying the hide options for read mode or edit mode. In this instance though i need a hide-when formula.

If i don't render the form using ext, the action does remain hidden. It looks like the action is displayed when the DXLExporter runs.

I was wondering if there was a work-around to conditionally hide an action.
eg. (Hide Action if): Status = "Draft"

RWaters
28 Feb 2008, 2:19 PM
Yeah, this is a known limitation with our current implementation. Jack and I have been throwing some ideas around on how to handle actions, because we simply are not going to be able to deal with all the possible hide when formulas. Currently our thought is to change the server side and perform any evaluation before sending DXL (or perhaps even Json) back to the browser.

dot.Scott
21 May 2008, 10:52 AM
So how would you go about disabling or hiding the action button?

RWaters
21 May 2008, 12:09 PM
Conditional checking to disable the buttons is not really very easy right now. We're currently not setting an ID attribute on the buttons so the only real way to get ahold of them is through the Toolbar's items array. If you know for sure that it's always the 5th button or whatever (which I always hate to reference anything by index like that) you could do something like:


if (someVariable == 'Draft') {
var tb = Ext.getCmp('xnd-form-pnl').getTopToolbar();
tb.items[4].disable(); // or perhaps destroy
}

perhaps better than accessing via index:


if (someVariable == 'Draft') {
var tb = Ext.getCmp('xnd-form-pnl').getTopToolbar();
for (var i = 0;i < tb.items.length; i++) {
if (tb.items[i].text == 'My Button Text') {
tb.items[i].disable(); // or perhaps destroy
}
}
}


We'll look to provide a better way to access buttons as well as a way to automatically support Domino evaluating hide-when formulas

JuanPalomo
21 May 2008, 12:42 PM
Rich, will it be posible to hide also action views? (support Domino evaluating hide-when formulas)

Thanks in advance


Conditional checking to disable the buttons is not really very easy right now. We're currently not setting an ID attribute on the buttons so the only real way to get ahold of them is through the Toolbar's items array. If you know for sure that it's always the 5th button or whatever (which I always hate to reference anything by index like that) you could do something like:


if (someVariable == 'Draft') {
var tb = Ext.getCmp('xnd-form-pnl').getTopToolbar();
tb.items[4].disable(); // or perhaps destroy
}

perhaps better than accessing via index:


if (someVariable == 'Draft') {
var tb = Ext.getCmp('xnd-form-pnl').getTopToolbar();
for (var i = 0;i < tb.items.length; i++) {
if (tb.items[i].text == 'My Button Text') {
tb.items[i].disable(); // or perhaps destroy
}
}
}


We'll look to provide a better way to access buttons as well as a way to automatically support Domino evaluating hide-when formulas

RWaters
21 May 2008, 12:45 PM
not sure what you mean by 'action views' but the idea to support hide-whens we want to support for both forms and views.

JuanPalomo
21 May 2008, 1:07 PM
Rich, sorry about my explanation..:"> (Maybe with an attachment it's more clear... my english is really bad :-))
But with your reply i understand you perfectly.


Thank you very much.

RWaters
21 May 2008, 4:19 PM
Yes that is what I was speaking of. The confusion is that we would call them 'view actions' rather than 'action view' flipping the terms would make it seem like something else in english.

dot.Scott
22 May 2008, 4:46 AM
I'm getting a 'Ext.getCmp('xnd-form-pnl').getTopToolbar() has no properties' error.

RWaters
22 May 2008, 5:47 AM
Are you running that code from within the form? You won't be able to access the panel from outside the iframe in that way.

dot.Scott
22 May 2008, 6:54 AM
I'm running in JS Header directly after frm.render(). I am able to get a handle on the toolbar but the item count is 0. It doesn't appear that the toolbar has been rendered at this point.

RWaters
22 May 2008, 7:29 AM
Ah, that make sense, the toolbar is created but the ajax call hasn't yet come back so we haven't added the actual items to it yet. I'll look into the issue further to find a workaround.

dot.Scott
23 May 2008, 12:39 PM
Is it possible to add action buttons or is this a similar issue? Can the action bar be created manually?

RWaters
23 May 2008, 1:17 PM
Adding to the toolbar should work fine, you may notice that if you add items before the ajax request for the domino action bar comes back that you'll add to the beginning.

After looking through the current release it looks like you cannot pass in your own Toolbar. This will be remedied in the next release.

A lot of the architecture of how Ext.nd is piecing things together will be changing to allow for much greater ease when attempting to customize things such as this.

alan95_00
27 Jun 2008, 11:33 AM
Hi

Looks like the hidden actions is working on Alpha 2 version. However, after I upgraded to Beta1 the hidden actions is no longer working. Can you tell me when will be the next version available. Thanks for your big help!!!!!:)

DBaker
1 Oct 2008, 8:33 PM
Adding to the toolbar should work fine, you may notice that if you add items before the ajax request for the domino action bar comes back that you'll add to the beginning.

After looking through the current release it looks like you cannot pass in your own Toolbar. This will be remedied in the next release.

A lot of the architecture of how Ext.nd is piecing things together will be changing to allow for much greater ease when attempting to customize things such as this.

Does anyone have a solution for hiding action buttons?

emonzani
2 Apr 2009, 4:06 AM
Sorry,

is this problem solved with the new release (2) ?

i've also problem loading actionbars as subforms, instead of rendering them (from the "table" not styled to styled ), they are hidden...

thanks.

PS: to hide actions it's pretty easy: evaluate their hiding formula in the htmlcontentheader to variables, then use them to hide the actions.