wrap_label_method' not implemented?

27 views
Skip to first unread message

Steve Schafer

unread,
Jun 26, 2013, 5:30:37 PM6/26/13
to formh...@googlegroups.com
Hello,

I am trying to accomplish the following for one of my field labels (pretty much what the docs suggest) to no avail.:
<a href="...">$label</a>

After spending a couple of hours running through the debugger, I don't see that my coderef is ever executed.  Am I missing something?  If not, can someone point me in the right direction for proper implementation?  Please see code below.

Thanks!
Steve

My form is using the 'HTML::FormHandler::Render::Table' role, and my field definition is:

has_field => 'code' => (
             type  => 'Text',
             wrap_label_method => \&wrap_itemcode_label,
            );

... with the method defined as follows:

sub wrap_itemcode_label {
    my ( $self, $label ) = @_;
    return qq{<a href="javascript:;" onclick=window.open(' ...url here...)'>$label</a>};
}

Gerda Shank

unread,
Jun 27, 2013, 10:02:27 AM6/27/13
to formh...@googlegroups.com
You need to use HTML::FormHandler::Widget::Form::Table, not HTML::FormHandler::Render::Table. The widget rendering has quite a few rendering features which are not implemented in the other rendering roles, which now serve mainly as examples for people who prefer that type of rendering.

Gerda



--
You received this message because you are subscribed to the Google Groups "formhandler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to formhandler...@googlegroups.com.
To post to this group, send email to formh...@googlegroups.com.
Visit this group at http://groups.google.com/group/formhandler.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages