« Return to Thread: ViewTabs

Re: ViewTabs

by Janko Mivsek :: Rate this Message:

Reply to Author | View in Thread

Hi Nicholas,

Good that you pointed out WebTabs too, which are more general tabs to
switch between arbitrary App and views, and even foreign pages.
Otherwise look at the WebTabs hierarcy to see them all:

Object
   WebElement
     WebList
       WebTabs
         ViewTabs

WebTabs comment: WebTabs are visual selection tool. selected tab is in
front, others are back and have url links.
By default an instance have CSS class 'webtabs' and selected tab
'webtabselected"

Usage:
        self addTextBold: 'Selected without link'.
        self addLinkTo: someObject text: 'not-selected with link' view: #view.
        self selected: 1.


ViewTabs comment: For quick selection of App views. Just fill with view
names and descriptions, all other will be automatic. Tab for curently
shown will be colored as shown, other tabls will have links to self
observee and appropriate view

Janko


Nicholas Moore wrote:

> Rob
>
> Each of my WebApp pages (viewMain) does:
>
> viewMain
>     | e |
>     e := WebElement new.
>     self session parent site style
>         headerAddTabs: e
>         selected: 1
>         label: 'Home'.
> etc ...
>
>
> which is implemented in my subclass of WebStyle:
>
> headerAddTabs: anElement selected: aNumber label: aLabel
>     | anE newOC |
>     newOC := OrderedCollection new.
>     anE := WebElement new addText: aLabel attributes: #bold.
>     newOC add: anE.
>     anElement add: ((WebTabs new)
>                 addLinkTo: './centre.html' text: 'Home';
>                 addLinkTo: './forum.html' text: 'Forum';
>                 addLinkTo: './news.html' text: 'News';
>                 addLinkTo: './history.html' text: 'History';
>                 addLinkTo: './search.html' text: 'Search';
>                 selected: aNumber).
>     (anElement elements first elements at: aNumber) initElements elements
>         add: anE.
>     anElement addNbSp.
>     ^anElement
>
> check out:
> http://www.c4cnc.org for an example.
>
> Nicholas
>
>
> Rob Rothwell wrote:
>> Are ViewTabs meant to be used when you have several views you want to
>> display within a single WebApplication?  Does anyone have an example?  
>> When I create the following, clicking on ANY of the tabs simply takes
>> me to #viewMain:
>>
>> MyApp>>tabComponent
>>     | e |
>>     e := ViewTabs new.
>>     e addView: #viewMain description: 'Tab1'.
>>     e addView: #viewDiagnosis description: 'Tab2'.
>>     e addView: #viewProcedures description: 'Tab3'.
>>     ^ e
>>
>> and
>>
>> MyApp>>viewMain
>>     |e|
>>     e := WebElement newId: #content.
>>     e addTextH1: 'My Application'.
>>     e addBreak.
>>     e add: self tabComponent.
>>     e addText: 'Main View'.
>>     self pageFrameWith: e title: 'My Application'
>>
>> MyApp>>viewDiagnosis
>>     |e|
>>     e := WebElement newId: #content.
>>     e addTextH1: 'My Application'.
>>     e addBreak.
>>     e add: self tabComponent.
>>     e addText: 'Diagnosis View'.
>>     self pageFrameWith: e title: 'My Application'
>>
>>
>> MyApp>>viewProcedures
>>     |e|
>>     e := WebElement newId: #content.
>>     e addTextH1: 'My Application'.
>>     e addBreak.
>>     e add: self tabComponent.
>>     e addText: 'Procedure View'.
>>     self pageFrameWith: e title: 'My Application'
>>
>> Rob
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Aida mailing list
>> Aida@...
>> http://lists.aidaweb.si/mailman/listinfo/aida
>>  
>
> --
>
> *Nicholas J Moore*
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Aida mailing list
> Aida@...
> http://lists.aidaweb.si/mailman/listinfo/aida

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
Aida@...
http://lists.aidaweb.si/mailman/listinfo/aida

 « Return to Thread: ViewTabs

LightInTheBox - Buy quality products at wholesale price