view release on metacpan or search on metacpan
docs/keyword_cookbook/field/date_select_text/discussion view on Meta::CPAN
=head1 USE
The value for the C<date_select_text> keyword is the link text which will
popup a rather old fashioned Javascript based date picker.
For it to work, you must use C<Gantry::Plugins::Calendar> (but you don't have
to use it as a plugin). Further, you must name your form and add this to its
C<extra_keys>:
extra_keys
javascript => `$self->calendar_month_js( 'your_form_name' )`;
Those steps are rather tedious, so tentmaker does them for you when
you enter a value for the C<date_select_text> keyword.
docs/keyword_cookbook/field/date_select_text/discussion view on Meta::CPAN
Yahoo's UI or JQuery. Both of those, and many similar frameworks, have
more modern and usable date pickers along with a wealth of other gadgets.
=head1 EXAMPLE
To see an example, build:
bigtop -c example.bigtop all
Change to the newly created Kids directory, start the app server, and add
a child. When you press 'Select Date', a box should popup. Click on a
date to fill in the field and close the popup.
To see the code, look in lib/Kids/GEN/Child.pm. Note the use of the
Calendar plugin, the naming of the form, and the Javascript.
lib/Bigtop/Docs/Cookbook.pod view on Meta::CPAN
Including the refers_to statement implies that the field is a foreign
key. Whether this generates SQL indicating that is up to the backend.
None of the current backends (Bigtop::SQL::Postgres, Bigtop::SQL::MySQL,
or Bigtop::SQL::SQLite) generate foreign key SQL. But, using refers_to
always affects the model. For instance, Bigtop::Model::DBIxClass generates
a belongs_to call for each field with a refers_to statement. Other Model
backends do the analogous things.
The date_select_text is shown by Gantry templates as the text for
a popup calendar link. See the discussion of the LineItem controller in
Bigtop::Docs::Tutorial for details. You might also want to check 'How can I
let my users pick dates easily?' in Gantry::Docs::FAQ to see
what bigtop generates.
All of the statements which begin with html_form_ are passed through
to the template (with html_form_ stripped). Consult your template
for details. The Gantry template is form.tt. Note that html_form_constraint
is actually used by Gantry plugins which rely on Gantry::Utils::CRUDHelp.
This includes at least Gantry::Plugins::AutoCRUD and Gantry::Plugins::CRUD.
These constraints are enforced by Data::FormValidator.
lib/Bigtop/Docs/FullKeywords.pod view on Meta::CPAN
Applies only to fields of type select.
=item html_form_fieldset
Name of fieldset to group this field into
=item date_select_text
link text for date popup window
Applies only to fields of type text.
=item html_form_raw_html
appears before this field's table row
=item non_essential
lib/Bigtop/Docs/QuickKeywords.pod view on Meta::CPAN
html_form_cols - cols attribute of text area
html_form_rows - rows attribute of text area
html_form_display_size - width attribute if type is text
html_form_class - class attribute for the form field
html_form_hint - form field hint
html_form_options - Choices for fields of type select
[ignored for refers_to fields]
html_form_foreign - Display field is a foreign key
html_form_onchange - Name of Javascript function to call on change
html_form_fieldset - Name of fieldset to group this field into
date_select_text - link text for date popup window
html_form_raw_html - appears before this field's table row
non_essential - Tells modeler: retrieve only when accessed
pseudo_value - This is the definition for a pseudo field. By defining it, you're declaring the field as a pseudo field
unique_name - Declare this field as unique, and use the value for the constraint name
join_table name {}
joins - Which tables does this one join?
names - What should I call each has many?
data - What to INSERT INTO table upon initial creation
fields as for regular tables
lib/Bigtop/Docs/TentRef.pod view on Meta::CPAN
Changing the name of the field will change all references to it in other
parts of the bigtop file.
=item SQL Type
The type of the column in SQL. In the quick edit box you may only supply
one type phrase. In the full edit table, you may include as many phrases
as you like.
If you change the type to date, tentmaker will do all the needed work to
make a popup calendar for easy date selection.
Note that int4 and varchar are magical. Each database backend does something
reasonable to turn these into integers and strings respectively. All other
types are taken literally and must be understood by the database you
actually use.
=item Label
What the user sees as a label for this field when it is on the screen.
lib/Bigtop/Docs/TentRef.pod view on Meta::CPAN
Applies only to html_form_type display. Indicates that this field is a
foreign key and the foreign_display should be used instead of the id.
=item html_form_onchange
If the field's type is select, this becomes the onchange callback for
the select input element.
=item date_select_text
Gantry provides a mechanism for user date entry via a popup calendar.
Enter the link text, which will trigger the popup, here. If you set a
value here, several other changes will happen throughout the bigtop file,
so that the user can easily pick dates. This will be set automatically
when any field's type becomes date.
=item html_form_raw_html
HTML to be added immediately before this field's HTML table row. Generally
useful for hacking only.
=item non_essential
lib/Bigtop/Docs/TentRef.pod view on Meta::CPAN
you to pump extra keys into that hash. The value must be perl code.
Quoting issues are inevitable with this field. Javascript and Perl must
fight over the quote operators. To be safe use q or qq quoting operators.
=item form_name
Becomes the name attribute of the form HTML element. tentmaker will set this
when a field's SQL type becomes date or you set date_select_text for it.
See 'How can I let my users pick dates easily?' in C<Gantry::Docs::FAQ> for
an explanation of all the pieces needed to make date popups work.
Then be glad tentmaker already knows all that.
=back
=item CRUD_form
The statements are exactly the same as for AutoCRUD_forms, they differ only
internally so they can respond to the slightly different APIs of AutoCRUD
and CRUD.
lib/Bigtop/Docs/Tutorial.pod view on Meta::CPAN
field id { is int4, primary_key, assign_by_sequence; }
field due_date {
is date;
label `Due Date`;
date_select_text Select;
html_form_type text;
}
The date_select_text will appear as an HTML href link next to the entry
field for the date. If the user clicks the link, a popup will display
an intuitive calendar. If the user clicks a date on the popup calendar,
the text input box will be populated with that date.
Of course, this behavior is driven by the controller.
For example, see the LineItem controller below.
field name {
is varchar;
label Name;
html_form_type text;
}
lib/Bigtop/Docs/Tutorial.pod view on Meta::CPAN
appropriate. Bigtop::Backend::Control::Gantry can generate the proper
form method as shown here.
There are three statements in an AutoCRUD_form method block:
=over 4
=item form_name
the name of the html form element. This doesn't usually matter.
It does matter when you use the date popups (see later tables that
have dates). Note that XHTML does not allow form elements to have names,
but until we fix our date scheme, we'll have to be in violation.
=item fields
a comma separated list of fields that should be included on the form.
=item extra_keys
any extra keys that should be included in the hash form returns and their
lib/Bigtop/Keywords.pm view on Meta::CPAN
keyword => 'html_form_fieldset',
label => 'Fieldset',
descr => 'Name of fieldset to group this field into',
type => 'text',
multiple => 0,
sort_order => 147,
},
date_select_text => {
keyword => 'date_select_text',
label => 'Date Popup Link Text',
descr => 'link text for date popup window',
type => 'text',
field_type => 'text',
multiple => 0,
refresh => 1,
sort_order => 150,
},
html_form_raw_html => {
keyword => 'html_form_raw_html',
label => 'Raw HTML',
descr => q!appears before this field's table row!,
lib/Bigtop/Parser.pm view on Meta::CPAN
push @{ $current_uses->{ __ARGS__ } },
'Gantry::Plugins::Calendar';
}
push @retval,
$self->get_ident . '::uses',
$current_uses->{ __ARGS__ };
}
# then, tell update my form
my $result = $self->walk_postorder(
'add_date_popups', $data->{ table }
);
push @retval, @{ $result };
return \@retval;
}
return;
}
lib/Bigtop/Parser.pm view on Meta::CPAN
shift;
my $data = shift;
return unless ( $self->get_ident eq $data->{ident} );
$self->set_type( $data->{new_type} );
return [ 1 ];
}
sub add_date_popups {
my $self = shift;
shift;
my $table = shift;
return unless $self->{ __TYPE__ } =~ /form/;
# First, make sure the form is named for the table (or has a name)
my $form_statement = $self->get_method_statement( 'form_name' );
my $form_name = $table;
lib/Bigtop/TentMaker.pm view on Meta::CPAN
It uses create_subblock on the AST.
=head2 do_delete_block
Removes a block from the AST.
Params:
ident
The front end is responsible for any user confirmation popups.
It uses delete_block on the AST.
=head2 do_type_change
Changes the is type for blocks which acept those.
Params:
ident
t/tentmaker/ajax_04/aseq view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_04/aseq view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_04/aseq view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_04/aseq view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_04/aseq view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_04/cfield view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_04/ctable view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
t/tentmaker/ajax_04/ctable view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
t/tentmaker/ajax_04/ctable view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
t/tentmaker/ajax_04/ctable view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
t/tentmaker/ajax_04/ctable view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>
t/tentmaker/ajax_09/billing_initial view on Meta::CPAN
this.value,
"",
"full_edit"
)'
/>
</td>
<td>
link text for date popup window
</td>
</tr>
<tr>
<td> html_form_raw_html </td>
<td>