redefine a submit button in terms of a normal button
in short: override new() instead of toHtml to allow changes to be made to the submit button.
This commit is contained in:
parent
744568108f
commit
0c25620867
1 changed files with 12 additions and 7 deletions
|
|
@ -49,18 +49,23 @@ sub getName {
|
|||
return WebGUI::International->new($session, 'WebGUI')->get('submit');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 toHtml ( )
|
||||
=head2 new ( session, properties )
|
||||
|
||||
Renders a button.
|
||||
Preconfigure this button to be a Submit button
|
||||
|
||||
=cut
|
||||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
$self->{_params}{extras} ||= 'class="forwardButton" onclick="this.value=\''.$i18n->get(452).'\'"';
|
||||
return $self->SUPER::toHtml;
|
||||
sub new {
|
||||
my ( $class, @args ) = @_;
|
||||
my $self = $class->SUPER::new( @args );
|
||||
$self->set( 'type' => 'submit' );
|
||||
if ( !$self->get('extras') ) {
|
||||
my $i18n = WebGUI::International->new($self->session, 'WebGUI');
|
||||
$self->set( 'extras' => 'class="forwardButton" onclick="this.value\'' . $i18n->get(452) . '\'"' );
|
||||
}
|
||||
return $self;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue