Raymond

This should be it.

.java
        
    private NSDictionary _tabSelection;
        
    public NSDictionary tabSelection() {
        return _tabSelection;
    }

    public void setTabSelection(NSDictionary tabSelection) {
        _tabSelection = tabSelection;
        String tabLabelString = (String) _tabSelection.valueForKey("tabLabel");

        // THIS IS MY DYNAMIC LIST
        NSArray<EvaluationDomain> temp = 
EOQualifier.filteredArrayWithQualifier(evaluationDomains(), 
EvaluationDomain.TAB_LABEL.likeInsensitive(tabLabelString));
        if ( ! temp.isEmpty()) {
            _accessController.setEvaluationDomain((EvaluationDomain) 
temp.objectAtIndex(0));
        } else {
            _accessController.setEvaluationDomain(null);
        }
        
    }
    
    public Object selectedTabsWOComponent() {
        return _tabSelection.valueForKey("wocomponent");
    }

    private NSArray<NSDictionary> _tabs;
    
    public NSArray<NSDictionary> tabs() {
            if (_tabs == null) {
            // CREATE THE LIST OF NSDictionaries to load into the array
            NSMutableArray<NSDictionary> tabs = new 
NSMutableArray<NSDictionary>();
            
            NSMutableDictionary<Object, String> observationsTab = new 
NSMutableDictionary<Object, String>("Observations", "tabLabel");
            observationsTab.takeValueForKey(ObservationSubTab.class.getName(), 
"wocomponent");

            NSMutableDictionary<Object, String> recommendationsTab = new 
NSMutableDictionary<Object, String>("Recommendations", "tabLabel");
            
recommendationsTab.takeValueForKey(EvaluationRecommendations.class.getName(), 
"wocomponent");
            NSMutableDictionary<Object, String> teacherResponseTab = new 
NSMutableDictionary<Object, String>("Teacher Response", "tabLabel");
            
teacherResponseTab.takeValueForKey(EvaluationTeacherResponse.class.getName(), 
"wocomponent");
            NSMutableDictionary<Object, String> artifactsTab = new 
NSMutableDictionary<Object, String>("Artifacts", "tabLabel");
            artifactsTab.takeValueForKey(EvaluationArtifacts.class.getName(), 
"wocomponent");
            
            //  This is the list of Tabs
            //  Start with Observation
            //  Then the Domains associated with this Evaluation
            //  Then the Administrators recommendations and then the Teachers 
Response
            //  Finally the Artifacts
            
            tabs.add(observationsTab);
            for (EvaluationDomain evaluationDomain : 
evaluation().evaluationDomainsSortedByDisplaySequenceKey() ) {
                String tabLabel = evaluationDomain.tabLabel();
                NSMutableDictionary<Object, String> tab = new 
NSMutableDictionary<Object, String>();
                tab.takeValueForKey(tabLabel, "tabLabel");
                tab.takeValueForKey(EvaluationDetailDomain.class.getName(), 
"wocomponent");
                
                tabs.add(tab.immutableClone());
            }
            tabs.add(recommendationsTab);
            tabs.add(teacherResponseTab);
            tabs.add(artifactsTab);
            _tabs = tabs.immutableClone();
            }
            
            return _tabs;
        }

On Jul 15, 2013, at 9:36 AM, Raymond NANEON <[email protected]> wrote:

