Thanks Ruud. From your posting (and possibly having benefitted from getting some sleep - a rarity), I tracked down my issue to how I've created the widget. It was the 3rd parameter and because in the set of forms I've created, this was the only default value I wanted so I hadn't noticed that I wasn't setting one, unless the form was being refiwed (and the value was set from session data). I had this:
Code:
$objWidget = new $strClass($this->prepareForWidget($arrData, $table['field'], (strlen($_SESSION[$strSessionProductNode][$strSessionProductElement][$table['field']]) ? $_SESSION[$strSessionProductNode][$strSessionProductElement][$table['field']] : $arrDefault[$table['field']])));
and
Code:
$arrDefault[$table['field']]
was always empty. The dangers of copying and pasting blocks of code!!!
As you can see, I was passing it the $arrData array (which is the dca array for the current field) so I changed the line to read:
Code:
$objWidget = new $strClass($this->prepareForWidget($arrData, $table['field'], (strlen($_SESSION[$strSessionProductNode][$strSessionProductElement][$table['field']]) ? $_SESSION[$strSessionProductNode][$strSessionProductElement][$table['field']] : $arrData['default'])));
...notice the:
Code:
$arrData['default']
at the end.
= Result!
Thanks for your help guys in helping me track this down :D
Bookmarks