none
Custom Field Type - DisplayPattern HTML Encoded by Default? RRS feed

  • Question

  • Hi,
    I am trying to get a Custom Field type (inherited from SPFieldText) to display HTML text. I have the html tags within the DisplayPattern as follows. Could anyone please help? Also could anyone please tell me under what conditions does GetValueByHtml() get fired?

    <RenderPattern Name="DisplayPattern">
    
    <Switch>
    
    <Expr>
    
    <Column/>
    
    </Expr>
    
    <Case Value="0">
    
    <HTML><![CDATA[<img src="_layouts/images/kpipeppers-0.gif" alt="Green" />]]></HTML>
    
    </Case>
    
    <Case Value="1">
    
    <HTML><![CDATA[<img src="_layouts/images/kpipeppers-1.gif" alt="Amber" />]]></HTML>
    
    </Case>
    
    <Case Value="2">
    
    <HTML><![CDATA[<img src="_layouts/images/kpipeppers-2.gif" alt="Red" />]]></HTML>
    
    </Case>
    
    <Default>
    
    <Property Select='.'/>
    
    </Default>
    
    </Switch>
    
    </RenderPattern>
    • Edited by blacks0ul Thursday, May 12, 2011 4:50 PM Formatting
    Thursday, May 12, 2011 4:48 PM

All replies