• frenerve
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies

Hi All,

 

I need to display an custom validation error message for an 'inputText' field.

For Example:

Here, I need to display an error message if the inputText for 'Name' is null or empty.

 

<div style="position:absolute; top: 145px; left: 30px;" class="cnt_popup">
Name: 
</div>
<div style="position:absolute; top: 140px; left: 105px; height:20px; width:200px;" >
     <apex:inputText id="name" value="{!Name}" styleClass="textarea" required="true">                                    
     </apex:inputText>  
</div>

 Please let me know if you have any idea about how to display an custom validation error message.

 

Hi,

 

I am calling a method from my controller every 5 seconds.

But I want to dynamically change the interval by adding a custom setting and calling the custom setting in apex class and

referring that in the interval attribute of actionpoller.

 

But when I tried that, the method is not getting called every 5 seconds. It is taking the default interval as 60 seconds.

 

I also tried by creating an Integer variable in the controller and called that in the interval attribute of actionpoller.

 

Following is my code which I am trying:

public class exampleCon {
    Integer count = 0;
     Integer interval=5;                   
    public PageReference incrementCounter() {
        count++;
        return null;
    }
    public Integer getinterval(){
        return interval;
    }                 
    public Integer getCount() {
        return count;
    }
}

 

<apex:page controller="exampleCon">
    <apex:form >
        <apex:outputText value="Watch this counter: {!count}" id="counter"/>
        <apex:actionPoller action="{!incrementCounter}" rerender="counter" interval="{!interval}"/>
    </apex:form>
</apex:page>

 

 

Please let me know any suggestions.

 

Thanks

Arvind

 

I have a custom formula field (shipping_total__c) that is the sum of two other fields (shipping1__c, shipping2__c), and I have created a visualforce page that displays the latter two fields in <apex:inputfield> tags, and the formula field in an <apex:outputfield> tag. I am trying to get the formula field to rerender with the correct amount any time the first two are modified, but the value does not change.

I suspect that the field formula is not re-calculating after it is originally retrieved from the opportunity object via SOQL on initial page display.

If I try to modify those fields,

Code:
this.opportunity.shipping_total__c = this.opportunity.shipping1__c + this.opportunity.shipping2__c;

... I get an Apex error that this field is read-only.

I *could* create a temp decimal variable and display that instead, and then update it onchange of the first two shipping values, but that seems like more work than should be necessary.


How can I force a formula field to re-render without actually committing/updating the data back to the DB first?


  • November 20, 2008
  • Like
  • 0