Re: D2W tabs question
Re: D2W tabs question
- Subject: Re: D2W tabs question
- From: Ramsey Gurley <email@hidden>
- Date: Thu, 19 Jul 2012 08:13:59 -0700
On Jul 19, 2012, at 5:27 AM, Theodore Petrosky wrote:
> Ramsey,
>
> So if I understand this, if theArrayOfTitles is an array of strings, then the childernChoices need to correspond to the names in the array.
>
> given that today theArrayOfTitles = ("SaleAds", "Broadcast") then
>
> {
> name = Root;
> children = "session.theArrayOfTitles";
> childrenChoices = {
> 1 = (SaleAds);
> 2 = (Broadcast);
> };
> },
> {
> name = SaleAds;
> //do something
>
> },
> {
> name = Broadcast;
> //do something
>
> }
>
>
>
> I do not understand how to populate the childrenChoices because tomorrow:
>
> theArrayOfTitles = ("PetProjects", "Broadcast", "Exploratory")
>
> so there is a different number of 'choices'. Am I missing something in the childrenChoices?
You don't need the children choices. The childrenChoices are only used if session.theArrayOfTitles evaluates to a single string. Then the string is used as the key to the children choices dictionary.
If theArrayOfTitles evaluates to an array, then it is as if you specified the array directly
children = ("PetProjects", "Broadcast", "Exploratory");
Now your only problem is you need to know all the navigation items to put into your plist.
If that isn't the case, then try it to see if/where it crashes. :-) You may be able to subclass to fix that or patch wonder.
Ramsey
>
> I am thinking I could just display Projects and sort on category. it would be possible to do something like
>
> Category1
> project1
> project 3
>
> Category2
> project2
> project5
>
> etc. I am going to examine the D2WList pages and see if I can figure out how to do this.
>
> Ted
>
> --- On Wed, 7/18/12, Ramsey Gurley <email@hidden> wrote:
>
> From: Ramsey Gurley <email@hidden>
> Subject: Re: D2W tabs question
> To: "Theodore Petrosky" <email@hidden>
> Cc: email@hidden
> Date: Wednesday, July 18, 2012, 10:14 AM
>
> Just use children
>
> /*
> If children is a keyPath instead of an array, then the value for the
> keyPath is used to determine the children choices shown.
> If the keypath evaluates to an NSArray, then the resultant array is
> used as the children array.
> If the array evaluates to a String, then that String is used as a key
> to find the array of children in the 'childrenChoices' dictionary.
> */
> children = "session.availableProjectCategories";
>
>
> On Jul 17, 2012, at 8:22 PM, Theodore Petrosky wrote:
>
>> I am starting a new project with D2W. I am not totally comfortable but with practice comes more practice.
>>
>> This is a 'Project Manager'. A Project belongs to a Category. I want to display the different Categories as tabs however, the Categories can come and go. Basically at start up, I need to read the list of categories and create the tab structure.
>>
>> So how do I talk to the NavigationMenu.plist after the app has launched?
>>
>> I hope there is an example to follow!!!
>>
>> Ted
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden