Tuesday, June 11, 2013

Adding a custom attribute WebCenter menu...

Find the schema section in your menu xml --> ie default-navigation-model.xml

Add a descriptor:
    <descriptor shortLabelKey="TITLE.SHORT_PROMPT_KEY" multivalue="false"
                attributeId="NewAtrr" labelKey="TITLE.PROMPT_KEY"
                endUserVisible="true" searchable="true"
                xmlns="http://xmlns.oracle.com/adf/rcs/catalog"/>

Note: you can change the shortLabelKey and labelKey by adding a resourceBundle="..." but that is another post....

Looks a bit like this:
<schema resourceBundle="oracle.adf.rc.attribute.nls.AttributeBundle"
          xmlns="http://xmlns.oracle.com/adf/rcs/catalog">
    <descriptor shortLabelKey="TITLE.SHORT_PROMPT_KEY" multivalue="false"
                attributeId="Title" labelKey="TITLE.PROMPT_KEY"
                endUserVisible="true" searchable="true"
                xmlns="http://xmlns.oracle.com/adf/rcs/catalog"/>


Your new custom attribute is ready to use.

These attributes are accessible (el and programmaticly)

el : #{node.attributes['NewAtrr']}
programmaticly : node.getAttributes.get("NewAtrr");

No comments:

Post a Comment