I have a site where members can register, specify their interests and levels
of interest (very interested in dogs, not interested in cats). Main tables
are member, interest, level, interest_level with appropriate relationships.
Interest_level has member_id, interest_id and level_id. Once a user
declares specific interest he should only be able to change the level or
delete it.
I am using mpStarRatingPlugin 1.0.0, ahDoctrineEasyEmbeddedRelationsPlugin
1.4.4 and sfJqueryReloadedPlugin 1.4.3 (jquery-1.3.2 and jquery-ui-1.7.3 but
I also tried jquery-1.4.4 and jquery-ui-1.8.8).
Stars show up fine, you can click plus at the bottom to add new form and it
looks really good. Several major problems:
- The primary key IDs display despite the fact that Debug toolbar say:
$form['interest_level'][0]['id'] (sfWidgetFormInputHidden)
- Since I set interest_id to be hidden you cannot see the interest, just
the number of stars. How do I set it be read-only and to actually display
the value?
- Updating interest level does not save to the DB.
- If I try to create several interest_level at the same time (via +
button) than I cannot set different levels.
Here is what I have done:
In my memberForm class I added:
...
$this->embedRelations(array (
'interest_level' => array(
'considerNewFormEmptyFields' => array(),
'newFormAfterExistingRelations' => true,
'multipleNewForms' => true,
'newFormsInitialCount' => 2,
)
...
In my interest_levelForm class I have:
$levels = array(1 => 'Not Interested', 2 => 'Somewhat interested', 3 =>
'Very interested');
...
if($this->getObject()->isNew())
{...
'interest_id' => new sfWidgetFormDoctrineChoice(array('model' =>
$this->getRelatedModelName('interest'))),
...}
else
{...
'interest_id' => new sfWidgetFormInputHidden(),
...}
...
'level_id' => new mpWidgetFormChoiceRating(array('choices' => $levels)),
Please help. I have been beating my head on the keyboard for days with
this.
Thank you.
Dmitry
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en