Example
| 01.11.2025 | ||||||
| 24.09.2025 | 01.10.2025 | 15.10.2025 | 28.02.2026 | |||
| 01.11.2025 |
Date
The jp:sbDateInterval (with SbDateIntervalHandler) is a deprecated date range selector.
The new implementation (with SbDateHandler) will be jp:sbDate with the following features:
- dateFrom as a java.time.LocalDate
- dateTo as a java.time.LocalDate
- Layout: dateFrom - calendarIcon - dateTo
- Both dateFrom and dateTo can be optional, in this case the input-field will not be rendered.
Features for future implementation:
- Minimums: dateFromMin and dateToMin
- Maximums: dateToMin and dateToMax
<jp:sbDate handler="#{sbDateBean.sbhD1}"/>
<jp:sbDate handler="#{sbDateBean.sbhD2}"/>
<jp:sbDate handler="#{sbDateBean.sbhD3}"/>
<p:panel header="Example" styleClass="jeesl-panel">
<h:panelGroup styleClass="jeesl-panelgrid-scrollview" layout="block">
<p:panelGrid columns="7" columnClasses="jeeslGrid10,jeeslGrid15,jeeslGrid15,jeeslGrid15,jeeslGrid15,jeeslGrid15,jeeslGrid15">
<p:outputLabel value="Handler"/>
<p:outputLabel value="minFrom"/>
<p:outputLabel value="dateFrom"/>
<p:outputLabel value="maxFrom"/>
<p:outputLabel value="minTo"/>
<p:outputLabel value="dateTo"/>
<p:outputLabel value="maxTo"/>
<p:outputLabel value="1"/>
<jp:outputDate value="#{sbDateBean.sbhD1.minFrom}"/>
<jp:outputDate value="#{sbDateBean.sbhD1.dateFrom}"/>
<jp:outputDate value="#{sbDateBean.sbhD1.maxFrom}"/>
<jp:outputDate value="#{sbDateBean.sbhD1.minTo}"/>
<jp:outputDate value="#{sbDateBean.sbhD1.dateTo}"/>
<jp:outputDate value="#{sbDateBean.sbhD1.maxTo}"/>
<p:outputLabel value="2"/>
<jp:outputDate value="#{sbDateBean.sbhD2.minFrom}"/>
<jp:outputDate value="#{sbDateBean.sbhD2.dateFrom}"/>
<jp:outputDate value="#{sbDateBean.sbhD2.maxFrom}"/>
<jp:outputDate value="#{sbDateBean.sbhD2.minTo}"/>
<jp:outputDate value="#{sbDateBean.sbhD2.dateTo}"/>
<jp:outputDate value="#{sbDateBean.sbhD2.maxTo}"/>
<p:outputLabel value="2"/>
<jp:outputDate value="#{sbDateBean.sbhD3.minFrom}"/>
<jp:outputDate value="#{sbDateBean.sbhD3.dateFrom}"/>
<jp:outputDate value="#{sbDateBean.sbhD3.maxFrom}"/>
<jp:outputDate value="#{sbDateBean.sbhD3.minTo}"/>
<jp:outputDate value="#{sbDateBean.sbhD3.dateTo}"/>
<jp:outputDate value="#{sbDateBean.sbhD3.maxTo}"/>
</p:panelGrid>
@Named @ViewScoped
public class SbDateBean extends AbstractJeeBean implements SbDateSelectionBean
{
final static Logger logger = LoggerFactory.getLogger(SbDateBean.class);
private static final long serialVersionUID = 1L;
private final SbDateHandler sbhD1; public SbDateHandler getSbhD1() {return sbhD1;}
private final SbDateHandler sbhD2; public SbDateHandler getSbhD2() {return sbhD2;}
private final SbDateHandler sbhD3; public SbDateHandler getSbhD3() {return sbhD3;}
public SbDateBean()
{
sbhD1 = SbDateHandler.instance(this).initToday();
sbhD1.setDateTo(null);
sbhD2 = SbDateHandler.instance(this).initMonths(1,3);
sbhD2.setMinFrom(sbhD2.getDateFrom().minusDays(7));
sbhD2.setMaxFrom(sbhD2.getDateFrom().plusDays(14));
sbhD3 = SbDateHandler.instance(this).initToday();
sbhD3.setDateFrom(null);
}
@PostConstruct
public void init()
{
super.initSecurity();
}
@Override
public void callbackDateChanged(SbDateSelection handler)
{
logger.info("Callback from "+handler.toString());
}
}
| Name | Required | Default | Description |
|---|---|---|---|
| handler | true | ||
| update | false | ||
| appBean | false | #{appSettingsBean} |