Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the HTML-FormHandler CPAN distribution.

Report information
The Basics
Id: 82850
Status: resolved
Priority: 0/
Queue: HTML-FormHandler

People
Owner: Nobody in particular
Requestors: chen.yack [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.04
Fixed in: (no value)



Subject: wrapper field with before_element and do_label option incorrect
#!/bin/env perl package PeSystem::Form::Announcement; use HTML::FormHandler::Moose; extends 'HTML::FormHandler'; use namespace::autoclean; has '+widget_wrapper' => ( default => 'Bootstrap'); has_field 'addresses' => ( type => 'Repeatable', do_wrapper => 1, do_label => 1, label => 'Adress', num_when_empty => 3, tags => { before_element => '<table>' , after_element => '</table>' }, ); has_field 'addresses.contains' => ( #widget_wrapper => 'Table' , type => 'Text', #do_label => 1 ); sub build_form_element_class { ['form-horizontal'] } __PACKAGE__->meta->make_immutable; no HTML::FormHandler::Moose; package main; my $form = PeSystem::Form::Announcement->new; print $form->field('addresses')->render; output: <div class="control-group"> <label class="control-label" for="addresses">Adress</label><table> <div class="controls"> <div class="control-group"> <label class="control-label" for="addresses.0">0</label> <div class="controls"> <input type="text" name="addresses.0" id="addresses.0" value="" /></div> </div> <div class="control-group"> <label class="control-label" for="addresses.1">1</label> <div class="controls"> <input type="text" name="addresses.1" id="addresses.1" value="" /></div> </div></table></div> </div> ========= two "table" tag are not match ============
From: chen.yack [...] gmail.com
exchange line 30 and 32 can fix this bug : 30 $output .= $self->get_tag('before_element'); 31 # the controls div for ... controls 32 $output .= qq{\n<div class="controls">} unless $form_actions || !$self->do_label; 在2013-一月-21 04:36:14 星期一时,chinaxing写到: Show quoted text
> #!/bin/env perl > package PeSystem::Form::Announcement; > use HTML::FormHandler::Moose; > extends 'HTML::FormHandler'; > use namespace::autoclean; > > has '+widget_wrapper' => ( default => 'Bootstrap'); > > has_field 'addresses' => ( > type => 'Repeatable', > do_wrapper => 1, > do_label => 1, label => 'Adress', > num_when_empty => 3, > tags => { before_element => '<table>' , after_element =>
'</table>' Show quoted text
> }, > ); > has_field 'addresses.contains' => ( > #widget_wrapper => 'Table' , > type => 'Text', > #do_label => 1 > ); > sub build_form_element_class { ['form-horizontal'] } > > __PACKAGE__->meta->make_immutable; > no HTML::FormHandler::Moose; > > package main; > > my $form = PeSystem::Form::Announcement->new; > print $form->field('addresses')->render; > > > output: > <div class="control-group"> > <label class="control-label" for="addresses">Adress</label><table> > <div class="controls"> > <div class="control-group"> > <label class="control-label" for="addresses.0">0</label> > <div class="controls"> > <input type="text" name="addresses.0" id="addresses.0" value="" />
</div> Show quoted text
> </div> > <div class="control-group"> > <label class="control-label" for="addresses.1">1</label> > <div class="controls"> > <input type="text" name="addresses.1" id="addresses.1" value="" />
</div> Show quoted text
> </div></table></div> > </div> > > > ========= two "table" tag are not match ============
Fixed in version 0.40018.