Hi Petr, I am facing a similar problem.
In Vaadin, a field is bound to a property, which can be obtained via the getPropertyDatasource() method (com.vaadin.ui.Field implements Property.Editor extends Property.Viewer which specifies getPropertyDatasource() ). The fields are created via a FieldFactory, and the properties are bound via an instance of info.magnolia.ui.form.field.transformer.Transformer<T> . It's all a bit complicated. My problem at the moment is, given a field, how to obtain at least the JCR name of the property the field maps to. Jan's answer helped me: ((TransformedProperty)field.getPropertyDatasource()).getTransfomer().getBasePropertyName() gets the jcr property name for the field. That's what I needed. @Jan: I think there are cases when this is needed. In particular, when you want to make something interactive happen in a dialog based on the user's actions/inputs. So for me, the use case is that when images are uploaded in the DAM dialog, image metadata (if present) gets imported right into the fields of the DAM dialog. It's working, and pretty slick. When a new image gets uploaded, metadata is read from IPTC or XMP and written right into the dialog for the editor to review. If the editor decides to cancel the upload, JCR is never touched. Regards from Vienna, Richard > -----Ursprüngliche Nachricht----- > Von: [email protected] [mailto:user-list-owner@magnolia- > cms.com] Im Auftrag von Petr Kadlec (via Magnolia Forums) > Gesendet: Mittwoch, 01. Jänner 2014 20:43 > An: Magnolia User List > Betreff: [magnolia-user] Re: How to access storage node in FieldDefinition > > I am sorry, I was talking about definition but I meant Field class of course, > but > that does not change the fact that I can't find equivalent to > getStorageNode() (DialogControlImpl) or any other connection of Field class > with content itself... > > I am sorry if I'm missing something obvious, but I went through api and all > the > magnolia ui fields and facotry classes and didnt find anything on this. > > Thank you > > -- > Context is everything: http://forum.magnolia- > cms.com/forum/thread.html?threadId=a94d6db2-77d4-40df-a09f- > cb0c06205f70 > > > ---------------------------------------------------------------- > For list details, see http://www.magnolia-cms.com/community/mailing- > lists.html > Alternatively, use our forums: http://forum.magnolia-cms.com/ > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- ---------------------------------------------------------------- For list details, see http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
