You need to sign in to do that
Don't have an account?
Not able to make Static Resources work
I'm having some issues trying to get Static Resources to work.
I am trying to work with extjs. I have uploaded a zip file (extsfdc.zip) to static resources and named the static resource extsfdc. Cache control is set to public.
Here is the code I am using:
VF PAGE CODE:
<apex:page standardController="account"> <apex:form id="theForm"> <apex:pageBlock title="New Account" mode="edit"> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> </apex:pageBlockButtons> <apex:pageBlockSection columns="1"> <apex:inputField value="{!account.name}"/> <apex:pageBlockSectionItem > <apex:outputLabel value="Number of Employees"> <apex:outputPanel > <c:inputSlider></c:inputSlider> </apex:outputPanel> </apex:outputLabel> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
COMPONENT CODE:
<apex:component > <apex:attribute name="min" type="integer" description="Minimum Value"/> <apex:attribute name="max" type="integer" description="Maximum Value"/> <apex:attribute name="value" type="string" description="The value attribute"/> <apex:stylesheet value="{!URLFOR($Resource.extsfdc, 'resources/css/xtheme-gray.css')}"/> <apex:stylesheet value="{!URLFOR($Resource.extsfdc, 'resources/css/ext-all.css')}"/> <apex:includescript value="{!URLFOR($Resource.extsfdc, 'adapter/ext/extbase.js')}"/> <apex:includescript value="{!URLFOR($Resource.extsfdc, 'ext-all.js')}"/> <div id="basic-slider"></div> <apex:inputText value="{!value}" id="noe"/> <script> Ext.onReady(function(){ var slider = new Ext.Slider({ renderTo: 'basic-slider', width: 214, minValue: {!min}, maxValue: {!max} }); slider.on('change', function(slider,value){ document.getElementByID('{!$Component.noe}').value = value;}); }); </script> </apex:component>
Both compile without errors and the page renders but the slider does not display.
Any help would be appreciated.
Thanks!
found it - typo....
/adapter/ext/extbase.js should have been
/adapter/ext/ext-base.js
All Answers
This thread might be helpful. Use your browser to examine the generated URL, and to discover whether the script is indeed loaded. If you get the URL wrong, the compiler doesn't tell you.
Also, Firefox and Firebug should be your friend. You can inspect the DOM and js variables, trace and execute arbitrary js, and more.
found it - typo....
/adapter/ext/extbase.js should have been
/adapter/ext/ext-base.js
HI:
I am trying to use ExtJS for the first time. I tried to test this example. For some reason, the component does not show up, it appears as a text box.
I uploaded the ext.zip file as "ext"
The static Resoruce references are:
<apex:stylesheet value="{$Resource.ext}/resources/css/ext-all.css"/>
<apex:includescript value="{!$Resource.ext}/adapter/ext/ext-base.js"/>
<apex:includescript value="{!$Resource.ext}/ext-all.js"/>
Appreciate any comments .