I don't see why you can't just store this XML in the model and hand it
to menu with custom labelFunction and maybe a custom descriptor.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Steve Hueners
Sent: Friday, September 14, 2007 1:37 AM
To: [email protected]
Subject: Re: [flexcoders] Model for Menu: Dynamic instead of enum driven

 

It's entirely possible i'm making more work for myself than necessary
but I'm trying to organize myself to much stricter adherence to accepted
design patterns. Since couple elements in my menu will change over the
course of the session so I want the data plugged into my model...perhaps
I don't need to serialize out of the native xml. 

Incoming structure:
<?xml version="1.0" encoding="utf-8"?>
<row>
    <ModuleID>302</ModuleID>
    <ModuleName>Title 1</ModuleName>
    <ModuleTitle>A Fully Qualified Title: Act 1</ModuleTitle> 
    <ModuleDesc>Narrative that describes Act 1</ModuleDesc>
    <Status>0</Status>
    <CurrentDue>1</CurrentDue>
    <OverDue>0</OverDue>
    <dateDue>2007-11-30</dateDue> 

    <ModuleID>1213</ModuleID>
    <ModuleName>Title 2</ModuleName>
    <ModuleTitle>A Fully Qualified Title: Act 2</ModuleTitle>
    <ModuleDesc>Narrative that describes Act 2</ModuleDesc> 
    <Status>1</Status>
    <CurrentDue>1</CurrentDue>
    <OverDue>0</OverDue>
    <dateDue>2007-11-30</dateDue>

    <ModuleID>322</ModuleID> 
    <ModuleName>Title 3</ModuleName>
    <ModuleTitle>A Fully Qualified Title: Act 3</ModuleTitle>
    <ModuleDesc>Narrative that describes Act 3</ModuleDesc>
    <Status>0</Status> 
    <CurrentDue>1</CurrentDue>
    <OverDue>0</OverDue>
    <dateDue>2007-11-30</dateDue>

</row>

On 9/14/07, Alex Harui <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >
wrote:

Why not just dump the xml into the menu?

 

________________________________

From: [email protected] [mailto: flexcoders@
<mailto:flexcoders@> yahoogroups.com <http://yahoogroups.com> ] On
Behalf Of Steve Hueners
Sent: Thursday, September 13, 2007 5:30 PM
To: flexcoders
Subject: [flexcoders] Model for Menu: Dynamic instead of enum driven

 

In looking at various MVC samples, I frequently see an Enum pattern
used for menu population. I can follow/understand how a list of static
constants are assigned, added to an array and passed around as a
dataprovider.

I need to achieve the same result (Item/Index pair for the menu) from
a runtime loaded xml file.

I'm inclined to head in the direction of creating 2 VOs: 1 for each
menu item (besides Item/Index I'm snagging stuff for tool tips and
user status info.) & and second for the menu itself.

So the class responsible for retrieving the XML source would then
serialize to both VOs.

Goose(Chase) ? Wild:Better Exists

 

 

Reply via email to