import org.apache.tapestry.AbstractComponent; import java.util.Date; import java.text.Format; import java.text.SimpleDateFormat; public abstract class BoxInventory extends AbstractComponent { private Format _dateFormat;
public Format getDateFormat() { if (_dateFormat == null) _dateFormat = new SimpleDateFormat("yyyy-MM-dd"); return _dateFormat; } public abstract Date getQuoteDate(); } Also you must implement the renderComponent() method. http://jakarta.apache.org/tapestry/UsersGuide/components.html#N100C2 Sergiy ====================== Multiplex Systems LLC http://www.mpxsys.com ====================== > -----Original Message----- > From: Schabek Lukasz [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 25, 2006 5:22 PM > To: Tapestry users > Subject: DatePicker in component. > > > Hi! > > I've create some components inside page of my application. > > Edit.html > ================== > <html> > <head> > <title>Edycja</title> > </head> > <body jwcid="@Body"> > <span jwcid="@index" title="Edycja"> > <fieldset> > <!-- Form --> > <form jwcid="@Form" listener="listener:onOk"> > <span jwcid="@BoxPassport"></span> > <span jwcid="@BoxInventory"></span> > <span jwcid="@BoxPreparation"></span> > <span jwcid="@BoxScanning"></span> > <span jwcid="@BoxKSPUpdate"></span> > <span jwcid="@BoxReceipt"></span> > <span jwcid="@BoxPurchase"></span> > </form> > </fieldset> > </span> > </body> > </html> > =================== > Edit.page: > =================== > <?xml version="1.0"?> > <!DOCTYPE page-specification PUBLIC > "-//Apache Software Foundation//Tapestry Specification 4.0//EN" > "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd"> > <page-specification class="com.mycom.MyApp.edit.EditRecord"> > </page-specification> > =================== > Each of @Box* component is a simple formated HTML fields for Form. > In those component i've try to insert a DatePicker, but... It doesn't > work. > I.e. > BoxInventory.jwc: > =================== > <component-specification > class="com.mycom.MyApp.components.edit.BoxInventory" > allow-informal-parameters="no"> > <component id="quoteDate" type="DatePicker"> > <binding name="value" value="quoteDate"/> > <binding name="translator" > value="translator:date,pattern=yyyy-MM-dd"/> > </component> > </component-specification> > =================== > BoxInventory.html: > =================== > <!-- tables,inputs etc. --> > <span jwcid="quoteDate">May 3, 2005</span> > <!-- ... --> > =================== > BoxInventory.class: > =================== > import java.util.Date; > import java.text.Format; > import java.text.SimpleDateFormat; > > public abstract class BoxInventory { > private Format _dateFormat; > > public Format getDateFormat() > { > if (_dateFormat == null) > _dateFormat = new SimpleDateFormat("yyyy-MM-dd"); > > return _dateFormat; > } > public abstract Date getQuoteDate(); > } > ====================== > When i try to run application it gives me an exception: > Class com.mycom.MyApp.components.edit.BoxInventory does not implement the > IComponent interface. > But i have no idea how to implemetn Icomponent interface,,, can you help > me? > I have searched tapestry web > For examples but found nothing... > > Sorry for my bad eanglish... > > [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]