|
Thanks Alejandro,
Can you elaborate on the new component option #1 ? Rather than complicate the ObjectForm with new logic, what would the anatomy of this new component be? For the sake of isolating logic and de-coupling I thought it might be nice to keep it segregated to it's own component in case it takes on any additional growth/functionality. Plus it would be retro-fittable to other combinations of components potentially. How do you think about that? Are there more details you could elaborate on the component itself? Thank you The new component will have the renderBody = true, renderProperties = false behavior.
It should be simple and it should look like this: <span jwcid="$content$"> I will go ahead with this, so I can show you an elaborated usage example. We can merged with the ObjectForm later if we want to. I decided to implement it using a variation of option #2 (it's less code)
I've created two new parameters in the ObjectForm component <parameter name="renderProperties" default-value="true"/> <parameter name="renderActions" default-value="true"/> The ObjectForm template is self-explanatory: <span jwcid="$content$"> <form jwcid="form"> <ul class="glasslist"> <div jwcid="@If" condition="ognl:renderProperties"> <div jwcid="editProperties"/> </div> <div jwcid="@If" condition="ognl:bodyCount > 0"> <span jwcid="@RenderBody"/> </div> <div jwcid="@If" condition="ognl:renderActions"> <li class="buttonBar bottom"> <div jwcid="objectActions"/> </li> </div> </ul> </form> </span> Another difference with the previous ObjectForm is that the new one will ALWAYS render its body if it has one. |
|||||||||||||||||||||||||||||||||||||||||||||||
We have two options:
1) a completely new component
2) add two new parameters to the ObjectForm: renderBody & renderProperties
By default they will be renderBody = false, renderProperties = true, which will work like the current behavior.
Then you can use renderBody = true, renderProperties = false and you will get the EmptyForm behavior.
And finally renderBody = true, renderProperties = true, a new behavior that will allow you to add new code between the last automagically rendered property (@EditProperties) and the buttons (@ObjectActions).
renderBody = false, renderProperties = false is useless.
ideas? preferences?