Hi,
in the
documentation it is said that "@ bindings will work only when used inside 'Input Option Values' or 'Default Value' fields". Well, I tried a very simple thing and put
@EVAL return $modx->resource->get('id');
into both fields (I chose radio buttons as input type). The radio button is shown with the correct value, but it isn't selected. When I try to display the value using
[[!getResourceField? &id=`24` &field=`JobId` &isTV=`1` processTV=`1` &default=`no value`]]
I consequently get "no value" as result.
Is there a way to set the value of the TV dynamically to a value that has been calculated from the Resource ID?
The background to this is that I use an additional context for administering job offers. Each job offer has its own resource; the data is entered into TVs. In the frontend, the data is read via getResources etc. (at the moment; I'll write some specific snippets later). Now I need an ID for every job offer, which I want to calculate from the Resource ID (a very easy example would be to add 100.000 to the ID). The Job ID should be shown in the TV tab of the Resource (a single radio button would be okay) and be used in the frontend.
I could of course just show the calculated Job ID in the Manager and use the Resource ID in the frontend, calculating the Job ID again, but I'd rather set the Job ID correctly when creating the new job offer Resource.
Maybe I'm just too tired to see the obvious solution, but I'm losing too much time with this, so I'd be very grateful for any helpful hints.
Thanks in advance!
Cheers,
Jan