You need to sign in to do that
Don't have an account?
Anuja Joshi 16
On click OK button from popup window how to refresh the pageblock table in parent table and close popup window
Hello
On click command button on parent window new popup window is opened.from popup window access csv file.when click on OK button from popup window i want to refresh pageblock table in parent table.please tell how to do it.your help is most appreciated.Thanks in advance.
code for popup window is given below:
<apex:page sidebar="false" showHeader="false" StandardController="Account" extensions="UploadCSVFileController">
<apex:sectionHeader title="-{!Account.name}" subtitle="{!cp.Month_Year__c}"/>
<apex:form >
<script>
function closeuploadpage()
{
window.close();
}
</script>
function closeandrefresh()
{
window.opener.location.href='/apex/monthlydeductionspage?id={!account.id}';
window.close();
}
<apex:pageBlock >
<apex:pageBlocksection >
<apex:pageBlockSectionItem >
<apex:inputFile value="{!CsvFileBody}" fileName="{!csvfile}"/>
</apex:pageBlockSectionItem>
</apex:pageBlocksection>
<apex:actionRegion>
<apex:commandButton action="{!importcsvfile}" value="OK" oncomplete="closeandrefresh();"/>
</apex:actionRegion>
<apex:commandButton value="Cancel" onclick="closeuploadpage();"/>
</apex:pageBlock>
</apex:form>
</apex:page>
On click command button on parent window new popup window is opened.from popup window access csv file.when click on OK button from popup window i want to refresh pageblock table in parent table.please tell how to do it.your help is most appreciated.Thanks in advance.
code for popup window is given below:
<apex:page sidebar="false" showHeader="false" StandardController="Account" extensions="UploadCSVFileController">
<apex:sectionHeader title="-{!Account.name}" subtitle="{!cp.Month_Year__c}"/>
<apex:form >
<script>
function closeuploadpage()
{
window.close();
}
</script>
function closeandrefresh()
{
window.opener.location.href='/apex/monthlydeductionspage?id={!account.id}';
window.close();
}
<apex:pageBlock >
<apex:pageBlocksection >
<apex:pageBlockSectionItem >
<apex:inputFile value="{!CsvFileBody}" fileName="{!csvfile}"/>
</apex:pageBlockSectionItem>
</apex:pageBlocksection>
<apex:actionRegion>
<apex:commandButton action="{!importcsvfile}" value="OK" oncomplete="closeandrefresh();"/>
</apex:actionRegion>
<apex:commandButton value="Cancel" onclick="closeuploadpage();"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Here is the sample code for it: and here is the java script function
Note : I would suggest to check this setting Setup-> Personal Setup -> My Personal Information -> Personal Information
Here check for "Development Mode". I have seen at various places and at community as well that if this check box is checked then popup would not close. Here, I would suggest to turn this checkbox off while you are testing this.