cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <u....@cbim.it>
Subject Re: Woody tab state control
Date Tue, 13 Apr 2004 07:30:23 GMT
Steve Steinitz wrote:
> Yes, we need to set it programmatically so we can keep the tab
> state when returning from another page.  Using your idea we still
> have:
> 
> <wi:group>
>     <wi:styling type = "tabs"/>
>         <wi:state>
>             <wt:widget id="tab-state"/>
>         </wi:state>
>     ...

Should work. Here is a snippet from an application in production using 
2.1.4:

               <wi:group>
                 <wi:styling type="tabs"/>
                 <wi:label>Scegli una scheda:</wi:label>
                 <wi:state>
                   <wt:widget id="tab-state"/>
                 </wi:state>

> But now, our bindings no longer include a tab-state binding. 
> Instead, per your idea, the flow does:
> 
>     var tabState = new java.lang.Integer(2); // for testing
>     form.getWidget("tab-state".value = tabState;
>     form.showForm();

And this is the flowscript part. In my case, the selected tab is 
requested in the HTTP query string:

if (cocoon.request.tab != undefined) {
   form.getWidget().getWidget("tab-state").setValue(cocoon.request.tab);
}

> Still, this has no effect on the selected tab.  Should it work? 

It should work, as long as you also put something like the following in 
your form definition file:
	
     <wd:field id="tab-state">
       <wd:datatype base="string"/>
     </wd:field>

With these three snippets, everything works, at least with 2.1.4.

> Moreover, isn't your method just another way to do a binding and
> therefore more or less the same as what we were originally doing?

No, you were originally passing the index of the current tab via the 
bizData argument to showForm. This has nothing to do with binding.

	Ugo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message