• dat le duc
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
Hi,
I have 2 input fields. Once both the values are entered, I need to show its sum on the screen.  I tried but it doesn't work . Please help
My code like this:
</table>  
	<tr>                        
		<td>
		   <apex:inputField value="{eval__c.A}"  />  
		   <apex:actionSupport event="onchange" rerender="sumwrapper"></apex:actionSupport>                             
		</td>
		<td>
		   <apex:inputField value="{eval__c.B}" />  
		   <apex:actionSupport event="onchange" rerender="sumwrapper"></apex:actionSupport>                           
		</td>
	</tr>   

	<tr>
		<td>Total</td>
		<td>
			<apex:outputPanel id="sumwrapper">
				<apex:outputText value="{!SumOfAB}"/> 
			</apex:outputPanel>
		</td>                        
	</tr>      
</table>
 
public Double getSumOfAB(){
if( (eval__c.A!= null)&&(eval__c.B!= null) ) {
	return  = Double.valueOf(!Eval__c.A) + Double.valueOf(!Eval__c.B) ;
}
  return null;
}

 
Line break when I add required="true" to inputField. I tried some methods but it doesn't work.
Pls help, Thanks
<apex:pageBlockSection>     
 <apex:pageBlockSectionItem >
	<apex:outputpanel >
		<apex:outputLabel value="Name:" for="FA"/>
		<apex:inputField id="FA" value="{!Account.Name}" required="true"/>  
	</apex:outputpanel>
 </apex:pageBlockSectionItem> 
</apex:pageBlockSection>
Hi ,
I have three fields in my VF page and user has to choose value from two of them manually.
Once both the values are choosed,  its SUM will be showed dynamically on the screen, it's ok . 
The problem is the sum result is a String that i don't want.
Selected values : 1 and 2  ー> result : 12
Expected result : 3

How to convert selected values to number type before sum total?
Please Help.

Thanks!!       
<apex:page standardController="EvaluationInformation__c" extensions="EISControllerV">
.....
<!--Picklist (values : 1,2)-->
<div>
	<apex:inputField id="Emp_1_1" value="{!evaluation.PE1}" styleClass="plStyle"/>
	<apex:actionSupport event="onchange" rerender="sumwrapper"></apex:actionSupport>
</div>   
<div>
	<apex:inputField id="Emp_1_2" value="{!evaluation.PE2}" styleClass="plStyle"/>
	<apex:actionSupport event="onchange" rerender="sumwrapper"></apex:actionSupport>
</div>  

<!-- SUM will be showed here-->
<apex:outputPanel id="sumwrapper">
	<apex:outputText value="{!evaluation.PE1 + evaluation.PE2}" id="dpdresult" />      
</apex:outputPanel>
.....
</apex:page>

 
Hi,
I have 2 input fields. Once both the values are entered, I need to show its sum on the screen.  I tried but it doesn't work . Please help
My code like this:
</table>  
	<tr>                        
		<td>
		   <apex:inputField value="{eval__c.A}"  />  
		   <apex:actionSupport event="onchange" rerender="sumwrapper"></apex:actionSupport>                             
		</td>
		<td>
		   <apex:inputField value="{eval__c.B}" />  
		   <apex:actionSupport event="onchange" rerender="sumwrapper"></apex:actionSupport>                           
		</td>
	</tr>   

	<tr>
		<td>Total</td>
		<td>
			<apex:outputPanel id="sumwrapper">
				<apex:outputText value="{!SumOfAB}"/> 
			</apex:outputPanel>
		</td>                        
	</tr>      
</table>
 
public Double getSumOfAB(){
if( (eval__c.A!= null)&&(eval__c.B!= null) ) {
	return  = Double.valueOf(!Eval__c.A) + Double.valueOf(!Eval__c.B) ;
}
  return null;
}

 
Hi ,
I have three fields in my VF page and user has to choose value from two of them manually.
Once both the values are choosed,  its SUM will be showed dynamically on the screen, it's ok . 
The problem is the sum result is a String that i don't want.
Selected values : 1 and 2  ー> result : 12
Expected result : 3

How to convert selected values to number type before sum total?
Please Help.

Thanks!!       
<apex:page standardController="EvaluationInformation__c" extensions="EISControllerV">
.....
<!--Picklist (values : 1,2)-->
<div>
	<apex:inputField id="Emp_1_1" value="{!evaluation.PE1}" styleClass="plStyle"/>
	<apex:actionSupport event="onchange" rerender="sumwrapper"></apex:actionSupport>
</div>   
<div>
	<apex:inputField id="Emp_1_2" value="{!evaluation.PE2}" styleClass="plStyle"/>
	<apex:actionSupport event="onchange" rerender="sumwrapper"></apex:actionSupport>
</div>  

<!-- SUM will be showed here-->
<apex:outputPanel id="sumwrapper">
	<apex:outputText value="{!evaluation.PE1 + evaluation.PE2}" id="dpdresult" />      
</apex:outputPanel>
.....
</apex:page>

 
Hi,
 
I have  scenario where i want to disable the inputField onload.
 
<apex:inputField id="sdate"   value="{!inputStartDate.Date__c}">

 
The value for input field is date.  Is there a way to do this?
 
Thanx
 
S
  • July 09, 2008
  • Like
  • 0