- Download the file locally via the SFDC website and uploading back again once changes are done.
Today I explored a really cool thing about force.com IDE. You know we can avoid the above hassle and work directly with static resources just like normal apex classes in Force.com IDE.
Following is the code for that page
On execution this page will display something like this
Now I changed the visualforce code to remove inline css/js references and use these static resources. Here is the sample code that shows this change
Now as before this visualforce page renders the same page. As we haven’t changed anything.
The Change Request
Now lets say there comes a requirement to “Change the heading text color to GREEN”. For this change request one way is to download the static css resource “SampleCSSResource.resource” and upload it back again with changes. This might require a couple of download/upload iterations to get the pixel perfect style, obviously in case of complicated style changes.
Ease Alternate to test and fix
An easy alternate is to work directly on static resources in Force.com Eclipse IDE. I am assuming you have this visualforce project checked out in your Force.com IDE. All you need to do is to goto “Static Resources” under “classes” in Package Explorer.
As we need to update the CSS style, just open the “SampleCSSResource.resource” in default Eclipse editor (double click the SampleCSSResource.resource file in package explorer). You will see the CSS code directly available for editing, as shown below
That's it man you are done, just go ahead and change the styles and do save(CTRL+S). Your static resource will be updated on salesforce servers like normal visualforce pages and apex classes etc.
For example I changed the heading style color to GREEN from RED as shown below. The updated page is also shown next.