cancel
Showing results for 
Search instead for 
Did you mean: 

new date type on HEAD version??

tiofelix
Champ in-the-making
Champ in-the-making
I download the last code from the web site http://www.alfresco.org/alfresco/HEAD with snv, something changes about –>

          
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
  …
<type…>
   …
  <properties>
        …
      <property name="my:dataen">
            <type>d:date</type>
      </property>
  </properties>
</type>

but now these properties can not be showed… "None" appears.
12 REPLIES 12

gavinc
Champ in-the-making
Champ in-the-making
Then you create a copy of the DatePickerRenderer in faces-config-beans.xml and place it in your faces config file and give it a different name i.e. MyDatePickerRenderer.

Then in the property config for those properties that you want to have today's date use component-generator="MyDatePickerRenderer" and for those that need "None" just leave them as is and they will default to the standard  DatePickerRenderer.

tiofelix
Champ in-the-making
Champ in-the-making
Ok Gavin, but i don't have to create another DatePickerGenerator too??

Thanks.

gavinc
Champ in-the-making
Champ in-the-making
No, you don't need to implement another component generator you just have to copy the configuration which will create a new instance of the component generator. For example you would end up with:

<managed-bean>
   <managed-bean-name>DatePickerGenerator</managed-bean-name>
   <managed-bean-class>org.alfresco.web.bean.generator.DatePickerGenerator</managed-bean-class>
   <managed-bean-scope>request</managed-bean-scope>
</managed-bean>

<managed-bean>
   <managed-bean-name>TodayDatePickerGenerator</managed-bean-name>
   <managed-bean-class>org.alfresco.web.bean.generator.DatePickerGenerator</managed-bean-class>
   <managed-bean-scope>request</managed-bean-scope>
   <managed-property>
      <property-name>initialiseIfNull</property-name>
      <value>true</value>
   </managed-property>
</managed-bean>

You can then have 2 date properties that behave differently:

<show-property name="my:todayDate" component-generator="TodayDatePickerGenerator" />

<show-property name="my:noneDate" />