rendererInfo

<!-- rendererInfo.xsp -->
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
    <table>
        <tr>
            <th>Client ID</th>
            <td><xp:text><xp:this.value><![CDATA[#{javascript:
                var comp = getComponent(compositeData['for']);
                return comp == null ? 'null' : comp.getClientId(facesContext);
            }]]></xp:this.value></xp:text></td>
        </tr>
        <tr>
            <th>Theme Family</th>
            <td><xp:text><xp:this.value><![CDATA[#{javascript:
                var comp = getComponent(compositeData['for']);
                return (comp == null || !(comp instanceof com.ibm.xsp.stylekit.ThemeControl) ) ? 'null' : comp.getStyleKitFamily();
            }]]></xp:this.value></xp:text></td>
        </tr>
        <tr>
            <th>Component Family</th>
            <td><xp:text><xp:this.value><![CDATA[#{javascript:
                var comp = getComponent(compositeData['for']);
                return comp == null ? 'null' : comp.getFamily();
            }]]></xp:this.value></xp:text></td>
        </tr>
        <tr>
            <th>Renderer Type</th>
            <td><xp:text><xp:this.value><![CDATA[#{javascript:
                var comp = getComponent(compositeData['for']);
                return comp == null ? 'null' : comp.getRendererType();
            }]]></xp:this.value></xp:text></td>
        </tr>
        <tr>
            <th>Renderer Class</th>
            <td><xp:text><xp:this.value><![CDATA[#{javascript:
                var comp = getComponent(compositeData['for']);
                var renderer = comp == null ? null : comp.getRenderer(facesContext);
                return renderer != null ? renderer.getWrapped().getClass().getName() : 'N/A'
            }]]></xp:this.value></xp:text></td>
        </tr>
    </table>
</xp:view>

<!-- rendererInfo.xsp-config -->
<?xml version="1.0" encoding="UTF-8"?>
<faces-config>
  <faces-config-extension>
    <namespace-uri>http://www.ibm.com/xsp/custom</namespace-uri>
    <default-prefix>xc</default-prefix>
  </faces-config-extension>
  <composite-component>
    <component-type>rendererInfo</component-type>
    <composite-name>rendererInfo</composite-name>
    <composite-file>/rendererInfo.xsp</composite-file>
    <composite-extension>
      <designer-extension>
        <in-palette>true</in-palette>
      </designer-extension>
    </composite-extension>
    <property>
      <property-name>for</property-name>
      <property-class>string</property-class>
      <property-extension>
        <designer-extension>
          <editor>com.ibm.xsp.extlib.designer.tooling.editor.XPageControlIDEditor</editor>
        </designer-extension>
      </property-extension>
    </property>
  </composite-component>
</faces-config>





Displays pertinent information about a given control's active renderer/theme settings.

XML
Jesse Gallagher
June 1, 2017 10:44 AM
Rating
5

All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.



No comments yetLogin first to comment...