Jump to:

1976 Posts in 1306 Topics by 607 members

Form Questions

SilverStripe Forums » Form Questions » custom form template - action buttons?

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1098 Views
  • paaja
    Avatar
    Community Member
    1 Post

    custom form template - action buttons? Link to this post

    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

    1098 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.