我有一个方法A(),它在点击的Button上执行。这是在backingBean(Onserver)和View(ClientSide)上出现的,我显示了一个p:对话框。 方法A()包含一个for循环然后在这个循环的每个循环中我会知道这个循环所在的步骤吗?
BackingBean代码:
@ManagedBean(name = "generationBean")
@SessionScoped
public class GenerationBean implements Serializable {
@ManagedProperty(value = "#{appBean}")
private AppBean applicationBean;
@ManagedProperty(value = "#{login}")
private Login loginB;
@EJB
private UserFacadeLocal userFacade;
@EJB
private GeneralSettingsFacadeLocal generalSettingFacade;
@EJB
private GenerationHistoryFacadeLocal generationHistoryFacade;
@EJB
private GenerationSiteFacadeLocal generationSiteFacade;
@EJB
private HistorySiteGenerationFacadeLocal historySiteGenerationFacade;
@PostConstruct
public void init() {
selectedRegion = "choix";
setLabelBoutonGen("Générer");
loadDirectoryRegion();
generatedSites = new ArrayList();
}
public void genererDPT() throws InterruptedException, FileNotFoundException {
generatedSites = new ArrayList();
String formatTime = "H_mm_ss";
for (Iterator it = sitesDest.iterator(); it.hasNext();) {
String obj = it.next().toString();
currentSite = obj;
if (selectedTypeOt.equals("OT IUB enchaîné (BBB+ATM+ATM RNC+ATM NodeB+DCN NodeB)")) {
currentStatus = jh.callExcelMacroOtEnchaine(newRecordingPath, csvPath.replace("/", "\\") + "\\", selectedRegion, file, equivalentOT, obj, isChechBoxGSMValue(), isChechBoxDCSValue(), isChechBoxU900Value(), isChechBoxUMTSValue(), userName + "." + userFirstName + "\\" + genFolder, selectedTechnology);
} else {
currentStatus = jh.callExcelMacro(newRecordingPath, csvPath.replace("/", "\\") + "\\", selectedRegion, file, equivalentOT, obj, isChechBoxGSMValue(), isChechBoxDCSValue(), isChechBoxU900Value(), isChechBoxUMTSValue(), userName + "." + userFirstName + "\\" + genFolder);
}
generatedSites.add(new GeneratedSiteStatus(currentSite, currentStatus));
context.update("genDialog");
RequestContext.getCurrentInstance().update(":blockA:initGenPan:sitesDataList");
}
}`
在此对话框中更改后,我会显示生成的列表:
<p:dialog id="genDialog" header="Opération de génération" closable="false" modal="true" widgetVar="dlg1">
<h:form id="dialogForm">
<p:panel style="border-spacing: 0px;" >
<h:panelGrid columns="1">
<h:outputText value="le traitement de la génération est en cours..." />
<p:dataList id="sitesDataList" value="#{generationBean.generatedSites}" var="siteStatus" itemType="square" >
#{siteStatus.site} #{' '}------------- #{' '}#{siteStatus.status}
</p:dataList>
<!--<p:poll global="false" update="sitesDataList"/>-->
<p:commandButton value="Valider" actionListener="#{generationBean.updateGeneratedSites()}" style=" font: -moz-button; left: 90px; width: 90px;"/>
</h:panelGrid>
</p:panel>
</h:form>
</p:dialog>
我正在使用带有JSF2的primefaces 3.5并且我在glassfish3.0中运行。
欢迎任何建议。