You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ZongoZongo <nr...@gmx.net> on 2007/01/04 12:11:57 UTC

cforms: tabs in an aggregated page

Hi

My page is aggregated of an aggregator. 
Now I wont to place a Form with tabs. Could somebody give me some hints how
this might work?
The probelm is, that I cant use the <head/> tag in my template, because this
is done finally by an xsl-file after the aggregation. I also tried to copy
the script, that is placed by cocoon in the header,  later inside the
xsl-file manually.
But it doesnt work. I just can see just the tab-labels and the content of
the first group.

kind regards,

Niclas
-- 
View this message in context: http://www.nabble.com/cforms%3A-tabs-in-an-aggregated-page-tf2918903.html#a8157390
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Re: cforms: tabs in an aggregated page

Posted by ZongoZongo <nr...@gmx.net>.
Ok, I solved the problem with the missing <head/> tag but it still dosnt
work. 
Here is a little code. 

###########################

<map:resources>		
		<map:resource name="page.html">
			<map:aggregate element="site">
				<map:part element="navigation" src="cocoon:/navigation"
strip-root="true"/>
				<map:part src="cocoon:/{page}.source" element="main"/>
				<map:part element="header" src="header.xml" strip-root="true"/>
			</map:aggregate>
			<map:transform type="xslt" src="stylesheets/finalize.xsl"/>
			<map:transform src="forms-samples-styling.xsl"/>
			<map:serialize type="html"/>
		</map:resource>
</map:resources>
...
//calls resource
 <map:match pattern="**">
		     <map:call resource="page.html">
		       <map:parameter name="page" value="{0}"/>
		     </map:call>
</map:match> 
...
//calls flow
<map:match pattern="tabs.source">
	<map:call function="tabs"/>
</map:match>
...
//generates form
<map:match pattern="form/template/*.source">
				<map:generate type="jx" src="forms/{1}-template.xml"/>
				<map:serialize type="xml"/>
</map:match>	

//flow
function tabs(){
	var form = new Form("forms/tabs-definition.xml");
	form.showForm("form/template/tabs.source");
}
FormModel:
<?xml version="1.0"?>
<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">

    <fd:widgets>
        <fd:field id="firstName" required="true">
            <fd:label>Vorname</fd:label>
            <fd:datatype base="string" />
            <fd:validation>
                <fd:length min="2">
                    <fd:failmessage>Der Vorname muss aus mindestens 2
Zeichen bestehen.</fd:failmessage>
                </fd:length>
            </fd:validation>
        </fd:field>
      
        <fd:field id="cars">
            <fd:label>Cars</fd:label>
            <fd:datatype base="string"/>
            <fd:selection-list>
         		<fd:item value="BMW"/>
                <fd:item value="Mercedes"/>
                <fd:item value="Porsche"/>
                <fd:item value="Audi"/>
            </fd:selection-list>
        </fd:field>
        
        <fd:field id="activeTab">
  			<fd:datatype base="integer"/>
		</fd:field>
        
    </fd:widgets>
</fd:form>

Formtemplate
<div xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
	xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
	xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">

	<jx:import
		uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml" />

		<ft:form-template action="${continuation.id}.cont"
			method="POST">
			<fi:group>
				<!-- Alternativer Wert fuer type: choice -->
				<fi:styling type="tabs" />
				<fi:state>
					<ft:widget id="activeTab" />
				</fi:state>
				<fi:items>
					<fi:group>
						<fi:label>Personendaten</fi:label>
						<!-- Anstelle von table koennen Sie hier auch wieder fi:styling
verwenden -->
						<table>
							<tr>
								<td>
									<ft:widget-label id="firstName" />
								</td>
								<td>
									<ft:widget id="firstName" />
								</td>
							</tr>
						</table>
					</fi:group>
					<fi:group>
						<fi:label>Hobbies</fi:label>
						<!-- Anstelle von table koennen Sie hier auch wieder fi:styling
verwenden -->
						<table>
							<tr>
								<td>
									<ft:widget-label id="cars" />
								</td>
								<td>
									<ft:widget id="cars" />
								</td>
							</tr>
						</table>
					</fi:group>
				</fi:items>
			</fi:group>
			<br />
			<input type="submit" value="Anmelden" />
		</ft:form-template>
