Hi,
I am trying to figure out how to create a new action container in a new bar. The action container appears in the bar (as can be seen by the customization window); however the action that I have designated for the action container is not showing. I have also tried to add the action container to an existing bar, but I get the same behaviour. What am I missing?
Thanks,
Mark
We have closed this ticket because another page addresses its subject:
The action's visibility depends on its existence in the main menu
Hi Mark,
Thank you for the question.
I have prepared a sample project to illustrate how to accomplish your task. It also contains a custom MyActionContainerBarItem class, which is based on the standard ActionContainerBarItem.
To add a custom action container, I modified the template and added a new action to the controller. The action's Category property was specified to the action container's ID.
In addition, I suggest you review the following issue in our Support Center:
OBSOLETE - How to replace the navbar with a treelist?
K18005
filter a list view with link in navigation bar
They contain samples of custom action containers as well. Please contact us in case of any difficulty.
Thanks,
Dennis
Hi Dennis,
Thank you for the response. I will look through the posted sample. However, the sample does much more than I intended. I just wanted to add an action container to a bar of the type ActionContainerBarItem. (as per the posted project). I don't require any enhanced functionality of the action container, I just want an extra on in the UI.
On first look it appears that I did the same thing in the sample project I posted in adding a custom action controller as is in the project you posted with the only exception being that I was using an ActionContainerBarItem. Obviously, since the posted sample does not function, I missed something and I am trying to figure out what that is.
Thanks,
Mark
Hi Dennis,
I could not find any differences. So, I re-did my project from scratch, and this time it works as expected. I think what I did with the first project is add the second bar via the designer (not via editing the .designer code file) and this is what messed things up.
Thanks for the information.
MK
Hi Dennis,
I thought I had it, but it turns out I almost had it.
Attached is a project with a custom action container. When an action controller is added to a WindowController then setting the category to the custom action container category will make the action controller appear as expected. However, when an action controller is placed in a ViewController setting the category to the custom action container will not make the action controller appear. However, if you set the category of an action controller (added to a viewcontroller) to one of the existing action containers (RecordsNavigation in the sample) the action controller appears as expected.
So, what am I missing in the initialization of the custom action container.
Thanks,
Mark
PS: I also tested this with the solution you posted and it has the same window vs view controller behaviour as I describe above.
Hi Mark,
Sorry for the delay in processing your request.
I am working on this problem and will post a solution once it is ready.
Thanks
Dennis
Hi Mark,
>>
However, when an action controller is placed in a ViewController setting the category to the custom action container will not make the action controller appear.
<<
Please test the attached sample project. It all works fine for me.
Thanks
Dennis
Hi Dennis,
Thank you for the sample. I was able to figure out what I was missing in my project. I did not have the container in the MDI Child template, and I was not adding it to a menu.
If you do not add the action container to a menu, it fails to apper in a tool bar. Is it possible to make an action container appear in a tool bar without being added to a menu bar?
Thanks,
Mark
Hi Mark,
You can write a controller to access the bar manager, and hide the unnecessary item in a menu. Please refer to the XtraBars documentation for more information on bars customization. Do not hesitate to contact us if you need any additional assistance.
Thanks
Dennis
Hi Dennis,
Thank you for the information. I guess, I should have asked something different. Why is it such that the item has to be in a menu bar?
Thanks,
Mark
Hi Mark,
This dependency looks like a bug in XAF. I have created a new bug report on your behalf: ID B30166 (B30166). You will be automatically notified when its state is changed. Thank you for your patience.
Thanks
Dennis