I don't want there to be any conditions (like onchange or onclick), and I only need it to rerender once, which is why I've tried using the timeout attribute.
<apex:page standardController="Account">
<apex:pageMessages />
<apex:messages />
<apex:sectionHeader title="Account Edit" subtitle="{!Account.name}"></apex:sectionHeader>
<apex:form id="theform">
<script>
onload();
</script>
<apex:pageBlock mode="edit" id="thepageblock" title="Account Edit">
<apex:actionFunction name="onload" rerender="thepageblock" timeout="600"/>
It does work sometimes, but more often than not, it doesn't. I need the page to always rerender so that a new Account Type can always be chosen depending on the new Record Type selected.
I've tried rerendering the page, the form, the page block, an outputpanel around the Type field, changing the timeout attribute, etc.
<apex:pageBlockSection rendered="{!IF(Account.RecordType.Name='Client',true,false)}">
<apex:inputfield value="{!Account.RecordTypeid}" id="RType">
</apex:inputField>
<script>
if ("{!$CurrentPage.parameters.RecordType}" !== "") {
document.getElementById('{!$Component.RType}').value = "{!$CurrentPage.parameters.RecordType}";
}
</script>
<apex:inputField value="{! Account.Type }">
action
attribute of theapex:page
tag. I wonder what problem you're solving, though; there's probably an easier way to do whatever it is you're trying to do.