0

I need to create four radio-buttons each of which should represent a specific date-interval. For instance, here is the piece of markup and the bean:

Bean:

@ManagedBean(name="bean")
public class MyBean{
    Date dateFrom;

    //GET, SET
}

Markup piece:

<h:selectOneRadio value="#{bean.dateFrom}">
    <f:selectItem itemValue="What?" itemLabel="#{msgs['bundleWithTodayLable']}"/>
    <f:selectItem itemValue="What?" itemLabel="#{msgs['bundleWithLastWeekLabel']}"/>
    <f:selectItem itemValue="What?" itemLabel="#{msgs['bundleWithLastYearLable']}"/>
</h:selectOneRadio>

I need to initialize the dateFrom property with the begin of today date, begin of the current week and begin of the current year. Is it possible to avoid Java-style String to Date conversions and do it strictly in JSF.

I'm using JSF 1.2 in the porjcet I need to implement that feature.

BalusC
  • 1,040,783
  • 362
  • 3,548
  • 3,513
St.Antario
  • 24,791
  • 31
  • 112
  • 278

0 Answers0