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
johncusackjrjohncusackjr 

Page Partial Refresh

Hi,

I have a component and a componentcontroller.

I am calculating a value in controller and using the value in component.

 

Page has a command button:

<apex:commandButton action="{!calculateSelectedIdNamePairs}" onClick="initMe();"
            value="Button" reRender="initDownload" />

 

and a div that contains script

 

<div id="initDownload">
 <script>       
       // some javascript that opens an applet with parameters

       function initMe()

       {

            var popup = window.open("AppletPage?selectedIdNamePairs={!selectedIdNamePairs}", "downloadManager", "width=610,height=410");

       }
 </script>
  </div>

 

But when i inspect the page i saw that, it is trying to open a page "AppletPage?selectedIdNamePairs=" So selectedIdNamePairs is blank. I checked the component controller using System.debugs and it is returning values correctly.

 

I am not sure this code is updating the page partially to use my selectedIdNamePairs value in onClick or onComplete.

 

How can I achieve this?

 

Thanks,

John

Best Answer chosen by Admin (Salesforce Developers) 
Kevin SwiggumKevin Swiggum

instead of <div id="initDownload">, try this

 

<apex:outputPanel id="initDownload">

 

...

 

</apex:outputPanel>

All Answers

Kevin SwiggumKevin Swiggum

instead of <div id="initDownload">, try this

 

<apex:outputPanel id="initDownload">

 

...

 

</apex:outputPanel>

This was selected as the best answer
johncusackjrjohncusackjr

Thanks. That solved the problem ;)