</div>
#######################

Because the sample runs if I dont use any aggregator I assume the fault is
somewhere in the Sitemap.
So please guys, help me out ;-)

kind regards,

Niclas

-- 
View this message in context: http://www.nabble.com/cforms%3A-tabs-in-an-aggregated-page-tf2918903.html#a8179694
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Re: cforms: tabs in an aggregated page

Posted by ZongoZongo <nr...@gmx.net>.
The tabs are not shown. Just their labels are listed and the content of the
first group. 

Mark Lundquist-2 wrote:
> 
> 
> On Jan 8, 2007, at 7:29 AM, ZongoZongo wrote:
> 
>> I really need to solve this problem. Otherwise I cant proceed my 
>> project :-(
> 
> What problem, exactly?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/cforms%3A-tabs-in-an-aggregated-page-tf2918903.html#a8220293
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Re: cforms: tabs in an aggregated page

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jan 8, 2007, at 7:29 AM, ZongoZongo wrote:

> I really need to solve this problem. Otherwise I cant proceed my 
> project :-(

What problem, exactly?


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


Re: cforms: tabs in an aggregated page

Posted by ZongoZongo <nr...@gmx.net>.
Maybe someone of you could give me an example of an aggregated page where
tabs in CForms work fine.
I really need to solve this problem. Otherwise I cant proceed my project :-(

kind regards,

Niclas


ZongoZongo wrote:
> 
> Hi
> 
> My page is aggregated of an aggregator. 
> Now I wont to place a Form with tabs. Could somebody give me some hints
> how this might work?
> The probelm is, that I cant use the <head/> tag in my template, because
> this is done finally by an xsl-file after the aggregation. I also tried to
> copy the script, that is placed by cocoon in the header,  later inside the
> xsl-file manually.
> But it doesnt work. I just can see just the tab-labels and the content of
> the first group.
> 
> kind regards,
> 
> Niclas
> 

-- 
View this message in context: http://www.nabble.com/cforms%3A-tabs-in-an-aggregated-page-tf2918903.html#a8219945
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Cforms: set output value with i18n

Posted by Ady Person <ap...@centrum.sk>.
Hi,

is there a way, how to set a value of output widget with i18n message?

Something like widget.setValue(new I18NMessage(key, catalogue)) ?

Thanks
Ady


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


Re: cforms: tabs in an aggregated page

Posted by ZongoZongo <nr...@gmx.net>.
Ok, now I solved the problem. I had an fault inside the matcher that is
responsible for the ressources.

kind regards,

Niclas


ZongoZongo wrote:
> 
> Ok, now its getting really strange!
> I built a new basic application only with the files ein I need to display
> the tabbed form (header and navigation all the same like in the app where
> the form doesnt work). And It works fine!
> Now I used a tool to compare the htmlfile (generated by cocoon)  of the
> first app that doesnt display the form correctly and the htmlfile of this
> new applikation where everything works fine. And they are identical
> (except tab id and continuation id).
> Who can explain me that? two identical files, two different
> representations? I am really confused!
> 
> kind regards,
> 
> Niclas
> 

-- 
View this message in context: http://www.nabble.com/cforms%3A-tabs-in-an-aggregated-page-tf2918903.html#a8235331
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Re: cforms: tabs in an aggregated page

Posted by ZongoZongo <nr...@gmx.net>.
Ok, now its getting really strange!
I built a new basic application only with the files ein I need to display
the tabbed form (header and navigation all the same like in the app where
the form doesnt work). And It works fine!
Now I used a tool to compare the htmlfile (generated by cocoon)  of the
first app that doesnt display the form correctly and the htmlfile of this
new applikation where everything works fine. And they are identical (except
tab id and continuation id).
Who can explain me that? two identical files, two different representations?
I am really confused!

kind regards,

Niclas
-- 
View this message in context: http://www.nabble.com/cforms%3A-tabs-in-an-aggregated-page-tf2918903.html#a8235066
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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