You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Phil Ulrich <ph...@gmail.com> on 2005/10/12 19:44:46 UTC

Passing parameters to a component

Background: What I am trying to do is make a component that wraps a
Table. The idea is to have something like this, visually:

(letter A-Z, plus a # for numbers)
(the table itself)
(the table pages - 1, 2, 3, etc.)

Clicking a letter would filter the source to just objects with a
certain attribute beginning with that letter, and the pages would
function as normal. That part I can do. The issue is with passing in a
source and columns parameter to the table within my component. Right
now, the relevant portion of my component's .jwc file looks like this:

    <parameter name="source" required="yes"
type="java.util.Collection" direction="in"
property-name="incomingSource" />
    <parameter name="columns" required="yes" type="java.lang.Object"
direction="in" property-name="incomingColumns" />
    <parameter name="row" required="no" type="java.lang.Object"
direction="form" property-name="incomingRow" />

    <property-specification name="entireSource"
        persistent="yes"
        type="java.util.Collection" />

    <component id="tableView" type="contrib:TableView">
        <property name="source" value="incomingSource" />
        <property name="columns" value="incomingColumns" />
    </component>

    <component id="tableColumns" type="contrib:TableColumns" />

    <component id="tableRows" type="contrib:TableRows">
        <property name="row" value="incomingRow" />
    </component>

And in my Java source I have this:
    public abstract Collection getIncomingSource();
    public abstract Object getIncomingColumns();
    public abstract Object getIncomingRow();

    public abstract void setIncomingSource(Collection c);
    public abstract void setIncomingColumns(Object o);
    public abstract void setIncomingRow(Object o);

There are no property-specifications for the incomingSource,
incomingColumns, and incomingRow because from what I can gather from
the few mailing list messages on this topic, the appropriate methods
are created by Tapestry.

The problem is that if I DON'T add property-specification elements for
the three incoming* parameters, I get this error:

ApplicationRuntimeException - Either the tableModel parameter or both
source and columns parameters must be specified by component
Home/childTable.tableView

And if I DO add them, I get this error:

ApplicationRuntimeException - Unable to define class
package.name.Class$Enhance_19: package/name/Class$Enhance_19
(Repetitive field name/signature)

I'm at a loss for what to do. Anyone?

--Phil Ulrich

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org