2012-08-13 5 views
1

2 버튼에 2 개의 팝업을 생성했습니다. 그리고 물건을 가지고 (AC). 두 팝업에서 나는 삽입 할 필드가 있습니다.팝업 창이로드 될 때 오류 메시지가 표시됩니다.

첫 번째 팝업에는 A.name1, A.name2, A.date, A.Edate, A.Pjt 등이 있고 두 번째 팝업에는 A.Name1, A.name2 필드가 있습니다. A.Name1 및 A.name2는 object의 필수 필드입니다.

제 문제는 첫 번째 팝업에서 값을 삽입하려고 할 때 "값을 입력해야합니다"라는 오류 메시지가 표시되지만 값을 입력해도 마찬가지입니다. 그래서 두 번째 팝업 댓글을 다음 잘 작동하지만 두 번째 팝업 주석 처리되지 않은 경우이 오류 값이 입력 된 이벤트가 throw됩니다. 두 번째 팝업에는 첫 번째 필드와 동일한 두 필드가 다른 필드와 함께 포함됩니다.

누구든지이 오류에 대한 해결책을 찾을 수 있도록 도와 줄 수 있습니다.

<apex:outputPanel id="tstpopup"> 
    <apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopUp}"/> 
     <apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopUp}"> 
     <apex:pageblock > 
      <apex:pageblocksection > 
       <apex:pageblocksectionitem > 
       <apex:outputlabel value="name1: " /> 
       <apex:inputfield id="proj" value="{!AC.name1__c}" /> 
       </apex:pageblocksectionitem> 
       <apex:pageblocksectionitem > 
       <apex:outputlabel value="name2: " /> 
       <apex:inputfield id="role" value="{!AC.name2__c}" /> 
       </apex:pageblocksectionitem> 
       <p/> 
       <apex:commandbutton value="Pencil in a New Project" action="{!save}" /> 
       <apex:commandbutton value="Cancel" action="{!closePopup}" immediate="true" /><br/><br/><br/> 
       </apex:pageblocksection> 
       </apex:pageblock> 
     </apex:outputPanel> 
    </apex:outputPanel> 


<apex:outputPanel id="tstpopup1"> 
    <apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopUp}"/> 
     <apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopUp}"> 
     <apex:pageblock > 
      <apex:pageblocksection > 
       <apex:pageblocksectionitem > 
       <apex:outputlabel value="name1: " /> 
       <apex:inputfield id="proj1" value="{!AC.name1__c}" /> 
       </apex:pageblocksectionitem><p/> 
       <apex:pageblocksectionitem > 
       <apex:outputlabel value="Date: " /> 
       <apex:inputfield id="sd" value="{!AC.Date__c}" /> 
       </apex:pageblocksectionitem> 
       <apex:pageblocksectionitem > 
       <apex:outputlabel value="EDate: " /> 
       <apex:inputfield id="ed" value="{!AC.EDate__c}" /> 
       </apex:pageblocksectionitem> 
       <apex:pageblocksectionitem > 
       <apex:outputlabel value="Proj: " /> 
       <apex:inputfield id="pl" value="{!AC.Pjt__c}" /> 
       </apex:pageblocksectionitem> 
       <apex:pageblocksectionitem > 
       <apex:outputlabel value="Charge: " /> 
       <apex:inputfield id="charge" value="{!AC.Charge__c}" /> 
       </apex:pageblocksectionitem> 
       <apex:pageblocksectionitem > 
       <apex:outputlabel value="Name2: " /> 
       <apex:inputfield id="role1" value="{!AC.name2__c}" /> 
       </apex:pageblocksectionitem> 
       <apex:pageblocksectionitem > 
       <apex:outputlabel value="time: " /> 
       <apex:inputfield id="overtime" value="{!AC.time__c}" /> 
       </apex:pageblocksectionitem>     
       </apex:pageblocksection> 
       <apex:commandbutton value="Assign to a New Project" action="{!assign}" /> 
       <apex:commandbutton value="Cancel" action="{!closePopup}" immediate="true" /><br/><br/><br/> 
       </apex:pageblock> 
     </apex:outputPanel> 
    </apex:outputPanel> 
+0

당신에게 수 ~을 제공하다 두 번째 팝업? – mast0r

답변

0

두 개의 팝업에서 동일한 개체가 있기 때문입니다. 예를 들어 값을 입력하면. 첫 번째 팝업에서 name1_ c - 두 번째 팝업에서 다른 필드 이름 1 _c이 여전히 비어 있습니다.

에이 클래스 :

시도는 개체의 두 개의 다른 인스턴스를 만들려면

public YourObject AC1 { get; set; } 
public YourObject AC2 { get; set; } 

// Constructor 
public YourClassName(){ 
    AC1 = new YourObject(); 
    AC2 = new YourObject(); 
} 

첫 번째 팝업 :

<apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopUp1}"> 
    <apex:pageblock > 
     <apex:pageBlockButtons> 
      <apex:commandbutton value="Assign to a New Project" action="{!assign1}" /> 
      <apex:commandbutton value="Cancel" action="{!closePopup1}" immediate="true" />    
     </apex:pageBlockButtons> 
     <apex:pageblocksection > 
      <apex:pageblocksectionitem > 
       <apex:outputlabel value="name1: " /> 
       <apex:inputfield id="proj1" value="{!AC1.name1__c}" /> 
      </apex:pageblocksectionitem> 
      <apex:pageblocksectionitem > 
       <apex:outputlabel value="Name2: " /> 
       <apex:inputfield id="role1" value="{!AC1.name2__c}" /> 
      </apex:pageblocksectionitem> 
      <!-- other fields from the instance 1 of the object --> 
      .... 
     </apex:pageblocksection> 
    <apex:pageblock > 
<apex:outputPanel> 

두 번째 팝업 :

<apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopUp2}"> 
    <apex:pageblock > 
     <apex:pageBlockButtons> 
      <apex:commandbutton value="Assign to a Another Project" action="{!assign2}" /> 
      <apex:commandbutton value="Cancel" action="{!closePopup2}" immediate="true" />    
     </apex:pageBlockButtons> 
     <apex:pageblocksection > 
      <apex:pageblocksectionitem > 
       <apex:outputlabel value="name1: " /> 
       <apex:inputfield id="proj2" value="{!AC2.name1__c}" /> 
      </apex:pageblocksectionitem> 
      <apex:pageblocksectionitem > 
       <apex:outputlabel value="Name2: " /> 
       <apex:inputfield id="role2" value="{!AC2.name2__c}" /> 
      </apex:pageblocksectionitem> 
      <!-- other fields from the instance 2 of the object --> 
      .... 
     </apex:pageblocksection> 
    <apex:pageblock > 
    <apex:outputPanel> 
관련 문제