How to change the clientId for AbstractField parent class
I'd like to pragmatically change the super-class's field 'clientId' so that I can get a good string value coming into processSubmission. However... AbstractField.getClientId() is final and cannot be overridden. Rather than re-writing (or copy/pasting) AbstractField to simply provide a setClientId() method or make getClientId() non-final, I thought I might try something a bit hackish. I've tried getting a propertyconduit (but it complains the field is readonly; as it is bound to 'componentResources.id'). I would like to try a ParameterAccess but I cannot seem to get a handle on one from inside the component (which currently extends AbstractField). Is this what createDefaultParameterBinding() is meant for? I can't seem to figure that one out. Is there a better way to do this? Tapestry can write to the field, so I know that it is possible in theory. -- Robert Hailey tapestry 5.1.0.5 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to change the clientId for AbstractField parent class
On Wed, 14 Apr 2010 18:32:39 -0300, Robert Hailey rob...@cmediacorp.com wrote: I'd like to pragmatically change the super-class's field 'clientId' so that I can get a good string value coming into processSubmission. What exactly are you trying to implement? -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to change the clientId for AbstractField parent class
On Apr 14, 2010, at 4:36 PM, Thiago H. de Paula Figueiredo wrote: On Wed, 14 Apr 2010 18:32:39 -0300, Robert Hailey rob...@cmediacorp.com wrote: I'd like to pragmatically change the super-class's field 'clientId' so that I can get a good string value coming into processSubmission. What exactly are you trying to implement? Well... it's a conglomerate field which is backed by a hibernate pojo and represents a date range (so it contains two dateFields). So I'd like to be able to render it as: t:dateRangeField value=dbPojo/ At present I just copied/modified AbstractField to get setClientId access, and it mostly works. It looks like tapestry now and then does not initialize one of the injected parameters during the processSubmission time, though. Since my client id is derived from the hibernate id, I can easily reload it (it's just a bit kludge-ish). -- Robert Hailey
Re: How to change the clientId for AbstractField parent class
On Wed, 14 Apr 2010 19:10:10 -0300, Robert Hailey rob...@cmediacorp.com wrote: Well... it's a conglomerate field which is backed by a hibernate pojo and represents a date range (so it contains two dateFields). In this case, keep the original id as is and use it as a prefix to the other two dateFields: String idDateField1 = getClientId() + -start; String idDateField2 = getClientId() + -end; -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org