Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • glenatron 37 posts 132 karma points
    Dec 20, 2013 @ 00:38
    glenatron
    0

    Is there any way to access other fields from a custom datatype?

    I have a Custom DataType that I have created using the UserControl wrapper approach, with Umbraco 6.1.6.

    The problem I am having is that my control appears to work, and the data it produces is correctly set as an attribute of the data in the cmsContentXML and cmsPreviewXML tables in SQL Server, but when I actually go to edit the record, the value of the control is not set. As the control is mandatory, this then forbids me from posting it back.

    Running in a debugger it is clear that when I open the editor, the value property of the control is being passed an empty string, which seems divergent from what I can see in the data store. However I don't understand the database internals sufficiently to be able to track through the property records to see whether the XML fields are a direct representation of what is in the data.

    Edit: I think it may be related to the slightly complicated way that this property is set up - currently it is used to create a temporary value which is then changed during a Document_BeforeSave event listener.

    I can probably bypass the need for the listener and do all the work directly in the control if I can pick up some other property values from the document in order to perform that process.

    My question now becomes: Is there a way to access these properties from outside of the control in the code of control somehow? I realise this breaks the modular concept of the controls, but I need these to be separate properties on the document, so I can't bind them all to a single control and for the project I'm working on ( this isn't any kind of general purpose plug-in ) that doesn't matter.

Please Sign in or register to post replies

Write your reply to:

Draft