在jsf

时间:2016-09-20 19:55:16

标签: jquery javabeans jsf-2.2

我在这种形式的jsf中有一个表单我有几个按钮。当我单击该按钮时,会出现一个jquery对话框。问题是我在这个对话框中有另一个表单,其中包含要通过命令按钮提交到数据库的输入文本,我不知道如何执行此操作。这是代码:



//her is the code of jquery to open a dialog:


$("#AVG").click(function () {
	    $("#dialog1").dialog(
	    {
	        title: "AVG",
	        autoOpen: false,
		    show:"explode",
		    hide:"explode",
	        position :{  my: "right bottom", at: "left top",of: "#AVG"}	        
	     });
	    
	    $("#dialog1").dialog("open").show();
	    return false;
});

<h:form id="myform" prependId="false">
<button id="AVG" type="button">Montage_AVG</button>						
<div  id="dialog1" title="AVG">
<h:form id="myform1">
<h:panelGrid columns="2" >
 <h:outputLabel value="matricule :"/>
<h:inputText  value="#{pneuBean.matricule}" style="width:90px;"/>
<h:outputLabel value="position :"/>
<h:inputText  value="#{pneuBean.position}"style="width:90px;"/>
<h:outputLabel value="n_serie :"/>
<h:inputText  value="#{pneuBean.n_serie}" style="width:90px;"/>
<h:outputLabel value="marque :"/>
<h:inputText  value="#{pneuBean.marque}" style="width:90px;"/>
<h:outputLabel value="profil :"/>
<h:inputText  value="#{pneuBean.profil}" style="width:90px;"/>
<h:outputLabel value="dimention :"/>
<h:inputText  value="#{pneuBean.dimention}" style="width:90px;"/>
<h:outputLabel value="kilometrage :"/>
<h:inputText  value="#{pneuBean.kilometrage_au_montage}" style="width:90px;"/>
<h:outputLabel value="DateMontage :"/>
<h:inputText  value="#{pneuBean.date_montage}" style="width:90px;"/>
<h:commandButton   value="Sauvegarder" action="#{pneuBean.addPneu()}">					     </h:commandButton>							
</h:panelGrid>
</h:form>						
</div>
<h:commandButton value="Sauvegarder" actionListener="#{vehiculeBean.addVehicule}"/>				 			
	</h:form>
&#13;
&#13;
&#13;

这是在jquery对话框中点击提交按钮时调用的函数:

public void addPneu(){

    // Service.add( v );
    Pneu p = new Pneu();
    p.setMatricule( matricule );
    p.setPosition( position );
    p.setN_serie( n_serie );
    p.setDate_montage( date_montage );
    p.setMarque( marque );
    p.setProfil( profil );
    p.setDimention( dimention );
    p.setKilometrage_au_montage( kilometrage_au_montage );

    Servicep.add( p );
    // p.setMatricule( matricule );
    // ajout de 4 pneu qui font reference au vehicule v
    // Servicep.add( p );
    // message = "Mr " + nom_propriètaire + " a été ajouter avec succes";
    // System.out.println( matricule + "" + nom_propriètaire + " " +
    // tel_proprètaire );

    matricule = "";
    position = "";
    n_serie = "";
    marque = "";
    profil = "";
    dimention = "";
    kilometrage_au_montage = 0L;

}   

任何帮助将不胜感激

0 个答案:

没有答案