> Hi Paul,
> 
> Your example is great but very confused with all variables. Can I have a 
> clean .java example.
> 
> Sorry for the mess.
> Envoyé depuis iCloud
> 
> Le 15 jul 2013 à 06:19, Paul Yu <[email protected]> a écrit :
> 
>> Raymond
>> 
>> observationsTab is myTab1.  Sorry.  Cut and paste and clean, not too good.
>> 
>> private NSDictionary _tabSelection;
>> 
>> public NSDictionary tabSelection() {
>>         return_tabSelection;
>>     }
>> 
>>     public void setTabSelection(NSDictionary tabSelection) {
>>         _tabSelection = tabSelection;
>>         String tabLabelString = (String) 
>> _tabSelection.valueForKey("tabLabel");
>> 
>>     }
>>     
>>     public Object selectedTabsWOComponent() {
>>         return _tabSelection.valueForKey("wocomponent");
>>     }
>> 
>> On Jul 15, 2013, at 9:09 AM, Raymond NANEON <[email protected]> wrote:
>> 
>>> Hi Paul,
>>> 
>>> Thanks for your help.
>>> 
>>> Can I have detail of .java ? tabSelection nature?  observationsTab ?? where 
>>> do you use this component?
>>> Envoyé depuis iCloud
>>> 
>>> Le 15 jul 2013 à 05:07, Paul Yu <[email protected]> a écrit :
>>> 
>>>> Raymond
>>>> 
>>>> I had better success using CCTabPanel for dynamically creating tabs.
>>>> 
>>>> .html
>>>> 
>>>> <wo:CCAjaxTabPanelid="tabs"selectedTab="$tabSelection"tabs="$tabs"tabNameKey="tabLabel"useFormSubmit="$true">
>>>> <!--  <wo:str value = "$selectedTabsWOComponent" />-->
>>>> 
>>>> <wo:AjaxUpdateContainerid="ccTabContentContainer">
>>>>     
>>>> <wo:switchWOComponentName="$selectedTabsWOComponent"accessController="$accessController"evaluation="$evaluation"/>
>>>> </wo:AjaxUpdateContainer>
>>>> 
>>>> </wo:CCAjaxTabPanel>
>>>> 
>>>> 
>>>> .java
>>>> 
>>>>     private NSArray<NSDictionary> _tabs;
>>>>     
>>>>     public NSArray<NSDictionary> tabs() {
>>>>     if (_tabs == null) {
>>>>         // the evaluation has a method for getting the districtDomains
>>>>         NSMutableArray<NSDictionary> tabs = new 
>>>> NSMutableArray<NSDictionary>();
>>>>        
>>>>         NSMutableDictionary<Object, String> myTab1 = new 
>>>> NSMutableDictionary<Object, String>("My Tab Title", "tabLabel");
>>>>         observationsTab.takeValueForKey(ObservationSubTab.class.getName(), 
>>>> "wocomponent");
>>>> 
>>>> // More tabs here
>>>> 
>>>>         tabs.add(myTab1);
>>>> 
>>>>         _tabs = tabs.immutableClone();
>>>>     }
>>>>    
>>>>     return _tabs;
>>>> }
>>>> 
>>>> Paul
>>>> On Jul 15, 2013, at 4:18 AM, Raymond NANEON <[email protected]> wrote:
>>>> 
>>>>> Hi List,
>>>>> 
>>>>> I don't understand why item is null when I want to dynamically create 
>>>>> tabs in AjaxTabbedPanel using WORepetion.
>>>>> What's wrong in my codes?
>>>>> Envoyé depuis iCloud
>>>>> 
>>>>> Le 12 jul 2013 à 07:08, Raymond NANEON <[email protected]> a écrit :
>>>>> 
>>>>>> Hi List,
>>>>>> 
>>>>>> I want to create many of AjaxTabbedPanelTab from WORepetition in 
>>>>>> AjaxTabbedPanel.
>>>>>> 
>>>>>> html : 
>>>>>> 
>>>>>> <webobject name = "Tabs">
>>>>>>                             <webobject name = "repeatTabbedPanelTab">
>>>>>>                               <webobject name = 
>>>>>> "DynamiqueTab"><webobject name = "template" /></webobject>
>>>>>>                             </webobject>
>>>>>>                           </webobject>
>>>>>> 
>>>>>> wod : 
>>>>>> 
>>>>>> Tabs : AjaxTabbedPanel {
>>>>>>     id = tabsId;
>>>>>> }
>>>>>> 
>>>>>> repeatTabbedPanelTab : WORepetition {
>>>>>>     list = competences;
>>>>>>     item = competenceItem;
>>>>>>     identifier = dynaTabId;
>>>>>> }
>>>>>> 
>>>>>> DynamiqueTab : AjaxTabbedPanelTab {
>>>>>>     name = libelle;
>>>>>>     isSelected = false;
>>>>>>     id = dynaTabId;
>>>>>> }
>>>>>> 
>>>>>> template : TemplateCompTierBase {
>>>>>>     competence = competenceItem;
>>>>>>     domaine = competenceItem.domaine;
>>>>>>     editingContext = competenceItem.editingContext; 
>>>>>>     updateContainerID = TRCompoementId;
>>>>>> }
>>>>>> 
>>>>>> 
>>>>>> In this case (WORepetition in AjaxTabbedPanel) in  the repetition item 
>>>>>> is always NULL.
>>>>>> 
>>>>>> So when I put the AjaxTabbedPanel in the WORepetition, it works fine but 
>>>>>> I have many of AjaxTabbedPanel instead of many tabs.
>>>>>> 
>>>>>> Thanks for your help
>>>>>> Envoyé depuis iCloud
>>>>>> _______________________________________________
>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>> Webobjects-dev mailing list ([email protected])
>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>> https://lists.apple.com/mailman/options/webobjects-dev/rnaneon%40me.com
>>>>>> 
>>>>>> This email sent to [email protected]
>>>>>>  
>>>>> _______________________________________________
>>>>> Do not post admin requests to the list. They will be ignored.
>>>>> Webobjects-dev mailing list      ([email protected])
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>> https://lists.apple.com/mailman/options/webobjects-dev/pyu%40mac.com
>>>>> 
>>>>> This email sent to [email protected]
>>>>>  
>>>> 
>> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to