function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DJ Rock your own styleDJ Rock your own style 

Rerender not refreshing from server

Hi,

 

I have an apex pageblock table inside an output panel. This panel has a field called target which has to be updated to true on click of a button in the same panel. Here is the piece of the code.

 

<apex:commandLink action="{!target}"  id="prospectbutton1" status="loadingstatus" rerender="StrategicTargetingBlock">

 

Here is the field inside the same output panel(ie: strategictargetingblock)

 

<apex:outputField id="T" value="{!e.c.T__c}"/>

 

This field is not being updated on click of the commandlink. But when i refresh the entire page by f5, the update is reflected. Seems like the value is refreshed only on client UI but not from the server.

Please help out.

 

Thanks and regards,

Dave.

Alok_NagarroAlok_Nagarro

Hi DJ,

 

Can you post your "target" method of controller..?

DJ Rock your own styleDJ Rock your own style

Hi Alok,

 

Here is the target method:

 

 public void target()  {
      
        theId = ApexPages.currentPage().getParameters().get('pid');
        List<target__c> prospectlist =[select id, Target_Owner__c, Target__c, Target_end_date__c, Target_date__c,Prospected__c FROM Target__c where Target__c = :theId and Target_Owner__c = :userinfo.getuserid() and recordtypeid = :prospectrecord.id and Target_end_date__c = null Limit 1];
        if(prospectlist.size()>0) {
            prospectlist[0].Target_end_date__c = date.today();
            update prospectlist[0];
            Target__c target= new Target__c(
               Target_Date__c = date.today(),
               Target__c = theId,
               Target_Owner__c = userinfo.getuserid(),
               recordtypeid = targetrecord.id
            );
             
                insert target;
            }
           
        }
        else {
            Target__c target= new Target__c(
               Target_Date__c = date.today(),
               Target__c = theId,
               Target_Owner__c = userinfo.getuserid(),
               recordtypeid = targetrecord.id
            );
             
                insert target;
        }

}

 

Target is a child object to contact.

Whenever we click the target button, a record in target object is created with record type as Target.

 

The field T__c is in contact. Whenever a target record is created for the contact, this field is set to true.This is the field change which is not reflecting dynamically in the visualforce.

 

Thanks,

 

Dave.

JitendraJitendra

Hi,

 

Which browser you are using?

 

If it is not IE9, then please use Google chrome and open javascript dubug panel using shortcut Ctrl+Shft+J, and after that click on Commandlink. Is there any error log shown ? 

 

In case you are using Firefix, then use Firebug tool.

DJ Rock your own styleDJ Rock your own style

Hi Jitendra,

 

Thanks for ur comments. I ve tried using the error console of firefox and it doesnt show anything.

 

Regards,

Dave

vriavmvriavm

Hi,

 

            Try using actionregion. I think that should take care of this.

 

Thanks & Regards,

Vivek V.