[Seasar-user:17504] Re: [Teeda-paging]PagingResultBean<?> pagingResultについいて

thomas [E-MAIL ADDRESS DELETED]
2009年 5月 22日 (金) 18:47:24 JST


Hai,

Here i gave simple sample which uses paging concept.

*partnermasterList.html
*

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<form id="partnermasterListForm">
*<div align="right">
<span id="isNext">
<input type="button" id="doNext"></input>
</span>
<span id="isPrevious">
<input type="button" id="doPrev"></input>
</span>
</div>*
<table border="1" width="100%">
<tr class="heading">
<td><label id="partneremployeecode"/></td>
<td><label id="employeenamekanji"/></td>
<td><label id="employeenamekana"/></td>
<td><label id="company"/></td>
</tr>
<div id="partneremployeemasterItems">
<tr class="item">
<td><span id="partneremployeecode"></span></td>
<td><span id="employeenamekanji"></span></td>
<td><span id="employeenamekana"></span></td>
<td><span id="company"></span></td>
</tr>
</div>

</table>
<div><span id="messages"></span></div>

</form>
</body></html>


*PartnermasterListPage.java*

public class PartnermasterListPage {

    public int partneremployeemasterIndex;
    public PagingResultBean<Partnermaster> partneremployeemasterItems;
    public String partneremployeecode;
    public String employeenamekanji;
    public String employeenamekana;
    public String company;
    public PartnermasterBhv partnermasterBhv;
   * public static int pageNumber;*

    public Class initialize() {
        pageNumber = 1;
        System.out.println("INITIALIZE");
        return null;
    }

    public Class prerender() {
        *System.out.println("pageNumber"+pageNumber);*        //value of
pageNumber is always 1.
        PartnermasterCB partnerCB = partnermasterBhv.newMyConditionBean();
       * partnerCB.paging(1, pageNumber);*
        partneremployeemasterItems = partnermasterBhv.selectPage(partnerCB);
        return null;
    }

    public Class doNext(){
        *pageNumber += 1;*
        return null;
    }

    public Class doPrev(){
       * pageNumber-=1;
        *return null;
    }

    public PagingResultBean<Partnermaster> getPartneremployeemasterItems() {
        return partneremployeemasterItems;
    }

    public void setPartneremployeemasterItems(
            PagingResultBean<Partnermaster> partneremployeemasterItems) {
        this.partneremployeemasterItems = partneremployeemasterItems;
    }

    public boolean isPrevious() {
        return partneremployeemasterItems.isExistPrePage();
    }

    public boolean isNext() {
        return partneremployeemasterItems.isExistNextPage();
    }
}


I want to increase the value of pageNumber by 1 if i click doNext button,and
decrease by 1 if i click doPrevious button.

How can i achieve it?

Thanks,
トマス。


2009/5/22 Koichi Kobayashi <[E-MAIL ADDRESS DELETED]>

> 小林 (koichik) です.
>
> Date:    Fri, 22 May 2009 14:41:05 +0900
> From:    thomas <[E-MAIL ADDRESS DELETED]>
> To:      [E-MAIL ADDRESS DELETED]
> Subject: [Seasar-user:17500] Re: [Teeda-paging]PagingResultBean<?>
> pagingResultについいて
>
> > <?xml version="1.0" encoding="UTF-8"?>
>
> If you want to IE6 to use strict compliance mode
> rather than quirks mode, remove XML declaration.
>
> http://teeda.seasar.org/ja/extension/reference/xhtml.html
>
>
> > <form id="employeemasterListForm"><br/>
> snip
> > *<te:include id="tablePages" te:src="/include/pagingInc.html"/>*     *//
> i
> > included pagingInc.html*
> >
> > </center>
> > </form>
>
> Because pagingInc.html also has a <form> tag,
> rendered html has nested <form> tag, but it is wrong.
> So, move <te:include> tag to the outside of <form> tag.
>
> <form id="employeemasterListForm"><br/>
> snip
> </form>
> *<te:include id="tablePages" te:src="/include/pagingInc.html"/>*     *// i
> included pagingInc.html*
>
>
> >
> >     public int targetPage;
> snip
> >      *   empCB.paging(1, targetPage);*
>
> Who sets the targetPage?
>
> Because your sample code was too big and not complete
> (no one sets the targetPage field), I could not understand
> the problem.
> If you can, make the sample that is a minimum to reproduction.
>
>
> --
> <component name="koichik">
>    <property name="fullName">"Koichi Kobayashi"</property>
>    <property name="email">"[E-MAIL ADDRESS DELETED]"</property>
>    <property name="blog">"http://d.hatena.ne.jp/koichik"</property>
> </component>
>
> _______________________________________________
> Seasar-user mailing list
> [E-MAIL ADDRESS DELETED]
> https://ml.seasar.org/mailman/listinfo/seasar-user
>
-------------- next part --------------
HTMLの添付ファイルを保管しました...
URL: <http://ml.seasar.org/archives/seasar-user/attachments/20090522/6fffbe67/attachment.html>


Seasar-user メーリングリストの案内