Skip to content

Commit 381638f

Browse files
committedOct 3, 2011
Set the action to get the save!
1 parent 0e82552 commit 381638f

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed
 

‎lib/WebGUI/Asset/MatrixListing.pm

+12-7
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ sub getEditForm {
209209
my $i18n = WebGUI::International->new($session, 'Asset_MatrixListing');
210210
my $func = $session->form->process("func");
211211

212-
my $form = WebGUI::FormBuilder->new($session);
213-
214-
if ($func eq "add" || ( $func eq "editSave" && $session->form->process("assetId") eq "new")) {
212+
my $form = WebGUI::FormBuilder->new($session, action => $self->getParent->getUrl, );
213+
214+
if ($func eq "add" || ( $func eq "addSave" && $session->form->process("assetId") eq "new")) {
215215
$form->addField( "hidden",
216216
name => 'assetId',
217217
value => 'new',
@@ -220,11 +220,17 @@ sub getEditForm {
220220
name => 'className',
221221
value => 'WebGUI::Asset::MatrixListing',
222222
);
223+
$form->addField( "hidden",
224+
name =>'func',
225+
value =>'addSave',
226+
);
223227
}
224-
$form->addField( "hidden",
225-
name =>'func',
226-
value =>'editSave',
228+
else {
229+
$form->addField( "hidden",
230+
name =>'func',
231+
value =>'editSave',
227232
);
233+
}
228234
$form->addField( "text",
229235
name =>'title',
230236
defaultValue =>'Untitled',
@@ -349,7 +355,6 @@ sub getEditTemplate {
349355
my $template = eval { WebGUI::Asset->newById($self->session, $matrix->get('editListingTemplateId')); };
350356
# TODO: Change to FormBuilder
351357
$var->{form} = $self->getEditForm->toHtml;
352-
$self->session->log->warn($var->{form});
353358
$template->setParam(%{ $var });
354359
$template->style($matrix->getStyleTemplateId);
355360
return $template;

0 commit comments

Comments
 (0)
Please sign in to comment.