You are currently browsing the monthly archive for December 2011.

Every once and awhile I try to go through my records and see what sort of assets I have out there floating around on the web. I’ll put this in the form of a list and then put a few lessons learned.

Blogs: WordPress.com (1 owner, 2 contributor), WordPress.org (2 owner), Tumblr (1), Posterous (1), Blogger (3, all defunct). Also had several Ruby-powered blogs all gone.
Social Media: Twitter (1 business, 1 personal, 1 product, contribute to 2 others), Facebook (1 + 1 page), Google+ (1 + 1 page)
Hosts: Dreamhost (1), Yahoo (1), Linode VPS (1)
CMS: WordPress (2), Refinery CMS (1), Hardcoded HTML (1)
Discussion Boards: PhPBB (1), Invasion Power (1). Contribute to a few others.
Domains: Yahoo (9), Network Solutions (1), Dreamhost (1), Godaddy (1).

News Aggregators: Hacker News (2)

From top to bottom:

Blogs: No clear lesson from the blog world, only that at the moment it makes sense to have multiple blogs divided by topic. I have a company blog, a developer blog (this one), a “work” essay blog, a personal essay blog, and an art/inspiration-of-the-moment tumblog. Over time moved to feature-rich easily-maintainable hosted options from more custom options, don’t plan to go back. That said, I miss the nice syntax highlighting available not on WordPress.com, which is probably the major reason why I am planning to move this blog over to wordpress.org in the near future.

Social Media: Twitter, and particularly my “work” twitter account gets the most attention (I put it in quotes because my I don’t believe that work should ever be work, but rather fun and I try to keep things that way). My personal twitter gets barely any love. Facebook for me is now 60% liking things from the “work” world and 40% personal updates, which seems a bit odd. Google+ is an outlet for nerdy things that I don’t think will be appreciable to a more general audience.

Hosts: I’m a legacy customer of Yahoo from when they were great. I am very happy with Dreamhost but it is too much hassle to move all of my websites over there.

CMS: I’ve run virtually every CMS known to man at some point and at this point I actually don’t see any need for most sites for anything more complicated than WordPress. I just spent some time with two Ruby CMSes (Locomotive and Refinery) but would never recommend them to anyone who doesn’t want to spend a rather substantial amount of time tinkering in order to get it up and running for what is, in general, a less capable system (that said, you can extend it yourself, which is cool).

Discussion Boards: Was happy with PhpBB for a long time but at some point lost the time/interest to make all the modifications to optimize it. Been experimenting with other options (vBulletin/IPB) but haven’t had the time to pick one. Paying for IPB but not using it.

Domains: I’ve greatly reduced my number of parked domains, largely because I was all on Yahoo and they more than tripled their prices. Not too sure that this was the right decision, but absolutely hated Godaddy and it was too much of a pain to transfer domains. Still looking for a good, cheap host to park domains for future ideas if anyone has a suggestion. I like Network Solutions okay but they just spammed me with “.XXX” domain advertisements which I didn’t appreciate.


News Aggregator: 2011 was the year when I basically stopped reading all news not immediately relevant to what I was doing, perhaps because I find it a generally depressing waste of time (I used to read the Economist cover to cover and follow a bunch of other publications). The major winner here is Hacker News. I use two accounts, one for general posting and one for commenting on things which I expect will be controversial (Hacker News has a bunch of “karma police” that, in what I believe to be a generally laudable attempt to maintain high comment quality, frequently go overboard in downmodding non-mainstream viewpoints).

jQuery UI for Salesforce provides a complete set of jQuery powered elements that can be used instead of the standard elements. This includes automatic client-side validation.

A page showing the jQuery elements compared with standard elements can be found here.

Usage

Complete specifications follow for each enhanced component:

Text:

<c:enhancedText pageController="{!this}" fieldName="Text__c"   />

You can also force there to be both a uppercase and lowercase letters by telling to to validate as a name:

