Daniele Grillo
Daniele Grillo

Reputation: 1023

Design Definition custom control how access MultiValue

Hello I have create my custom control with a proprierty definition enter image description here

I read this page Design Definition advanced for customize the design of my custom control.

This is my code (this generate a table with a number of rows how many elements are the proprierty titololink)

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

    <xp:table style="width:100.0px;border-color:rgb(235,235,235);border-style:solid">
        <xp:tr>
            <xp:td style="background-color:rgb(209,241,248)">
                <xp:span
                    style="font-weight:bold;background-color:rgb(184,228,245)">
                </xp:span>
                <xp:span style="font-weight:bold">
                    <%=this.titolo%>
                </xp:span>
                <xp:span style="border-color:rgb(192,192,192)">
                </xp:span>
            </xp:td>
        </xp:tr>
<%for(i=0;i<this.titololink.length;i++){%>
        <xp:tr>
            <xp:td><%this.titololink[i]%></xp:td>
        </xp:tr>
        <%}%>
    </xp:table></xp:view>

The rows is showed in my XPages..but this code this.titololink[i] every row is empty and don't show the content of my proproerties....(I don't understand what is the type)

Have someone any idea?

Tnx a lot

Upvotes: 4

Views: 219

Answers (2)

Daniele Grillo
Daniele Grillo

Reputation: 1023

Hello I have found a solution...

<%var a=eval(""+this.titololink+"");%><%=a[i]%>

With this code work very weel.

Strange but work

Upvotes: 4

David Leedy
David Leedy

Reputation: 3593

I've never tried to get that fancy with design definition. Neat idea though.

In my last NotesIn9 I did some work with a custom control and accessing the properties - even with the multiple instances turned on. So there MIGHT be some helpful information there: http://notesin9.com/index.php/2014/08/10/notesin9-151-bootstrap-progressbars-in-xpages/

I would think the type would be a pure Array.. [] but I'm not sure. honestly I don't know just how fancy you can get with the design definition. According that doc you linked to.. "this" is compositeData... ok. that's interesting... but I wonder if the customProperties is a method of "this". so instead of "this.titlolink..." maybe it's this.param.titololink.. not sure.. but I'd look into that.

My best suggestion is to make a new custom control "shell" with the properties. Get what you want inside that custom control and then paste that XML source into the design definition of the real custom control. See if that works.

Upvotes: 2

Related Questions