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", "MochiKit.Logging"] &>
85 <table><tr><td><div id="<% $form_div_name %>_buttons" >[loading edit links...]</div>
87 <table><tr><td><div id="<% $form_div_name %>" >[loading...]</div>
89 <script language="javascript" type="text/javascript">
91 var <% $js_object_name %> = new CXGN.Page.Form.JSFormPage( '<% $object_id %>' , '<% $object_type %>', '<% $server_side_script %>', '<% $form_div_name %>', '<% $js_object_name %>','<% $page_url %>');
92 % if (defined($alternate_new_button)) {
93 <% $js_object_name %>.setNewButton('<% $alternate_new_button %>');
96 % if (defined($alternate_ghosted_new_button)) {
97 <% $js_object_name %>.setGhostedNewButton('<% $alternate_ghosted_new_button %>');
100 % if (defined($alternate_delete_button)) {
101 <% $js_object_name %>.setDeleteButton('<% $alternate_delete_button %>');
104 % if (defined($alternate_ghosted_delete_button)) {
105 <% $js_object_name %>.setGhostedDeleteButton('<% $alternate_ghosted_delete_button %>');
108 % if (defined($alternate_edit_button)) {
109 <% $js_object_name %>.setEditButton('<% $alternate_edit_button %>');
112 % if (defined($alternate_ghosted_edit_button)) {
113 <% $js_object_name %>.setGhostedEditButton('<% $alternate_ghosted_edit_button %>');
117 <% $js_object_name %>.render();