Development

#1899 (object_admin_double_list doesn't send values to request)

You must first sign up to be able to contribute.

Ticket #1899 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

object_admin_double_list doesn't send values to request

Reported by: snowkrash Assigned to: fabien
Priority: minor Milestone: 1.0.8
Component: helpers Version: 1.0.4
Keywords: object_admin_double_list request admin frontend helper Cc:
Qualification:

Description

Hi,

I tried to get some help on the forums, but nobody responded. The following looks like a bug to me, but if I sent this while I did something wrong/stupid, I am sorry.

The problem

I'm 'borrowing' the admin generator's object_admin_double_list helper inside the frontend application for a more user-friendly multiselect box.

Getting the box in the view with all the (pre-selected) values is not the problem.

<?php echo object_admin_double_list($oStagiair, 'getRegioStagiairs', 'through_class=RegioStagiair size=5') ?>

The relation

Stagiair ---------1:n--< RegioStagiair? >--n:1---------- Regio

Unfortunately:

a) I can't get Symfony's validation system attached to it (required field) b) The values selected are not in the Request parameter holder after submit.

There's a fair chance that a and b are linked.

TIA Jordi

Attachments

double_list.patch (242 bytes) - added by wOpi on 09/07/07 19:12:24.
Fixes double_list javascript function to add support for arguments, instead of using the static defined form id.

Change History

07/25/07 11:20:29 changed by Halil.Koklu

  • milestone deleted.

Have you attached this option to your form?

onsubmit=return double_list_submit()

09/07/07 19:08:24 changed by wOpi

  • status changed from new to closed.
  • resolution set to fixed.

In your form you will want to add an id and call the double_list_submit function with an argument. The attached patch, will fix the issue that the id only could be sf_admin_edit_form.

<?php echo form_tag('sfGuardUser/update', array('id' => 'myformidtag', 'onsubmit'  => 'double_list_submit(\'myformidtag\'); return true;') ) ?>

This has been tested working with v1.0.6 with and without usage of the admin generator.

09/07/07 19:12:24 changed by wOpi

  • attachment double_list.patch added.

Fixes double_list javascript function to add support for arguments, instead of using the static defined form id.

09/08/07 10:50:08 changed by fabien

  • status changed from closed to reopened.
  • resolution deleted.
  • milestone set to 1.0.8.

09/09/07 01:58:42 changed by DrCore

  • qualification set to Unreviewed.

10/02/07 18:13:37 changed by noel

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [5345]) allow using a custom form id (closes #1899)

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.