7 /page/form.mas - a component for displaying static and editable forms for user input
11 The form component is based on an ajax implementation and requires some backend scripts to be implemented for a given form.
13 See JSFormPage.js for the javascript code
22 The type of object the form is associated with - for example, 'locus' for a locus page, or 'image' for an image page, etc.
26 The ID of the object to be displayed
30 The name of the form. Should be unique for the entire page.
32 =item server_side_script
34 The url of the server side script that handles the ajax requests
38 The name of the div to be used for displaying the forms.
42 The javascript variable name to be used in the form.
46 The semi-absolute url of the page that displays the form.
48 =item alternate_new_button, alternate_ghosted_new_button, alternate_delete_button, alterante_ghosted_delete_button
50 An alternate link for the 'new' and 'delete' buttons, including their ghosted variants. For example, if the 'new' button is not needed, it and its ghosted variant can be set to the empty string.
59 Lukas Mueller <lam87@cornell.edu>, based on Perl code by Naama Menda.
73 $alternate_new_button => undef
74 $alternate_ghosted_new_button => undef
75 $alternate_delete_button => undef
76 $alternate_ghosted_delete_button => undef
77 $alternate_ghosted_edit_button => undef
78 $alternate_edit_button => undef
81 <& /util/import_javascript.mas, classes => ["CXGN.Page.Form.JSFormPage"] &>
83 <table><tr><td><div id="<% $form_div_name %>_buttons" >[loading edit links...]</div>
85 <div id="<% $form_div_name %>" >[loading...]</div>
87 <script language="javascript" type="text/javascript">
89 var <% $js_object_name %> = new CXGN.Page.Form.JSFormPage( '<% $object_id %>' , '<% $object_type %>', '<% $server_side_script %>', '<% $form_div_name %>', '<% $js_object_name %>','<% $page_url %>');
90 % if (defined($alternate_new_button)) {
91 <% $js_object_name %>.setNewButton('<% $alternate_new_button %>');
94 % if (defined($alternate_ghosted_new_button)) {
95 <% $js_object_name %>.setGhostedNewButton('<% $alternate_ghosted_new_button %>');
98 % if (defined($alternate_delete_button)) {
99 <% $js_object_name %>.setDeleteButton('<% $alternate_delete_button %>');
102 % if (defined($alternate_ghosted_delete_button)) {
103 <% $js_object_name %>.setGhostedDeleteButton('<% $alternate_ghosted_delete_button %>');
106 % if (defined($alternate_edit_button)) {
107 <% $js_object_name %>.setEditButton('<% $alternate_edit_button %>');
110 % if (defined($alternate_ghosted_edit_button)) {
111 <% $js_object_name %>.setGhostedEditButton('<% $alternate_ghosted_edit_button %>');
115 <% $js_object_name %>.render();