You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gerry Kaplan <gk...@kaplansoftware.com> on 2005/09/26 22:00:35 UTC

Aggregate field; label won't display; please help.

I have a very small form that has the aggregate "date" field below. It is
being displayed as part of a "fi:group" with "fi:style layout='columns'". I
want the three fields to line up horizontally. I was able to figure out how
to get it to put the input fields horizontally, but I cannot get the label
to appear. There seems to be no documentation for the aggregate widget. Can
anyone shed some light on what's missing to get the label to show up?
Thanks!

>From the Model:
----------------------------------------------------------------------------
-------
<fd:aggregatefield id="exam-date">
    <fd:label>Date of exam:</fd:label>
    <fd:datatype base="string"/>
    <fd:split pattern="[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}">
        <fd:map group="1" field="year"/>
        <fd:map group="2" field="month"/>
        <fd:map group="3" field="day"/>
        <fd:failmessage>Invalid date format.</fd:failmessage>
    </fd:split>
    <fd:combine expression='Concat(year,"-",month,"-",day)'/>
    <fd:widgets>
        <fd:field id="year">
            <fd:label>Year</fd:label>
            <fd:datatype base="string"/>
            <fd:selection-list
src="../resources/selection-lists/SelectYear.xml"/>
        </fd:field>
        <fd:field id="month">
            <fd:label>Month</fd:label>
            <fd:datatype base="string"/>
            <fd:selection-list
src="../resources/selection-lists/SelectMonth.xml"/>
        </fd:field>
        <fd:field id="day">
            <fd:label>Day</fd:label>
            <fd:datatype base="string"/>
            <fd:selection-list
src="../resources/selection-lists/SelectDay.xml"/>
        </fd:field>
    </fd:widgets>
</fd:aggregatefield>

>From the Template
----------------------------------------------------------------------------
---
<fi:group>
    <fi:styling layout="columns"/>
    <fi:items>
        <ft:widget id="name">
            <fi:styling size="30"/>
        </ft:widget>
        <ft:widget id="reference"/>
        <ft:aggregate-widget id="exam-date">
            <fi:items>
                <ft:widget id="month"/>
                <span style="padding-left:.3em;
padding-right:.3em;">/</span>
                <ft:widget id="day"/>
                <span style="padding-left:.3em;
padding-right:.3em;">/</span>
                <ft:widget id="year"/>
            </fi:items>
        </ft:aggregate-widget>
        <ft:widget id="based-on"/>
        <ft:widget id="office"/>
    </fi:items>
</fi:group>


The output looks correct, but there is NO label for the aggregate-widget.

Thanks in advance for any help!

Gerry