Author: pmacadden
Date: 2010-09-10 19:48:43 +0200 (Fri, 10 Sep 2010)
New Revision: 30880
Removed:
plugins/dcReloadedFormExtraPlugin/trunk/TODO
Modified:
plugins/dcReloadedFormExtraPlugin/trunk/README
plugins/dcReloadedFormExtraPlugin/trunk/lib/widget/dcWidgetFormAjaxDependence.class.php
Log:
updated README and ajax dependence widget
Modified: plugins/dcReloadedFormExtraPlugin/trunk/README
===================================================================
--- plugins/dcReloadedFormExtraPlugin/trunk/README 2010-09-10 16:38:18 UTC
(rev 30879)
+++ plugins/dcReloadedFormExtraPlugin/trunk/README 2010-09-10 17:48:43 UTC
(rev 30880)
@@ -47,11 +47,64 @@
`pmWidgetFormPropelChoiceOrCreate`. So, use it as you use the
`pmWidgetFormPropelChoiceOrCreate`.
+### mtWidgetFormPlain
+
+The `mtWidgetFormPlain` provides a way for showing plain values in the forms.
+
+##### Usage
+
+ [php]
+ $this->widgetSchema["some_field"] = new
mtWidgetFormPlain(array("add_hidden_input" => true));
+
+For more options, take a look at the widget's doc comments.
+
+### dcWidgetFormAjaxDependence
+
+This widget is used with select widgets filtering values depending on the
+selection made in observed widget. Supose widget A11 observing A1 widget
+changes, that observes A widget changes.
+In this case, you can have the following scenarios:
+ * The form will save A, A1 and A11 values
+ * The form will only sava A11 values (A and A1 will be used only for
filtering purpose)
+
+For the first case, just use the widget as it is. But for the second case, you
+will need to do some trick inside the form implementation:
+ if (!$this->getObject()->isNew())
+ {
+ $a11Object=$this->getObject()->getA11();
+ $this->setDefault('a1_id',$a11Object->getA1Id());
+ $this->setDefault('a_id',$b111->getB11()->getA1()->getAId());
+ }
+
+##### Usage
+
+ [php]
+ $w = new sfWidgetFormInput();
+ $this->widgetSchema["some_field"] = new dcWidgetFormAjaxDependence(array(
+ "dependant_widget" => $w,
+ "observe_widget_id" => "some_form_some_field",
+ "get_observed_value_callback" => array(get_class($this),
"getValueForUpdate")
+ ));
+
+And then you must implement the getValueForUpdate method.
+
+### dcWidgetFormPropelAjaxDependence
+
+Same as dcWidgetFormAjaxDependence, except that retrieves objects from Propel
+classes.
+
## For developers
- * If you need to create a module for ajax actions use the `dc_ajax` module.
+ * If you need to create ajax actions use the `dc_ajax` module.
-## TO DO
+## TODO
+### pmWidgetFormPropelChoiceOrCreate
+
* Add more of the sfWidgetFormPropelChoice parameters to the getPropelChoices
- action (and getDoctrineChoices).
\ No newline at end of file
+ action (and getDoctrineChoices).
+
+### dcWidgetFormAjaxDependence y dcWidgetFormPropelAjaxDependence
+
+ * Port to jQuery. Once this is done, delete js/prototype.js, that is added
+ JUST for this widget.
\ No newline at end of file
Deleted: plugins/dcReloadedFormExtraPlugin/trunk/TODO
===================================================================
--- plugins/dcReloadedFormExtraPlugin/trunk/TODO 2010-09-10 16:38:18 UTC
(rev 30879)
+++ plugins/dcReloadedFormExtraPlugin/trunk/TODO 2010-09-10 17:48:43 UTC
(rev 30880)
@@ -1,7 +0,0 @@
-# TODO
-
-## dcWidgetFormAjaxDependence y dcWidgetFormPropelAjaxDependence
-
-* Portar a jQuery: una vez hecho ésto, eliminar el script js/prototype.js, ya
- que se agrega para el uso UNICAMENTE para el uso de este widget (por eso no
- se usa como dependencia).
\ No newline at end of file
Modified:
plugins/dcReloadedFormExtraPlugin/trunk/lib/widget/dcWidgetFormAjaxDependence.class.php
===================================================================
---
plugins/dcReloadedFormExtraPlugin/trunk/lib/widget/dcWidgetFormAjaxDependence.class.php
2010-09-10 16:38:18 UTC (rev 30879)
+++
plugins/dcReloadedFormExtraPlugin/trunk/lib/widget/dcWidgetFormAjaxDependence.class.php
2010-09-10 17:48:43 UTC (rev 30880)
@@ -77,12 +77,12 @@
/*
* Required Javascripts for this widget
*/
- public function getJavascripts()
+ public function getJavaScripts()
{
/* prototype is required... :(
* TODO: reimplement form jQuery
*/
- return
array_merge(parent::getJavascripts(),array('/dcReloadedFormExtraPlugin/js/prototype.js',
'/dcReloadedFormExtraPlugin/js/ajax_dependence.js'),
$this->getDependantWidgetJavascripts());
+ return
array_merge(parent::getJavaScripts(),array('/dcReloadedFormExtraPlugin/js/prototype.js',
'/dcReloadedFormExtraPlugin/js/ajax_dependence.js'),
$this->getDependantWidgetJavaScripts());
}
/**
@@ -90,12 +90,12 @@
*
* @return array
*/
- public function getDependantWidgetJavascripts()
+ public function getDependantWidgetJavaScripts()
{
$dependant_widget = $this->getOption('dependant_widget');
- if (is_callable(array($dependant_widget, 'getJavascripts')))
+ if (is_callable(array($dependant_widget, 'getJavaScripts')))
{
- return $dependant_widget->getJavascripts();
+ return $dependant_widget->getJavaScripts();
}
return array();
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" 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-svn?hl=en.