How to use the "Radio" button on a document properties page worldwide

I want to use the radio buttons on the document properties page. To add a check box, I used the code below.

<control template="/org/alfresco/components/form/controls/checkbox.ftl"> 

In the above case, checkbox.ftl is provided by alfresco. But there is no RadioButton.ftl.

So how can I use the switch on the property page?

If someone has achieved this, then please help me.

Thanks in advance.

+6
source share
1 answer

You can develop your own controls based on the Alfresco format control documentation. On this page you will be provided with additional information about the manual.

Finally, I suggest you take inspiration from the original checkbox.ftl to make your own:

 <#assign isTrue=false> <#if field.value??> <#if field.value?is_boolean> <#assign isTrue=field.value> <#elseif field.value?is_string && field.value == "true"> <#assign isTrue=true> </#if> </#if> <div class="form-field"> <#if form.mode == "view"> <div class="viewmode-field"> <span class="viewmode-label">${field.label?html}:</span> <span class="viewmode-value"><#if isTrue>${msg("form.control.checkbox.yes")}<#else>${msg("form.control.checkbox.no")}</#if></span> </div> <#else> <input id="${fieldHtmlId}" type="hidden" name="${field.name}" value="<#if isTrue>true<#else>false</#if>" /> <input class="formsCheckBox" id="${fieldHtmlId}-entry" type="checkbox" tabindex="0" name="-" <#if field.description??>title="${field.description}"</#if> <#if isTrue> value="true" checked="checked"</#if> <#if field.disabled && !(field.control.params.forceEditable?? && field.control.params.forceEditable == "true")>disabled="true"</#if> <#if field.control.params.styleClass??>class="${field.control.params.styleClass}"</#if> <#if field.control.params.style??>style="${field.control.params.style}"</#if> onchange='javascript:YAHOO.util.Dom.get("${fieldHtmlId}").value=YAHOO.util.Dom.get("${fieldHtmlId}-entry").checked;' /> <label for="${fieldHtmlId}-entry" class="checkbox">${field.label?html}</label> <@formLib.renderFieldHelp field=field /> </#if> </div> 
+5
source

All Articles