Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Is there a way to Remove a ActionIs there a way to Remove a Action
Previous
 
Next
New Post
11/1/2007 10:24 AM
 

I am adding a Action in the IActionable Property ModuleActions.

Sometimes I don't want the action but I do not have enough information at the time the property is read to make that decision.

Later in the page load I would like to remove the action.

Is there way to do this?

Thanks,

Steve

 
New Post
11/1/2007 10:40 PM
 

I set bool flags throughout the page, eg.:

                //if (this.UserId != -1 && eventID != Null.NullInteger)
                //{
                //    if (isEventHost || EventUtils.HasEventAdminPermission(PortalSettings, this.TabId, this.ModuleId))
                //    {
                //        actions.Add(GetNextActionID(), Localization.GetString("EditEvent.Action", LocalResourceFile), ModuleActionType.AddContent, "", "", EditUrl("ID", eventID.ToString(), "Edit"), false, SecurityAccessLevel.Edit, true, false);
                //    }
                //}


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
11/2/2007 1:43 AM
 
Rodney,
Thanks for the reply.
I actually have similar code:
        Public ReadOnly Property ModuleActions() As ModuleActionCollection Implements IActionable.ModuleActions
            Get
                Dim ac As New ModuleActionCollection
 
>>>>> FROM HERE >>>>>
                'If Not PageControllerCollection Is Nothing AndAlso PageControllerCollection.Active.HasOverrides Then
                ac.Add(GetNextActionID, "PageEventActionOverrideSettings", ModuleActionType.EditContent, "", "", NavigateURL(TabId, "StratagemAppSettings", "mid=" + ModuleId.ToString + "&snctl=PageEventActionOverrideSettings.0"), False, SecurityAccessLevel.Edit, True, False)
                'End If
>>>>> TO HERE >>>>>
                Return ac
            End Get
        End Property
 
Here is my problem:
 
The ModuleActions property is read twice before loading/displaying the action menu:
1.      Sometime during page load
2.      At mouse-over
 
The first time the tab loads the action is not added because PageControllerCollection is nothing. But by the time of the mouse-over PageControllerCollection is not nothing and the action gets added. When this happens the action menu never loads.
 
I suspect I get this behavior because the action collection changed without a postback.
 
Given the above, I figured I had these options:
1.      Figure out why this happens and try to fix it.
2.      Always add the action, and then remove it somehow later.
3.      Deal with loading an action that it not relevant.
 
 My initial post was in pursuit of #2. However, I just thought of #4
 
4.      Always add the action, and then set invisible when not relevant.
 
I am thinking I might get #4 to work but any further insight appreciated.
 
Steve

 

 
New Post
11/2/2007 2:15 AM
 

Yes - #4 did the trick:

    Dim isVisible As Boolean = True
 
 
 
                If PageControllerCollection Is Nothing OrElse Not PageControllerCollection.Active.HasOverrides Then
                    isVisible = False
                End If
 
                ac.Add(GetNextActionID, "PageEventActionOverrideSettings", ModuleActionType.EditContent, "", "", NavigateURL(TabId, "StratagemAppSettings", "mid=" + ModuleId.ToString + "&snctl=PageEventActionOverrideSettings.0"), False, SecurityAccessLevel.Edit, isVisible, False)
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Is there a way to Remove a ActionIs there a way to Remove a Action


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out