Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Form Questions /

custom form template - action buttons?


Reply


1244 Views

Avatar
paaja

Community Member, 1 Post

1 July 2010 at 2:53am

Hi,

i'm creating CMS module managing some DataObjects using subclass of ComplexTableField. I set custom template file for popup window form like this:

// ...
$table = new ServiceOrdersTableField($this, "ServiceOrders", "ServiceOrder", $section, $tableFields);
$table->setTemplatePopup('ServiceAdmin_popup');

template file ServiceAdmin_popup.ss looks like this:

<form $DetailForm.FormAttributes>

<fieldset>
<div id="FirstName" class="field text">
<label class="left" for="$DetailForm.FormName_Firstname">First name</label>:
$DetailForm.dataFieldByName(Firstname)
</div>

<div id="Email" class="field email">
<label class="left" for="$DetailForm.FormName_Email">Email</label>:
$DetailForm.dataFieldByName(Email)
</div>
$DetailForm.dataFieldByName(SecurityID)
</fieldset>

<% if Actions %>
<div class="Actions">
<% control Actions %>$Field<% end_control %>
</div>
<% end_if %>
</form>

Form inputs renders ok, but problem is with the action buttons - i can't find a way to display it in custom template.
Default 'Save' button is added to the form in ComplexTableField_Popup constructor, but there isnt any documentation about how to display it.

I'd be glad for some working example of custom template buttons or any directions.

Pavel