You don't need to.
lets say your parent component P takes a parameter A.
you want to manipulate A and pass it to one or more components inside of
P (child components, C1..Cx).
So, you don't use the A binding directly, instead you use a property in
your component class which delivers the manipulated data:
<property name="b" initial-value="manipulate(a)"/>
<component-specification...>
<component id="C1" ...>
<binding name="a" value="b"/>
...
now in your component class
private abstract A getA();
public B manipulate(A a) {
// do something with getA() and deliver the result...
}
ציטוט TappApp:
Hello,
First off, I'm using Tapesty 3, not 4.
I have a page, that has a custom component I created on it.
That custom component has a web template, and a number of other components
embedded in it.
I need to programatically set one of the parameters in one of the components
embedded in the custom component.
I had NO PROBLEM doing this, when the "AddressElements" (see code below)
component was part of the page spec, but now that I've added the component
to my custom component, I get this error :
"Page recorder for page InvestorCreateListing is locked after a commit(),
but received a change to property stateCode of component
InvestorCreateListing/EditListing.AddressElements."
Here's the code in my custom component :
/**
* @see org.apache.tapestry.BaseComponent#renderComponent(
org.apache.tapestry.IMarkupWriter,
* org.apache.tapestry.IRequestCycle)
*/
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
{
if (!cycle.isRewinding())
{
initStateCode();
}
super.renderComponent(writer, cycle);
}
/**
*
*/
private void initStateCode()
{
AddressElements addressElements = (AddressElements)
getComponent("AddressElements");
if (addressElements.getStateCode() == null)
{
addressElements.setStateCode("TX");
}
}
I'm trying to give the "stateCode" an initial value if it does not already
have one.
What am I doing wrong ?
Thanks in advance,
TappApp
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]