0
喜逢身体,我有我使用一个selctOneMenu的问题后,我选择alternativs在服务器端的其他方法从未trigered之一,我ca't弄清楚为什么Primefaces selectOneMenu用于阻止其他方法
这里是我的JSF代码片段
....
...
<p:panel style="height:85px;">
<h:outputLabel
style="font: italic;font-family:serif;font-weight: lighter;font-size: x-large;">
Mode de Payement:
</h:outputLabel>
<p:selectOneMenu value="#{commandeActBeanc.modePayement}">
<f:selectItem itemLabel="--" itemValue="" />
<f:selectItems value="#{modePayementArtBean.modesPayementLista}"
var="mode" itemLabel="#{mode.intitule}" itemValue="#{mode}" />
</p:selectOneMenu>
</p:panel>
</h:panelGrid>
<br />
<p:contextMenu for="articles" widgetVar="cMenu">
<p:menuitem value="Edit Cell" icon="ui-icon-search"
onclick="PF('BCTable').showCellEditor();return false;" />
<p:menuitem value="Hide Menu" icon="ui-icon-close"
onclick="PF('cMenu').hide()" />
</p:contextMenu>
<p:dataTable id="articles" var="art" rendered="true"
paginator="true" rows="10" style="width:99%;padding-left:8px;"
value="#{commandeActBeanc.mediumArticleSuppModel}" editable="true"
editMode="cell" widgetVar="BCTable"
rowKey="#{art.idArtileBoncommande}"
selection="#{commandeActBeanc.selectedArticlesSupp}">
<f:facet name="header">
Commande n° #{commandeActBeanc.cmd.idBoncommande}
</f:facet>
<p:ajax event="cellEdit" listener="#{commandeActBeanc.onCellEdit}"
update=":form:messages,:@this,:form:totaleTtc,:form:totaleHt,:form:totaleTva" />
<p:column selectionMode="multiple" style="width:2%" />
<p:column headerText="code.Art" style="width:15%">
#{art.codeArticle}
</p:column>
<p:column headerText="Libelle.Art" style="width:15%">
#{art.referenceArticle}
</p:column>
<p:column headerText="P.U en TTC" style="width:15%">
#{art.prixUnitTtc}
</p:column>
<p:column headerText="Quantité" style="width:15%">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{art.quantite}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{art.quantite}" style="width:96%"
label="Quantite" />
</f:facet>
</p:cellEditor>
</p:column>
,这里是我的豆:
@Component("commandeActBeanc")
@SessionScoped
public class CommandeActionBean {
@Autowired
private transient ICommandeDao commandeDAO;
@Autowired
private transient IPcArticleBoncommandeDao articleCommandeDAO;
@Autowired
private transient IProduitDao articleDAO;
private Integer idBoncommande;
private Agent agent;
private ModePayement modePayement;
private String numero;
private Boolean isValide;
private Boolean isSolde;
private Boolean isImprime;
private Boolean isSaved;
private Date dte;
这是我ModPayemenActionBean
@Component("modePayementArtBean")
@SessionScoped
public class ModePayementActionBean {
@Autowired
IModePayementDao modePayementDao;
private String intitule;
private List<ModePayement> modesPayementLista= new ArrayList<ModePayement>();
/*-----------------------------------Setters et Getters--------------------------------*/
public IModePayementDao getModePayementDao() {
return modePayementDao;
}
public ModePayementActionBean() {
}
public List<ModePayement> getModesPayementLista() {
modesPayementLista= new ArrayList<ModePayement>();
modesPayementLista.addAll(getModePayementDao().findAll());
for (int i=0;i<modesPayementLista.size();i++){
System.out.println(modesPayementLista.get(i));
}
return modesPayementLista;
}
public void setModesPayementLista(List<ModePayement> modesPayementLista) {
this.modesPayementLista = modesPayementLista;
}
public void setModePayementDao(IModePayementDao modePayementDao) {
this.modePayementDao = modePayementDao;
}
public String getIntitule() {
return intitule;
}
public void setIntitule(String intitule) {
this.intitule = intitule;
}
}