You need to sign in to do that
Don't have an account?
action Attribute on <apex: page> tag
I am doing simple test on action with in the <apex: page>
I have a word file uploaded under the Static Resource named customerhelp
<apex:page action="{!URLFOR($Resource.customerhelp)}">
<p>
Hello world!
</p>
<apex:form >
<apex:commandButton title="Sample Button" value="Sample Button"/>
</apex:form>
</apex:page>
1. When I load this page a popop window is displayed to dowonload/open the file within the Static Resource.
2. After that action is done by clicking OK/Cancel page remains blank.
If I try to do refresh/backward it just repeats the steps 1 & 2 . Not only it doesn't show the sample button and the 'Hello world' text, but also does not allow to navigate to the other pages...
How can I download/open or Cancel at first (only one time ) and then see the rest of the content on the page?
Thanks in advance.
As documented, the action attribute is meant for redirection (or conditional redirection) on load of the page.
You should just use javascript to open a pop up with your page. Put it in between <script> tags right at the top of the page and it will run when the page is loaded.
ThomasTT
https://www.consilat.com/blogs-why-not-to-use-action-attribute-in-vf-tag/