Copied to clipboard

Flag this post as spam?

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


  • Laurent Lequenne 16 posts 36 karma points
    Mar 08, 2011 @ 11:38
    Laurent Lequenne
    0

    Getting current field editer with IDataEditor

    Finally I wrote some IDataEditor component with a multi content picker... As the current provided want doesn't work as expected (related to the $currentPage) ! I nearly through but I would like to know what field I'm currently editing. By example I have this XPAth for a field

    $currentPage/ancestor-or-self::* [@level = 2]/descendant::*[fieldTarget='applicationWidgets']/*

    This enables me to select some items where the fieldtarget corresponds to the current field I'm editing.  For now I need to create a DataType for each field in my document type wherre I Specify what field I want to edit.

    I would like to do this automatically with some variable and replacement, as $currentPage, I would like to use $currentField to use within my xpath.

    So the question is simple, how do I get the current field alias I'm editing ? :-)

     Thank you

     

    N.B. :

    Comment For the uComponent guy to get the currentNode : This will save life of thousand peoplle

     

             protected  int   GetCurrentNodeAvailable()

     

             {
                 int  nodeId = -1;
     
                 try 
                 {
                     if  (Node .GetCurrent() != null )
                     {
                         return  Node .getCurrentNodeId();
                     }
                 }
                 catch 
                 {
                     ;
                 }
     
                 try 
                 {
                     nodeId = ((umbraco.cms.businesslogic.datatype.DefaultData )data).NodeId;
                     if  (nodeId > 0) return  nodeId; 
                 }
                 catch 
                 {
                     ;
                 }
     
                 int .TryParse(base .Page.Request.QueryString["id" ], out  nodeId);
     
                 return  nodeId;
             }
     
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

    Continue discussion

Please Sign in or register to post replies