currently dojox/app can't support complex constraint, so separate the class into the templates and the position into the constraint.