Skip to content

Instantly share code, notes, and snippets.

@markdaugherty
Created April 15, 2012 18:43
Show Gist options
  • Save markdaugherty/2394285 to your computer and use it in GitHub Desktop.
Save markdaugherty/2394285 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Dialog" xtype="dialog">
<items jcr:primaryType="cq:WidgetCollection">
<tabs jcr:primaryType="cq:TabPanel">
<items jcr:primaryType="cq:WidgetCollection">
<first jcr:primaryType="nt:unstructured" title="Form" xtype="panel">
<items jcr:primaryType="cq:WidgetCollection">
<name jcr:primaryType="cq:Widget" fieldLabel="Name" name="./name" xtype="textfield" allowBlank="{Boolean}false"
validator="function(value) {
var dialog = this.findParentByType('dialog');
var url = CQ.HTTP.addParameter(dialog.path + '.validator.json', 'value', value);
var result = CQ.HTTP.eval(url);
return result.valid ? true : 'Form name already exists.';
}" />
</items>
</first>
</items>
</tabs>
</items>
</jcr:root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment