Bruno17 / MIGX

MIGX for revo 2.2 and above
83 stars 78 forks source link

MIGX 2.11.0 - default value is not updated #294

Open systemshock89 opened 7 years ago

systemshock89 commented 7 years ago

I have a configuration with several formtabs. In each of the formtabs there are fields with the same filedname. This filednames have default values. In this version MIGX when the formtab is changed, the default value is not updated.

Bruno17 commented 7 years ago

I would say, this is expected bahaviour. If you have a value in one formtab in a field. The same field in another formtab should have the same value after switching. The default-value is only used, as long, as the field is empty. If you need different values between different formtabs, you have to use different fieldnames.

systemshock89 commented 7 years ago

But I need the same field in different formtabs to have different default values. Depending on which of the formtabs is selected, it shows its default value. I have a hidden field: MIGX_chunk. For each of the formtabs, I specify my default value of the chunk. In this way, I implement the addition of blocks with different chunks to the resource modx. Is it now possible to do this?

Bruno17 commented 7 years ago

can't you use

&tpl=`@FIELD:MIGX_formname`

like shown here: https://docs.modx.com/extras/revo/migx/migx.tutorials/migx.varying-layout-boxes

systemshock89 commented 7 years ago

Thank you. But often need other fields (created by the user, not just the MIGX_formname field), where the default value is deleted depending on the selected formtab. It would be nice if it functions as before ..

Bruno17 commented 7 years ago

Like written above, the value of a field with the same name has to carried from one formtab to the others, when switching between them. We don't want to loose values, while switching forth and back. If that didn't work like that before, it was a bug. And if you need different values between formtabs, use different fieldnames, as I said. Then you can use different placeholders in your different chunks and you should be good.

systemshock89 commented 6 years ago

in which file should I change the logic to the old one? To work as in version 2.9.6?