0
votes

I am using unitegallery within an xpage. here is the code:

<div id="gallery" style="display:none;">
    <xp:repeat rows="100" value="#{javascript:Album.getPictures();}" var="obj" indexVar="idx" disableOutputTag="true" removeRepeat="true">
        <xp:text escape="true">
            <xp:this.value>
                <![CDATA[#{javascript:var db = datasource.getString('DB_FILEPATH');
var id = obj;

var Picture = new org.openntf.bildr.Picture();
Picture.loadByUnid(obj);
var original = Picture.getOriginal();

var pic = "../" + db + "/0/" + id + "/$FILE/" + original;

return '<img src="' + pic + '" data-image="' + pic + '"></img>'}]]></xp:this.value>
        </xp:text>
        <xp:image rendered="false">
            <xp:this.attrs>
                <xp:attr name="data-image">
                    <xp:this.value>
                        <![CDATA[#{javascript:var db = datasource.getString('DB_FILEPATH');
var id = obj;

var Picture = new org.openntf.bildr.Picture();
Picture.loadByUnid(obj);
var original = Picture.getOriginal();

return "../" + db + "/0/" + id + "/$FILE/" + original;}]]>
                    </xp:this.value>
                </xp:attr>
            </xp:this.attrs>
            <xp:this.url>
                <![CDATA[#{javascript:var db = datasource.getString('DB_FILEPATH');
var id = obj;

var Picture = new org.openntf.bildr.Picture();
Picture.loadByUnid(obj);
var thumb = Picture.getThumb();

return "../" + db + "/0/" + id + "/$FILE/" + thumb;}]]>
            </xp:this.url>
        </xp:image>

    </xp:repeat>
</div>
<!--/#gallery -->

(the sample contains an attempt with an xp:image and xp:text control)

This delivers me the images in the gallery, however the rest of the function in my xpages freezes e.g. buttons.

Anyone know a solution for this?

1
<xp:image rendered="false"> - seems that can't get to your browser. only <xp:text> renders as <img> in html. therefore don't expect that <xp:this.url> to work.Frantisek Kossuth
I added two samples, on for the image control and the other for the computed text control. nevertheless switching rendered properties between those two controls still freezes the xpage (and the gallery gets loaded)Patrick Kwinten

1 Answers

0
votes

The problem is related to AMD loading complications in Notes 9. After using the xsnippet from Ferry Kranenburg for AMD loading the problem is gone.