0
votes

what i want to do is If a field has more than 20 values How can i list values in a repeat control with pager component and editBox or computedField.

Only 20 records should be listed for per page. a Pager should help me to show all values page by page..

this field is listed in a dialogBox. here is the my Code below. If someoen did it and it is possible to share it. Appreciate that..

<xe:dialog id="dialogHistory" title="Tarihçe">
    <xp:panel>
        <xp:pager id="pager1" for="repeat1">
            <xp:pagerControl type="First" id="pagerControl1"></xp:pagerControl>
            <xp:pagerControl type="Previous" id="pagerControl2"></xp:pagerControl>
            <xp:pagerControl type="Group" id="pagerControl3"></xp:pagerControl>
            <xp:pagerControl type="Next" id="pagerControl4"></xp:pagerControl>
            <xp:pagerControl type="Last" id="pagerControl5"></xp:pagerControl>
        </xp:pager>
        <xp:repeat id="repeat1" rows="1" first="1" var="col" indexVar="index"> 
            <xp:this.value><![CDATA[#{javascript:var cVal = document1.getValue("history"); return cVal;}]]></xp:this.value>
            <xp:inputText id="inputText1" multipleSeparator="#{javascript:@NewLine();}">
                <xp:this.value><![CDATA[#{javascript:var cVal = document1.getValue("history");
                    return cVal;}]]>
                </xp:this.value>     
            </xp:inputText>
        </xp:repeat>
    </xp:panel>
</xe:dialog>
2
1. Repat Control. then readOnly text field in repeat control. a pager top of them. Pager properties "for = repeatcontrol" I mean repeat and pager are related to each other. - Cumhur Ata
2. 1. Repat Control. in the VALUE field of repeat control i put the value of document.history field. RepeatControl "ROW" properties = "20" then in repeat control. a pager top of them. Pager properties "for = repeat Control" I mean repeat and pager are related to each other. The only think i couldn't is i couldn't seperate value of field 20 by 20 :( - Cumhur Ata
@Cumhur It will be much easier for everyone who wants to help you if you edit your question with your code attempts so far - Florin M.
I cannot put my Code here.. Error message says "It's too long" :( par by part I will put it - Cumhur Ata
Put the code into question please, not into comments - Knut Herrmann

2 Answers

1
votes

The trouble is that you're referring back to the document, not the values of the field in the inputText.

   <xp:repeat id="repeat1" rows="20" var="col" indexVar="index"> 
        <xp:this.value><![CDATA[#{javascript:var cVal = document1.getValue("history"); return cVal;}]]></xp:this.value>
        <xp:inputText id="inputText1" value="#{col}">
        </xp:inputText>
    </xp:repeat>

However, I think this will only display them in inputText. I don't think that it binds them to the field, so I don't think it would allow you to change the values.

0
votes

Exactly according to the code,It is difficult to Point the issue but the same xpage code,If it would help you in any case.

Code:

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

    <xp:this.data>
    <xp:dominoDocument var="document1" formName="testing">
    </xp:dominoDocument>
    </xp:this.data>
    <xp:br></xp:br>
    <xp:repeat id="dateRepeatControl" rows="5" var="r" indexVar="i"
        first="0">
    <xp:this.value><![CDATA[#{javascript:var v:java.util.Vector = new java.util.Vector();
v.add('Date1');v.add('Date2');v.add('Date3');v.add('Date4');v.add('Date5');v.add('Date6');
v.add('Date7');v.add('Date8');v.add('Date9');v.add('Date10');v.add('Date11');v.add('Date12');
;v.add('Date13');v.add('Date14');
return v;}]]></xp:this.value>

        <xp:br></xp:br>
        <xp:div id="checkDiv">
        <xp:text escape="true" id="computedField1"
                value="#{javascript:r}">
        </xp:text>
        </xp:div>
        <xp:br></xp:br>
    </xp:repeat>

    <xp:pager partialRefresh="true" id="pager1"
            for="dateRepeatControl">
            <xp:pagerControl id="pagerControl1" type="First"></xp:pagerControl>
            <xp:pagerControl id="pagerControl2" type="Previous"></xp:pagerControl>
            <xp:pagerControl id="pagerControl3" type="Next"></xp:pagerControl>
            <xp:pagerControl id="pagerControl4" type="Last"></xp:pagerControl>
            <xp:pagerControl id="pagerControl5" type="Separator"></xp:pagerControl>
        </xp:pager>
</xp:view>

This is an xpage having a repeat control with 5 values of a vector to be repeated at one page and pages helps it to go next.You can use this xpage to get the working repeat control with the pager.