ryancramerdesign / ProcessWire

Our repository has moved to https://github.com/processwire – please head there for the latest version.
https://processwire.com
Other
727 stars 201 forks source link

Fields with Visible if condition inside Repeaters do not save values #803

Open simplysoft opened 9 years ago

simplysoft commented 9 years ago

We have setup a repeater that represents a section. The section can have a section type, it can be a "image" or an "text" section. Further we have two different fields that show depending on the section type. If the section type is image, we show an image, if the section type is text, we show a htmlarea.

For the htmlarea and image we set in the repeater context the appropriate Visible if contition (type=text, and type=image). This works as expected, when we set it to type image, we only see the image, and if we set the section to type text, only the htmlarea is visible.

But it looks like with this configuration, new values are not saved anymore. If we remove the Visible if condition, saving does work again.

ryancramerdesign commented 9 years ago

Repeaters don't technically support field dependencies, so I think that's likely the source of it. However, I actually think the scenario you describe sounds like a perfect use case for the PageTable fields in PW 2.5. They are like repeaters, but better. They do support field dependencies. But you actually wouldn't even need dependencies here because they have something better: the ability to create different item types (templates) within the same field. That would seem to be ideal for the use case you are describing?

yckart commented 8 years ago

Can be closed, because it is supported now (3.0.0+) http://processwire.com/blog/posts/processwire-3.0.4-repeaters-revisited-preview-of-profields-matrix/