You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Kevin C. Dorff" <kd...@kcp.com> on 2004/02/06 17:46:40 UTC
Confused, component, parameters, table....
I have a component that takes a few required parameters.... Below are
the relavent parts, I believe:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE component-specification
PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
<component-specification
allow-body="yes"
allow-informal-parameters="no"
class="fmtnm.jobcost.view.components.SearchResults">
<!-- Incoming required parameters -->
<parameter name="searchTableName" type="java.lang.String"
required="yes" direction="in"/>
<parameter name="summaryTableName" type="java.lang.String"
required="yes" direction="in"/>
<!-- summary components -->
<component id="totalCostInsert" type="Insert">
<binding name="value" expression="summary.totalCost"/>
</component>
<!-- table stuff -->
<!-- Contrib:TableView of results -->
<component id="reportedTableView" type="contrib:TableView">
<binding name="tableModel" expression="resultsTable.tableModel" />
<binding name="tableSessionStateManager"
expression="resultsTable.sessionStateManager" />
</component>
<component id="reportedTableColumns" type="contrib:TableColumns"/>
<component id="reportedTableRows" type="contrib:TableRows">
<binding name="value" expression="currentRow" />
<binding name="class" expression="beans.rowClass.next" />
</component>
<component id="reportedTablePages" type="contrib:TablePages"/>
<component id="reportedTableValues" type="LinkTableValues"/>
</component-specification>
And some related code
public abstract String getSearchType();
public Summary getSummary() {
if (oSummary == null) {
String sTableName = getSummaryTableName();
oSummary = SummaryDb.getSummary(sTableName);
}
return (oSummary);
}
public FmtnmTable getResultsTable() {
Visit visit = (Visit)getPage().getVisit();
if (reportedItemsTable == null) {
reportedItemsTable =
new FmtnmTable(new ResultsQuery(getSearchTableName(),
PAGE_SIZE));
}
return reportedItemsTable;
}
The issue I have is that when I run the code, specifically I am just
trying to run it through Eclipse debug, if I put a breakpoint in
getSummary() and in getResultsTable(), getResultsTable() is executed
first but the parameters are NOT YET SET!! It runs getResultsTable()
several times as one would expect and each time through I can see that
the parameters have not been set. The result is that the execution of
the abstract getSearchTableName() is a null. Argh.
When getSummary() is executed, the parameters _ARE_ set correctly, so
getSummaryTableName() works right (and since the parameters are set
getResultsTable() would have been right too).
This seems like a bug in Tapestry. Is this one of those "that is fixed
in CVS things" or ??
Help!
Kevin
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Confused, component, parameters, table....
Posted by "Kevin C. Dorff" <kd...@kcp.com>.
OK, I finally noticed 3.0 Beta 4 was available (missed the announcement
yesterday afternoon), downloaded it, and it fixed these bugs. One more
problem to fix, it looks like, but at least trace better in the debugger ;)
Kevin
Kevin C. Dorff wrote:
> One other equally confusing followup: The table is wrapped within a
> conditional. Even when the conditional is false the table code --
> getResultsTable() -- is being executed.
>
> Kevin C. Dorff wrote:
>
>> I have a component that takes a few required parameters.... Below are
>> the relavent parts, I believe:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE component-specification
>> PUBLIC "-//Apache Software Foundation//Tapestry Specification
>> 3.0//EN"
>> "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
>> <component-specification
>> allow-body="yes"
>> allow-informal-parameters="no"
>> class="fmtnm.jobcost.view.components.SearchResults">
>> <!-- Incoming required parameters -->
>> <parameter name="searchTableName" type="java.lang.String"
>> required="yes" direction="in"/>
>> <parameter name="summaryTableName" type="java.lang.String"
>> required="yes" direction="in"/>
>> <!-- summary components -->
>> <component id="totalCostInsert" type="Insert">
>> <binding name="value" expression="summary.totalCost"/>
>> </component>
>> <!-- table stuff -->
>> <!-- Contrib:TableView of results -->
>> <component id="reportedTableView" type="contrib:TableView">
>> <binding name="tableModel"
>> expression="resultsTable.tableModel" />
>> <binding name="tableSessionStateManager"
>> expression="resultsTable.sessionStateManager" />
>> </component>
>> <component id="reportedTableColumns" type="contrib:TableColumns"/>
>> <component id="reportedTableRows" type="contrib:TableRows">
>> <binding name="value" expression="currentRow" />
>> <binding name="class" expression="beans.rowClass.next" />
>> </component>
>> <component id="reportedTablePages" type="contrib:TablePages"/>
>> <component id="reportedTableValues" type="LinkTableValues"/>
>> </component-specification>
>>
>> And some related code
>>
>> public abstract String getSearchType();
>>
>> public Summary getSummary() {
>> if (oSummary == null) {
>> String sTableName = getSummaryTableName();
>> oSummary = SummaryDb.getSummary(sTableName);
>> }
>> return (oSummary);
>> }
>>
>> public FmtnmTable getResultsTable() {
>> Visit visit = (Visit)getPage().getVisit();
>> if (reportedItemsTable == null) {
>> reportedItemsTable =
>> new FmtnmTable(new ResultsQuery(getSearchTableName(),
>> PAGE_SIZE));
>> }
>>
>> return reportedItemsTable;
>> }
>>
>> The issue I have is that when I run the code, specifically I am just
>> trying to run it through Eclipse debug, if I put a breakpoint in
>> getSummary() and in getResultsTable(), getResultsTable() is executed
>> first but the parameters are NOT YET SET!! It runs getResultsTable()
>> several times as one would expect and each time through I can see
>> that the parameters have not been set. The result is that the
>> execution of the abstract getSearchTableName() is a null. Argh.
>>
>> When getSummary() is executed, the parameters _ARE_ set correctly, so
>> getSummaryTableName() works right (and since the parameters are set
>> getResultsTable() would have been right too).
>>
>> This seems like a bug in Tapestry. Is this one of those "that is
>> fixed in CVS things" or ??
>>
>> Help!
>> Kevin
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Confused, component, parameters, table....
Posted by "Kevin C. Dorff" <kd...@kcp.com>.
One other equally confusing followup: The table is wrapped within a
conditional. Even when the conditional is false the table code --
getResultsTable() -- is being executed.
Kevin C. Dorff wrote:
> I have a component that takes a few required parameters.... Below are
> the relavent parts, I believe:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE component-specification
> PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
> "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
> <component-specification
> allow-body="yes"
> allow-informal-parameters="no"
> class="fmtnm.jobcost.view.components.SearchResults">
> <!-- Incoming required parameters -->
> <parameter name="searchTableName" type="java.lang.String"
> required="yes" direction="in"/>
> <parameter name="summaryTableName" type="java.lang.String"
> required="yes" direction="in"/>
> <!-- summary components -->
> <component id="totalCostInsert" type="Insert">
> <binding name="value" expression="summary.totalCost"/>
> </component>
> <!-- table stuff -->
> <!-- Contrib:TableView of results -->
> <component id="reportedTableView" type="contrib:TableView">
> <binding name="tableModel" expression="resultsTable.tableModel" />
> <binding name="tableSessionStateManager"
> expression="resultsTable.sessionStateManager" />
> </component>
> <component id="reportedTableColumns" type="contrib:TableColumns"/>
> <component id="reportedTableRows" type="contrib:TableRows">
> <binding name="value" expression="currentRow" />
> <binding name="class" expression="beans.rowClass.next" />
> </component>
> <component id="reportedTablePages" type="contrib:TablePages"/>
> <component id="reportedTableValues" type="LinkTableValues"/>
> </component-specification>
>
> And some related code
>
> public abstract String getSearchType();
>
> public Summary getSummary() {
> if (oSummary == null) {
> String sTableName = getSummaryTableName();
> oSummary = SummaryDb.getSummary(sTableName);
> }
> return (oSummary);
> }
>
> public FmtnmTable getResultsTable() {
> Visit visit = (Visit)getPage().getVisit();
> if (reportedItemsTable == null) {
> reportedItemsTable =
> new FmtnmTable(new ResultsQuery(getSearchTableName(),
> PAGE_SIZE));
> }
>
> return reportedItemsTable;
> }
>
> The issue I have is that when I run the code, specifically I am just
> trying to run it through Eclipse debug, if I put a breakpoint in
> getSummary() and in getResultsTable(), getResultsTable() is executed
> first but the parameters are NOT YET SET!! It runs getResultsTable()
> several times as one would expect and each time through I can see that
> the parameters have not been set. The result is that the execution of
> the abstract getSearchTableName() is a null. Argh.
>
> When getSummary() is executed, the parameters _ARE_ set correctly, so
> getSummaryTableName() works right (and since the parameters are set
> getResultsTable() would have been right too).
>
> This seems like a bug in Tapestry. Is this one of those "that is fixed
> in CVS things" or ??
>
> Help!
> Kevin
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org