0
我想爲選定的日期製作每週範圍日期,當我點擊日曆上的某個日期時會捕獲該日期。這是我所做的代碼。每週日期範圍
package com.cc.cielo.backingbean.timesheet;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import org.joda.time.DateTime;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import com.cc.cielo.backingbean.BaseBackingBean;
import com.cc.cielo.managedbean.timesheet.TimesheetManagedBean;
@ManagedBean(name = "timesheetBackingBean")
@RequestScoped
public class TimesheetBackingBean extends BaseBackingBean<TimesheetManagedBean> {
public String createDateRange() {
Date selDate = this.getManagedBean().getSelectedDate();
return null;
}
public TimesheetBackingBean(){
}
}
<p:column colspan="2" >
</p:column>
<p:column colspan="7">
<p:panelGrid style="width:100%">
<p:row style="color: ##bfbfbf">
<p:column style="width:20%">
<p:button icon="ui-icon-triangle-1-w" disabled="false">
<f:param name="productId" value="10" />
</p:button>
</p:column>
<p:column style="width:60%; text-align:center">
<h:outputLabel value="#{timesheetBackingBean.createDateRange}" />
</p:column>
<p:column style="width:20%; text-align:right">
<p:button icon="ui-icon-triangle-1-e" disabled="false">
<f:param name="productId1" value="10" />
</p:button>
</p:column>
</p:row>
</p:panelGrid>
</p:column>
<p:column colspan="7" style="text-align: right;">
<p:calendar id="event" value="#{timesheetBackingBean.managedBean.selectedDate}" showOn="button" pattern="dd/MM/yyyy" mask="true">
<p:ajax event="dateSelect" listener="#{timesheetBackingBean.createDateRange}" />
</p:calendar>
</p:column>
</p:row>
</f:facet>
現在我想粘貼每週範圍從我所選用成輸出標籤的日期。
粘貼它?像在ctrl-v? – Kukeltje