<c:enhancedText pageController="{!this}" fieldName="Text__c"  validateAs="name" />

Email:

<c:enhancedText pageController="{!this}" fieldName="Email__c"  validateAs="email" />

Number (Double):

 <c:enhancedText pageController="{!this}" fieldName="Number__c" validateAs="number" />

Percent:

<c:enhancedText pageController="{!this}" fieldName="Percent__c" validateAs="percent" />

Checkbox (Boolean):

<c:enhancedCheckbox pageController="{!this}" fieldName="Checkbox__c"   />

Phone:

<c:enhancedText pageController="{!this}" fieldName="Phone__c"  validateAs="phone" />

Defaults to international phone, for US domestic phone use:

<c:enhancedText pageController="{!this}" fieldName="Phone__c"  validateAs="phoneus" />

Picklist:

<c:enhancedSelect fieldName="Picklist__c" pageController="{!this}" object="{!TestObject__c}" /

Multi-Picklist (Multiselect)

<c:enhancedMultiselect pageController="{!this}" fieldName="Picklist_Multi_Select__c" object="{!TestObject__c}"  /

Lookup (Reference) :

<c:enhancedLookup pageController="{!this}" fieldName="Test_Lookup_Object__c" objectToLookup="TestLookupObject__c" />

Lookup (Reference) :

<c:enhancedLookup pageController="{!this}" fieldName="Test_Lookup_Object__c" objectToLookup="TestLookupObject__c" />

Textarea :

<c:enhancedTextarea pageController="{!this}" fieldName="Text_Area__c" expandable="true" width="145" height="50" />

Controller:

(1) Install enhanced components via unmanaged package install link.

(2) Have your main controller (which can be a standard controller) extend PageControllerBase:

public with sharing class DemoPageController extends PageControllerBase

If you want to use a standard controller include this:

	  public DemoPageController(ApexPages.StandardController controller) {
	    	standardCon = controller;
	        this.myObject = controller.getRecord();
	  }

Then include this function:

	  // First we save the values from the Enhanced Component controllers, then whatever standard fields there are.
	  // If you are using standard fields in addition to enhanced components, whichever method is utilizing fields required by the API should always be in the first position

	 public PageReference save()
	 {
	  	ecSave();
	  	standardCon.save();

	  	return null;
	 }

Page:

Include your favorite jQuery UI theme easily:

    <apex:stylesheet value="{!URLFOR($Resource.JQueryUICup,'development-bundle/themes/cupertino/jquery.ui.all.css')}"/>

See how standard themes will look by choosing the switch theme option on this page. You can also easily create your own theme with Themeroller.

On your page you will also need to enable validation.

The easiest way is to assign a form styleClass element to your form declaration:

<apex:form styleClass="form" >

Then just before you close your form tag add an action function:

       <apex:actionFunction action="{!pageController.save}" name="saveMe"></apex:actionFunction>
  </apex:form>

Then add the automatically generated javascript:

    <apex:outputText escape="false" value="{!pageController.completeJavascript}"/>

This line will not only add hotlinks to the Google and Microsoft CDNs (for JQuery, JQueryUI and JQuery validation plugin), it will enable validation any form with a form class and add all of the necessary methods for validation.

If you don’t want to use the automagic client-side validation, hotlink the necessary CDNs manually:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"/>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"/>

Here is a list of all of the Plugins currently included:

JQuery UI 1.8
JQuery Validation (Joern Zaefferer)
Autocomplete 1.1.1 (Joern Zaefferer)
Expandable 1.0 (Brandon Aaron)
Select Menu (Filament Group)
Multiselect 0.6 (Eric Hynds)

Github repo here.

@fractastical updates

 

December 2011
M T W T F S S
« Nov   Mar »
 1234
567891011
12131415161718
19202122232425
262728293031  
Follow

Get every new post delivered to your Inbox.

Join 1,312 other followers