I'm trying to pre-fill a TV in MODX 2.2.2 (only if it's empty) with the processed value of a chunk. Using $resource->setTVValue() and $tv->setValue() both work imperfectly. The values don't show up unless the manager page is reloaded.
Is there a method I can use to set the TV so it will show up on the first load of the Manager's Create/Edit Resource page?
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
may be you can something do with categories at OnResourceTVFormRender
code from controller resource.class.php:
$onResourceTVFormRender = $this->modx->invokeEvent('OnResourceTVFormRender',array(
'categories' => &$finalCategories,
'template' => $templateId,
'resource' => $this->resource->get('id'),
'tvCounts' => &$this->tvCounts,
'hidden' => &$hidden,
));
I've looked at that, but can't figure out how to set the value of an individual TV.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html