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
rklaassenrklaassen 

A4J not defined

Hi,

 

I'm trying to create dependent picklists using custom settings in Visual Force and facing a problem. When I change the master picklist I'm getting the error: A4J not defined. I think that's a really strange message, because that's a library salesforce automatically adds when necessary.

Anyone faced this problem before of any ideas how to solve this?

The page doesn't post anything to the server, because it can't find the A4J library/object...

 

A piece of my code:

 

<apex:pageBlockSectionItem >
	<apex:outputLabel value="{!$ObjectType.Task.fields.FR_Type2__c.label}" for="FR_Type2__c" />
	<apex:selectList value="{!task.FR_Type2__c}" id="FR_Type2__c" size="1">
		<apex:selectOptions value="{!FR_Type2_Options}" />
		<apex:actionSupport event="onchange" action="{!refresh}" rerender="thePageBlock" status="status_FR_Aim2" />
	</apex:selectList>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem />
<apex:pageBlockSectionItem >
	<apex:outputLabel value="{!$ObjectType.Task.fields.FR_Aim2__c.label}" />
	<apex:outputPanel >
		<apex:actionStatus id="status_FR_Aim2">
			<apex:facet name="start">
				<apex:image url="{!$Resource.FR_Loader}" />
			</apex:facet>
			<apex:facet name="stop">
				<apex:selectList value="{!task.FR_Aim2__c}" required="true" size="1">
					<apex:selectOptions value="{!FR_Aim2_Options}" />
				</apex:selectList>
			</apex:facet>
		</apex:actionStatus>
	</apex:outputPanel>
</apex:pageBlockSectionItem>

 

 

stephanstephan

Have you tried using Firebug to possibly diagnose this further? You may want to make sure that the scripts under /faces/a4j are being loaded correctly.

rklaassenrklaassen

Yes, I tried some debugging. The problem is exactly what you say: the script files aren't loaded.

I resolved it nasty by just adding these rules after the apex:page tag:

<script src="/faces/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.AjaxScript" type="text/javascript"></script>
<script src="/faces/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.PrototypeScript" type="text/javascript"></script>
<script src="/faces/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/data-table.js" type="text/javascript"></script>

 

Not the way I want it, but with these files included it works...

stephanstephan

Do you have any idea why they aren't loading? What's being returned in the request? Is it possible they're getting blocked by the browser somehow? By the network?

 

Note that we're actually going to updating some of the JS libraries in question for the Winter release, so hard coding includes like this isn't a good long term solution. I'd suggestion trying to diagnose this further an/or opening a case with support.

 

...stephan