0
votes

I have made a utility custom control to have a quick, generic view. the custom control has as properties a property names collection which is of type object and received an arraylist of java objects (e.g. a Customer object).

Then on the cc a repeat control is using this:

<xp:repeat id="rptObjects" var="obj" indexVar="idx" value="#{javascript:compositeData.collection}" >

I would like to make the columns more dynamic. So I defined a new property called linkName, also of type object.

The in my repeat control I have setup a div with a xp:link control:

<xp:link escape="true" text="#{javascript:compositeData.linkName}">

However I am struggling on the page that contains this cc to compute the value for the linkName property.

If for example I would like to use the name field on a Customer java object how should I compute the valeu for the linkName property?

1

1 Answers

0
votes

on my cc I set the text for the link:

<xp:link escape="true">
                                    <xp:this.value><![CDATA[#{javascript:return compositeData.pageLink + "?unid=" + obj.unid}]]></xp:this.value>
                                    <xp:this.text><![CDATA[#{javascript:var lbl = compositeData.linkName;
obj[lbl]}]]></xp:this.text>
                                </xp:link>

on my xpage i could set:

<xc:ccUtilsGenericView pageLink="customer.xsp"
                    header="Customers" icon="fa fa-user" linkName="custName">