I wanted to ask you similar question. I was working on similar
funcionality, generating XML with PHP to get menubar structure
depending which role and permissions user has. Now, for me that is not
a problem, but I'm having some thoughts how to use menu event handling
and how to display some other components.
Let's make an example. I'm working on administration application for
my website. I have several panels with forms for handling articles,
user data, geographic data (countries, cities, regions, currency,...).
Currently my main.mxml contains members activePanel and boolean type
dataChanged. Every time when I handle menuBar event I check is there
an activePanel. An activePanel will change boolean member dataChanged
so that you can be sure if you can put another panel instance in
member.
Now, since I'm currenlty only developer on this project and others
will be joining me soon, I was wondering what do you think about this
kind of code organization.
Example
main.mxml
-----------------
<fx:application>
....
<fx:declarations>
<script>
activePanel:Panel;
dataChanged:boolean
.... implementation of activePanelListener, dataChangedListener....
</script>
</fx:declarations>
<myComps:menuBar>
...
</fx: application>
myComps.menuBar
-----------------------------
contains: username, password:String
remoteObject for getting XML Collection from PHP server
contains logic for menu events
How to add new menu component:
1. create new Panel/form
2. add new form in PHP XML and define which role can work with this
form.
3. that's it :)
Do you think there is a better solution for this kind of
functionality?
On 31 Oct, 08:46, Sunny Tambi <sunnyta...@gmail.com> wrote:
> you can create a dynamic xml based upon your needs and then pass it in the
> dataprovider of menu bar.
> See this:
http://livedocs.adobe.com/flex/3/html/help.html?content=menucontrols_...
> On Sat, Oct 31, 2009 at 11:14 AM, Gerald Anto <flex.gerald.a...@gmail.com>wrote:
> > Can we dynamically create menu bar.
> > actually my requirment is, i have 3 buttons
> > admin
> > user
> > client
> > i need separete menuitems in menu bar
> > for ex
> > if i enter admin
> > MenuItemA,menuItemB,menuItemC(with sub menu) are only available
> > if i click user
> > MenuItemA,menuItemB(with sub menu) are only available
> > if i click user
> > MenuItemA,menuItemB,menuItemC,menuItemD(with sub menu) are only
> > available
> > is it possible?
> > if so help how to create it
> > Thanks&Regards,
> > Gerald A
> --
> st