Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can get the properties by accessing <em>facesContext</em>:</p> <pre><code>facesContext.getProperty("index.xsp") </code></pre> <p><strong>EDIT:</strong></p> <p>If you set the properties in a custom control, the properties are not added to the view root. The are set as attributes of the custom control (<em>com.ibm.xsp.component.UIIncludeComposite</em>). </p> <p>To access them you first have to give your CC an Id:</p> <pre><code>&lt;xc:ccProp id="myId" /&gt; </code></pre> <p>This allows you to access the custom control like a component with the <em>getComponent()</em> method and retrieve the attribute <em>properties</em> which contains the properties:</p> <pre><code>&lt;xp:label id="labelProperty"&gt; &lt;xp:this.value&gt;&lt;![CDATA[#{javascript: var cc:com.ibm.xsp.component.UIIncludeComposite = getComponent("myId"); var arrList:java.util.ArrayList = cc.getAttributes().get("properties"); arrList.get(0).getName()}]]&gt; &lt;/xp:this.value&gt; &lt;/xp:label&gt; </code></pre> <p><strong>EDIT 2:</strong></p> <p>You can access the CC (which is the parent of the label in this example) this way if you don't want to give your CC an ID:</p> <p><em>Code of the custom control:</em></p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xp:view xmlns:xp="http://www.ibm.com/xsp/core"&gt; &lt;xp:this.properties&gt; &lt;xp:parameter name="param" value="val"&gt;&lt;/xp:parameter&gt; &lt;/xp:this.properties&gt; &lt;xp:label id="label1"&gt; &lt;xp:this.value&gt;&lt;![CDATA[#{javascript: this.parent.getAttributes().get("properties").get(0).getName() }]]&gt;&lt;/xp:this.value&gt; &lt;/xp:label&gt; &lt;xp:label id="label2"&gt; &lt;xp:this.value&gt;&lt;![CDATA[#{javascript: this.parent.getAttributes().get("properties").get(0).getValue() }]]&gt;&lt;/xp:this.value&gt; &lt;/xp:label&gt; &lt;/xp:view&gt; </code></pre> <p>Hope this helps to clarify the issue.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload