0
votes

I would like to compute the ID of a partial refresh target ID. Is this possible?

I am working an a reusable component (custom control) and would like to specify the target ID via the Property Definition instead of hard-coding it.

1

1 Answers

1
votes

You mean something like this?

Code for CustomControl

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">

    <xp:button value="Label" id="button1">
        <xp:eventHandler event="onclick" submit="true"
            refreshMode="partial" refreshId="#{compositeData.refreshId}">
        </xp:eventHandler>
    </xp:button>

</xp:view>

Code for XPage

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
    xmlns:xc="http://www.ibm.com/xsp/custom">

    <xp:label 
        value="#{javascript:java.lang.System.currentTimeMillis()}"
        id="label1" />

    <xc:CC refreshId="#{label1}" />

</xp:view>

The custom property of the CC is a String named refreshId