Can you mail the component specification of your custom component.


Muralidhar Y
Software Engineer,
Adastrum technologies-Nikai groups,
EmiratesGroup-I.T Division,
Dubai, UAE.
Mobile : 00971-50-2256149.
http://www.adastrumtech.com
http://www.mercator.aero  
(Keep Smiling. Be happy All The Time.)

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of TappApp
Sent: 06 October 2005 07:10
To: Tapestry users
Subject: When/How to programatically modify a component before render.

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

Reply via email to