Skip to main content

I am working on VF Page, where I am inserting record and the moment it inserted it will appear in next pageblock and I used "RefreshPage" command but some how my page block "Details Of Attendees" is not getting refreshed.

Can anyone help me out in this issue if possible. My vf page code is below.

<apex:page Controller="StagingEventInsertAndShowData" lightningStylesheets="true">
<apex:form>
    <apex:pageBlock title="New Staging Event Attendee">
        <apex:pageBlockSection id="reRenderId">
            <apex:inputText label="Barcode" value="{!Barcode}"/>
            <apex:commandButton value="Insert" action="{!save}" reRender="reRenderId" oncomplete="refreshPage();"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
    <apex:pageBlock title="Details of Attendees">
        <apex:pageBlockTable value="{!accList}" var="a">
            <apex:column headerValue="Barcode" value="{!a.Barcode__c}"/>
            <apex:column headerValue="Attendant" value="{!a.Attendant__c}"/>
            <apex:column headerValue="Campaign" value="{!a.Campaign_ID__c}"/>
            <apex:column headerValue="Email" value="{!a.Email__c}"/>
            <apex:column headerValue="Date Attended" value="{!a.Date_Attended__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:form>

</apex:page>

Controller:

public class StagingEventInsertAndShowData {
    public String Barcode{get;set;}
    public List<Staging_Event_Attendee__c> accList {get;set;}
    
    public StagingEventInsertAndShowData(){
        accList=[SELECT Name,Barcode__c,Attendant__c,Campaign_ID__c,Email__c,Date_Attended__c FROM Staging_Event_Attendee__c Barcode__c ORDER BY Barcode__c ASC LIMIT 100];
    }
    
    public PageReference save() {
        Staging_Event_Attendee__c ac = new Staging_Event_Attendee__c();
        ac.Barcode__c = Barcode;
        insert ac;
        this.Barcode = null;
        return null;
    }
}

I am working on VF Page, where I am inserting record and the moment it inserted it will appear in next pageblock and I used "RefreshPage" command but some how my page block "Details Of Attendees" is not getting refreshed.

Can anyone help me out in this issue if possible. My vf page code is below.

<apex:page Controller="StagingEventInsertAndShowData" lightningStylesheets="true">
<apex:form>
    <apex:pageBlock title="New Staging Event Attendee">
        <apex:pageBlockSection id="reRenderId">
            <apex:inputText label="Barcode" value="{!Barcode}"/>
            <apex:commandButton value="Insert" action="{!save}" reRender="reRenderId" oncomplete="refreshPage();"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
    <apex:pageBlock title="Details of Attendees">
        <apex:pageBlockTable value="{!accList}" var="a">
            <apex:column headerValue="Barcode" value="{!a.Barcode__c}"/>
            <apex:column headerValue="Attendant" value="{!a.Attendant__c}"/>
            <apex:column headerValue="Campaign" value="{!a.Campaign_ID__c}"/>
            <apex:column headerValue="Email" value="{!a.Email__c}"/>
            <apex:column headerValue="Date Attended" value="{!a.Date_Attended__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:form>

</apex:page>

Controller:

public class StagingEventInsertAndShowData {
 public String Barcode{get;set;}
public List<Staging_Event_Attendee__c> accList {get;set;}

public StagingEventInsertAndShowData(){
    accList=[SELECT Name,Barcode__c,Attendant__c,Campaign_ID__c,Email__c,Date_Attended__c FROM Staging_Event_Attendee__c Barcode__c ORDER BY Barcode__c ASC LIMIT 100];
}

public PageReference save() {
    Staging_Event_Attendee__c ac = new Staging_Event_Attendee__c();
    ac.Barcode__c = Barcode;
    insert ac;
    this.Barcode = null;
    return null;
}
}

I am working on VF Page, where I am inserting record and the moment it inserted it will appear in next pageblock and I used "RefreshPage" command but some how my page block "Details Of Attendees" is not getting refreshed.

Can anyone help me out in this issue if possible. My vf page code is below.

<apex:page Controller="StagingEventInsertAndShowData" lightningStylesheets="true">
<apex:form>
    <apex:pageBlock title="New Staging Event Attendee">
        <apex:pageBlockSection id="reRenderId">
            <apex:inputText label="Barcode" value="{!Barcode}"/>
            <apex:commandButton value="Insert" action="{!save}" reRender="reRenderId" oncomplete="refreshPage();"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
    <apex:pageBlock title="Details of Attendees">
        <apex:pageBlockTable value="{!accList}" var="a">
            <apex:column headerValue="Barcode" value="{!a.Barcode__c}"/>
            <apex:column headerValue="Attendant" value="{!a.Attendant__c}"/>
            <apex:column headerValue="Campaign" value="{!a.Campaign_ID__c}"/>
            <apex:column headerValue="Email" value="{!a.Email__c}"/>
            <apex:column headerValue="Date Attended" value="{!a.Date_Attended__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:form>

</apex:page>

Controller:

public class StagingEventInsertAndShowData {
    public String Barcode{get;set;}
    public List<Staging_Event_Attendee__c> accList {get;set;}
    
    public StagingEventInsertAndShowData(){
        accList=[SELECT Name,Barcode__c,Attendant__c,Campaign_ID__c,Email__c,Date_Attended__c FROM Staging_Event_Attendee__c Barcode__c ORDER BY Barcode__c ASC LIMIT 100];
    }
    
    public PageReference save() {
        Staging_Event_Attendee__c ac = new Staging_Event_Attendee__c();
        ac.Barcode__c = Barcode;
        insert ac;
        this.Barcode = null;
        return null;
    }
}
Source Link
user70770
user70770

Issue with refreshing visualforce page

I am working on VF Page, where I am inserting record and the moment it inserted it will appear in next pageblock and I used "RefreshPage" command but some how my page block "Details Of Attendees" is not getting refreshed.

Can anyone help me out in this issue if possible. My vf page code is below.

<apex:page Controller="StagingEventInsertAndShowData" lightningStylesheets="true">
<apex:form>
    <apex:pageBlock title="New Staging Event Attendee">
        <apex:pageBlockSection id="reRenderId">
            <apex:inputText label="Barcode" value="{!Barcode}"/>
            <apex:commandButton value="Insert" action="{!save}" reRender="reRenderId" oncomplete="refreshPage();"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
    <apex:pageBlock title="Details of Attendees">
        <apex:pageBlockTable value="{!accList}" var="a">
            <apex:column headerValue="Barcode" value="{!a.Barcode__c}"/>
            <apex:column headerValue="Attendant" value="{!a.Attendant__c}"/>
            <apex:column headerValue="Campaign" value="{!a.Campaign_ID__c}"/>
            <apex:column headerValue="Email" value="{!a.Email__c}"/>
            <apex:column headerValue="Date Attended" value="{!a.Date_Attended__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:form>

</apex:page>

Controller:

public class StagingEventInsertAndShowData {
 public String Barcode{get;set;}
public List<Staging_Event_Attendee__c> accList {get;set;}

public StagingEventInsertAndShowData(){
    accList=[SELECT Name,Barcode__c,Attendant__c,Campaign_ID__c,Email__c,Date_Attended__c FROM Staging_Event_Attendee__c Barcode__c ORDER BY Barcode__c ASC LIMIT 100];
}

public PageReference save() {
    Staging_Event_Attendee__c ac = new Staging_Event_Attendee__c();
    ac.Barcode__c = Barcode;
    insert ac;
    this.Barcode = null;
    return null;
}
}