4

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

Daniele Grillo
  • 1,011
  • 4
  • 13
  • 31
  • If it's showing multiple rows, but not displaying the values then maybe you just need to get the values <%this.titololink[i].getValue()%> – David Navarre Aug 13 '14 at 17:28
  • Don't work. I have discovered that the object type is : 'object[Javascript Object]'...I can not understand other – Daniele Grillo Aug 14 '14 at 06:26

2 Answers2

4

Hello I have found a solution...

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

With this code work very weel.

Strange but work

Daniele Grillo
  • 1,011
  • 4
  • 13
  • 31
  • I have been struggling this for the last 3 hours. What a weird solution, but it does work. I hate Design Definition. How did you find the solution Daniele? – Csaba Kiss Feb 18 '18 at 18:57
2

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.

David Leedy
  • 3,583
  • 18
  • 38
  • Hello David, sorry but I don't undestard...in my custom control I access to the values with a simple compositeData.titololink[i] Seem that 'object[Javascript Object]' is the format..but I don't know...is very hard to debug – Daniele Grillo Aug 14 '14 at 07:32