Pagination - hibernate with JSF table using ObjectListDataProvider

Hello All,
How we can use the JSF table component & pagination option avilable in JSC for records pagination using ObjectListDataProvider? Let say I have 100 recorsd and I want to do pagination of them of Page Size = 5 (total pages 20), then how to proceed?
We have the hibernate working with JSC, and now I am looking for this advanced implementation using JSC & Hibernate.
Surya
--Thoughts can bring change                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

I have a problem with pagination and hibernate and I want to take a ride on your question: when the page is loaded I load all data from database. Then I have a filter I made that retrieves some of the data and reloads the table, and that works fine. But when I hit the next page button, the table goes to second page, but without the filter, i.e, with all data again.
I think it has someting to do with the place where I do the initial load, with full data. I've put this code in _init:
    private void _init() throws Exception {
        try {
            Integer empresaId = new Integer(this.getSessionBean1().getCodEmpresaLog());
                getSessionBean1().getTituloReceberDataProvider().atualizaListaTitulos(empresaId);
        } catch(Exception ex) {  
            log("Erro para pegar empresas : ", ex);
            error("Erro para pegar empresas : " + ex.getMessage());
    }And to filter, I use this method, called by a button:
getSessionBean1().getTituloReceberDataProvider().filtraListaTitulos(empresaId, sCodCliente, sSituacao, dataDe, dataA);This method repopulates the dataset and it works, but when I change pages it loads full data again. Someone has some light to shed on this?
Thanks in advance!

Similar Messages

  • How to solve problem with JSF table's border (style) ??

    Hi, I would like to create table in JSF like this
                   <table  align="center"
                             width="250"
                             style="border-collapse: collapse; border: 1px black solid;" >
                   <tr>
                        <td align="center"
                             colspan="2"
                             style="border: 1px black solid;">
                             Header A
                        </td>               
                   </tr>
                   <tr>
                        <td> a1 </td>
                        <td> a2 </td>
                   </tr>
                   <tr>
                        <td> b1 </td>
                        <td> b2 </td>
                   </tr>
                   <tr>
                        <td align="center"
                             colspan="2"
                             style="border: 1px black solid;" >                          
                             <BUTTON value="12" > button1 </BUTTON>
                             <BUTTON value="12">  button2 </BUTTON>
                        </td>
                   </tr>
                   </table>I don't know how to create borders like this with JSF's components.
    I know how to create table and collspan, but I have a problem with
    border and style.
    below is example that I creat it, but borders are not OK
    IF ANYONE FIND SOLUTION I WILL BE TANKFUL
    JSF:
    <hx:panelBox id="box1"
               layout="pageDirection"
               bgcolor="silver"
               align="center"
               style="border: 1px red solid;"
               border="0">
              <hx:panelBox id="box2" layout="pageDirection" width="100%" bgcolor="#aec74e" height="100%" align="center" style="border: 1px black solid;">
                   <center>
                        <h:outputText styleClass="outputText" id="text9" value="Prazniki"></h:outputText>
                   </center>                         
              </hx:panelBox>
              <h:panelGrid styleClass="panelGrid" id="grid1" columns="3">
                   <h:outputText styleClass="outputText" id="text4" value="#{msgs.planDan}">
                   </h:outputText>
                   <h:inputText styleClass="inputText" id="text3" value="#{pc_Koledar.praznikBean.dan}">
                   </h:inputText>
                   <f:verbatim></f:verbatim>
                   <h:outputText styleClass="outputText" id="text5" value="#{msgs.planMesec}">
                   </h:outputText>
                   <h:selectOneMenu styleClass="selectOneMenu" id="menu1" value="#{pc_Koledar.praznikBean.selectedMesec}">          
                    <f:selectItems value="#{pc_Koledar.praznikBean.meseci}" />          
                   </h:selectOneMenu>
                   <f:verbatim></f:verbatim>
                   <h:outputText styleClass="outputText" id="text6" value="#{msgs.planLeto}">
                   </h:outputText>
                   <h:inputText styleClass="inputText" id="text2" value="#{pc_Koledar.praznikBean.leto}">
                   </h:inputText>
                   <f:verbatim></f:verbatim>
                   <h:outputText styleClass="outputText" id="text7" value="#{msgs.nazivPraznika}">
                   </h:outputText>
                   <h:inputText styleClass="inputText" id="text1" value="#{pc_Koledar.praznikBean.nazivPraznika}">
                   </h:inputText>
                   <f:verbatim></f:verbatim>
              </h:panelGrid>
              <hx:panelBox id="box3"           
                         align="center"
                         layout="lineDirection"
                         width="100%"
                         style="border: 1px black solid;" bgcolor="#aec74e">
                        <center>
                          <hx:commandExButton type="submit" value="Dodaj" id="button1" action="#{pc_Koledar.doButton1Action}" lang="CP1250">
                          </hx:commandExButton>
                           <hx:commandExButton type="submit" id="button3" action="#{pc_Koledar.doButton3Action}" value="Prika�">
                          </hx:commandExButton>
                        </center>
              </hx:panelBox>
    </hx:panelBox>

    Couldn't you use styleClass or id for CSS?

  • Performance issue with the table use vrkpa

    Hi.
    here is the selection criteria that i am using and the table use vrkpa i only used to map the table kna1 and vbrk.vbrk and kna1 doesnot have the direct primary key relationship.
    please check and let me know wht this vrkpa is taking time and how can i improve the performance as from kna1,i am fetching data very easily while fetching nothing from vrkpa and fetching fkdat from vbrk.
    the idea behind using these tables is just for one kunnr (from kna1)getting the relevant entries based on the fkdat(selection screen input field),please suggest.
        SELECT kunnr
               name1
               land1
               regio
               ktokd
               FROM kna1
               INTO TABLE it_kna1
               FOR ALL ENTRIES IN it_knb1
               WHERE kunnr = it_knb1-kunnr
               AND ktokd = '0003'.
        IF sy-subrc = 0.
          SORT it_kna1 BY kunnr.
          DELETE ADJACENT DUPLICATES FROM it_kna1 COMPARING kunnr.
        ENDIF.
      ENDIF.
      IF NOT it_kna1[] IS INITIAL.
        SELECT kunnr
               vbeln
               FROM vrkpa
               INTO TABLE it_vrkpa
               FOR ALL ENTRIES IN it_kna1
               WHERE kunnr = it_kna1-kunnr.
        IF sy-subrc = 0.
          SORT it_vrkpa BY kunnr vbeln.
        ENDIF.
      ENDIF.
      IF NOT it_vrkpa[] IS INITIAL.
        SELECT vbeln
               kunrg
               fkdat
              kkber
               bukrs
               FROM vbrk
               INTO TABLE it_vbrk
               FOR ALL ENTRIES IN it_vrkpa
               WHERE vbeln = it_vrkpa-vbeln.
        IF sy-subrc = 0.
          DELETE it_vbrk WHERE fkdat NOT IN s_indate.
          DELETE it_vbrk WHERE fkdat NOT IN s_chdate.
          DELETE it_vbrk WHERE bukrs NOT IN s_ccode.
          SORT it_vbrk DESCENDING BY vbeln fkdat.
        ENDIF.
      ENDIF.

    Hi,
    Transaction SE11
    Table VRKPA => Display (not Change)
    Click on "Indexes"
    Click on "Create" (if your system is Basis 7.00, then click on the "Create" drop-down icon and choose "Create extension index")
    Choose a name (up to 3 characterss, start with Z)
    Enter a description for the index
    Enter the field names of the index
    Choose "Save" (prompts for transport request)
    Choose "Activate"
    If after "Activate' the status shows "Index exists in database system <...>", then you have nothing more to dotable is very large the activation will not create the index in the database and the status remains "Index does nor exist". In that case:
    - Transaction SE14
    - Table VRKPA -> Edit
    - Choose "Indexes" and select your new index
    - Choose "Create database index"; mark the option "Background"
    - Wait until the job is finished and check in SE11 that the index now exists in the DB
    You don't have to do anyhting to your program because Oracle should choose the new index automatically. Run a SQL Trace to make sure.
    Rgds,
    Mark

  • Working in a doc with inline tables uses 80% of my CPU

    Hi everyone,
    I'm using Pages 4.0.4, and typing (in table, around table, any where) slows to a crawl when I my document contains inline tables. Using Activity Monitor, I can see my CPU usage jump to 80% when I type in a Pages document with inline tables. It stays at 8% as I type with the very same tables positioned as floating.
    I'm working on a six-page document with four or five tables (one of which is a yearly calender with lots of small columns and rows). There are no other fonts besides Helvetica 12pt, and nothing but alphanumeric characters. I've experienced this slowdown before, but I've always put up with it. Now, it's just driving me crazy!
    I've tried...
    * Validating all my fonts - I found 40-ish minor errors (mostly duplicate font errors), but I didn't know how to fix them.
    * Thinning the tables - I read that thinning inline tables so they don't run margin-to-margin can help. It didn't.
    If I had to guess, I'd say Pages runs layout calculations with each keystroke so objects can flow with the text. Is there a setting or preference I'm missing to do this less often?
    I could float the tables, but every time I change the text above them I have to reposition all of them. I love Pages, and I hate to return to MS Office. However, this slowdown is a deal breaker for me. Any ideas?
    Thanks!
    Jack
    PS - If it helps, I experience the same type of slowdown with Numbers. If the table exceeds several rows by several columns, typing, copying & pasting, etc take forever! I've read that that's because Numbers recalculates the entire sheet with every event, but that seems pretty drastic.

    jstewmc wrote:
    Hi everyone,
    I'm using Pages 4.0.4, and typing (in table, around table, any where) slows to a crawl when I my document contains inline tables. Using Activity Monitor, I can see my CPU usage jump to 80% when I type in a Pages document with inline tables. It stays at 8% as I type with the very same tables positioned as floating.
    I'm working on a six-page document with four or five tables (one of which is a yearly calender with lots of small columns and rows). There are no other fonts besides Helvetica 12pt, and nothing but alphanumeric characters. I've experienced this slowdown before, but I've always put up with it. Now, it's just driving me crazy!
    I've tried...
    * Validating all my fonts - I found 40-ish minor errors (mostly duplicate font errors), but I didn't know how to fix them.
    * Thinning the tables - I read that thinning inline tables so they don't run margin-to-margin can help. It didn't.
    If I had to guess, I'd say Pages runs layout calculations with each keystroke so objects can flow with the text. Is there a setting or preference I'm missing to do this less often?
    I could float the tables, but every time I change the text above them I have to reposition all of them. I love Pages, and I hate to return to MS Office. However, this slowdown is a deal breaker for me. Any ideas?
    Thanks!
    Jack
    PS - If it helps, I experience the same type of slowdown with Numbers. If the table exceeds several rows by several columns, typing, copying & pasting, etc take forever! I've read that that's because Numbers recalculates the entire sheet with every event, but that seems pretty drastic.
    What you describe is perfectly consistent with what you read (I recognized what I wrote).
    If tables are floating, they don't move when the text layer is edited. So they have no impact upon recalculations.
    When they are inline, the app is so dumb that it behave as if it was recalculating from the very beginning which of course, with these embedded items, requires a lot of time.
    AppleWorks designers made a better work on this point but they were old-fashioned ones.
    They offered two interesting features :
    (a) recalculate only what was really needed
    (b) in the Spreadsheet, they gave a menu item allowing us to stop/activate recalculations
    Alas, I'm not sure that iWork designers ever open AppleWorks.
    Yvan KOENIG (VALLAURIS, France) mercredi 23 février 2011 11:04:38

  • Is any one created Table with in table using adv table with VOs without EOs

    If you have created Advnace table Master-Detail (Table with in table), please let me know the Controller code. I am using below. But getting Nullpointer excveption at innerTable.setAttributeValue(VIEW_LINK_NAME,"ViewLink1VL"); Please help me.
    ===========================
    OAWebBean outerTable = (OAWebBean)webBean.findChildRecursive("region2");
    OAWebBean innerTable = (OAWebBean)webBean.findChildRecursive("region4");
    if (outerTable != null)
    outerTable.setAttributeValue(CHILD_VIEW_ATTRIBUTE_NAME,"FLEX_VALUE_X");
    outerTable.setAttributeValue(VIEW_LINK_NAME,"ViewLink1VL");
    if (innerTable != null)
    innerTable.setAttributeValue(CHILD_VIEW_ATTRIBUTE_NAME,"FLEX_VALUE_X");
    innerTable.setAttributeValue(VIEW_LINK_NAME,"ViewLink1VL");
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("initGoodsQuery");
    ============================

    My problem was solved when i used ,"ViewLink1VL1" instead of ,"ViewLink1VL" in controller code.
    thanks.
    Gopi.

  • How to obtain the selected rows in the model with af:Table using selectMany

    Hi ,
    I am using multi select af:Table and it is based on a programmatically populated view. When the table is single select I can use the getCurrentRow at the view implementation. I wonder whether there is a way to get list of selected rows within the view implementation for the multi-select scenario.
    I saw some ways of doing it in the page's backing bean but it will be more appropriate if I could do it at the model project.
    Thanks
    My environment is JDeveloper 10.1.3.3 and jdk 1.4

    Thanks for your reply.
    What you say makes sense. I thought there might be way of setting the selected rows in the model also as we do woth the current row.
    But looks like these two different things.
    Anyway I am doing it by passing the values through the backing bean.
    Thanks

  • Problem with External Table using ORACLE_INTERNAL TYPE in 9i release 2

    Hi,
    I have tried to create an external table in oracle 9i release 2 using the following qurey:
    CREATE TABLE emp_ext
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_INTERNAL
    DEFAULT DIRECTORY admin_dat_dir
    LOCATION(admin_dat_dir:'emp1.dmp')
    PARALLEL
    AS
    SELECT * from employees;
    and getting the following error message
    ORA-30657: operation not supported on external organized table
    Please help me.
    Thanks in Advance

    As a matter of fact oracle 9i has two types of api for external tables one is oracle_loader and the other is oracle_internal which in 10g become oracle_datapump.
    What my question is how can I use the other type in case of external table as we are doing in 10g? Do I need to run any script to enable this feature or is there any privillege issue?
    I've given the read, write privillege to the user and the oracle user has read/write permission in os level on the location of the directory.

  • Need help with JSF table and scrollable pages

    I need help regarding usage of <t:dataTable>
    I have a List on my managed bean. It has 50 records.
    I am displaying the first 10 records and need to implement paging.
    I hear that there is a faces taglibrary called tomahawk which provides a <t:dataTable> and a <t:dataScroller> to implement scrolling.
    Is there a sample implentation that I can take a look at to see how I can solve my problem??
    Any help is highly appreciated.
    Thanks
    Amol

    Check here: http://www.irian.at/myfaces/dataScroller.jsf;jsessionid=F3F50A51583FEEF38D968A4AF5DC949C

  • How to populate a jsf table with an array?

    I have a JSF project where I'm using a table and I would like to populate that table with some custom information without using a database. I'm trying to write my own data provider. I was wondering if anyone knows how to populate a jsf table using an array. Any help would be appreciated. Thanks.

    Hey thanks for replying. I'm not quite sure what you mean, but I am using a woodstock table in Netbeans. I would love to skip writing the data provider since I've never done that before, but I'm not sure how I would go about populating the table with a regular List or Model. I have populated a JTable with my own model, but never a woodstock table. They don't seem to work the same way. Thanks for the help. I've spent hours trying to figure this out.

  • Unable to connect SQL server 2005 databse with JSF applications !

    Hello guys!
    Help me out to connect SQL server 2005 Databse with JSF applications using JDBC-ODBC bridge. I'm working with Netbeans 6.1 IDE.
    I tried for the basic applications but instead got this error:
    "unable to deploy jdbc drivers to the <project>domain/lib"
    Please help me out with working sample codes that connects MS SQL server 2005 DB with JSF!!
    Thank you guys!

    1) don't use the bridge driver
    2) don't do database access from JSF
    3) learn how to use your application server
    4) learn how to use your IDE

  • What is the best approach to handle multiple FK with single table.

    If two tables are joined with each other with more than one ways, for example
    MAIN table is (col1, col2,....coln, person_creator_id, person_modifier_id)
    PERSON table is (person_id, name, address,........ phone) etc
    At database level PERSON_CREATOR_FK and PERSON_MODIFIER_FK are defined.
    Objective is to create a report that shows
    col1, col2...coln, person creator name, person modifier name
    If above two objects are imported with FKs in a EUL and discoverer plus is used to create above report. On first inclusion of person name discoverer plus will ask you to pick the join (provided the checkbox to disable this feature is not checked). Once you pick 'person creator' join it will never allow you to pick person modifier name.
    One solution is two create a custom folder with query like
    select col1, col2,...coln,
    pc.name, pc.address,.... pc.phone
    pm.name, pm.address,.... pm.phone
    from main m,
    person pc,
    person pm
    where m.person_id_creator = pc.person_id
    and m.person_id_modifier = pm.person_id
    Second solution is to import the PERSON folder twice in EUL (optionally named one as perosn_creator and other as person_modifier) and manually define one join per table. i.e. join MAIN with PERSON_CREATOR on person_creator_fk and join MAIN with PERSON_MODIFIER table using person_modifier_fk.
    Now discoverer plus will let you drag Name from each person folder without needing to resolve multiple joins.
    Question is, what approach is better OR is there a better way?
    With solution 1 you will not be able to use functions on folder items.
    With solution 2 there is a EUL design overhead of including same object multiple times and then manually defining all join (or deleting unwanted joins), and this could be a problem when you have person_modifier and person_creator in nearly all tables. It could be more complicated if person table is further linked other tables and users want to see that information too. (for instance, if person address is stored in LOCATION table joined with location_id and user want to see both creator address and modifier address....now you will have to create multiple LOCATION folders).
    A third solution could be to register a function in discoverer that return person name when person_id is passed. This will work perfectly for above requirement but a down side is the report will run slower if they need filters on person names (then function will be used in where clause). Also, this solution is very specific to above scenario, it will not work if you want the report developer the freedom to pick any attribute from person table (lets say, person table contain 50 attributes then its not a good idea to register 50 functions).
    Any comments/suggestion will be appreciated.
    thanks

    Hi
    In a roundabout way you have really answered your own question :-)
    In my opinion, the best approach, although by all means not the only approach - see below) would be to have the object loaded as two folders with one join going to the first folder and the second join to the other folder. You would of course name the folders appropriately.
    Here's a workflow that I use all of the time and one that I teach when I'm giving Discoverer Administrator training. It might help you:
    1. Bring in the PERSON folder to begin with
    2. Make all necessary adjustments to bring it up to deployment standard. These adjustments would be: folder name (E.g PERSON_CREATOR), item names, item placement, default positions, default aggregation and so on.
    3. Create or assign the required lists of values
    4. Create any required calculations
    5. Create any required conditions
    6. Create the first join from this folder to MAIN.
    7. Click on the heading for the folder and press CTRL-C.
    8. Click on the heading for the business area and press CTRL-V. A second copy of the folder, complete with all of the adjustments you made earlier will be inserted into the business area.
    Note: joins are not copied, everything else is.
    9. Rename this folder to say PERSON_MODIFIED
    10. Rename the items as appropriate
    11. Add a join from this folder to MAIN - you're done
    Other ideas that I have used and work well would be to use a database view or create a complex folder. Either will work, In both cases you would need to join on some other column other than the ones you referred earlier.
    I hope this helps
    Best wishes
    Michael

  • ADF Query Panel with Tree Table -- Add Fields

    I created ADF Query Panel with Tree Table using JDeveloper 11G. Under Advance Search, Add Fields pull down only list the fields in the master table. My questions are,
    1) Can I search fields in detail table? If yes, how can I do it?
    2) How can I customized this pull down list? Currently it just show the entire view of master table with unnecessary id type data.
    Thanks in advance.
    Edited by: kxc on Nov 9, 2009 9:21 AM

    1) Can I search fields in detail table? If yes, how can I do it?
    Are there anyway to search the second level node?You can. But you need to evaluate if the arrangement works for you.
    I assume you have a view link from the master to detail VO.
    To do so, in your master view criteria (the one which you use in the query panel), shuttle the attributes of your detail VO (in master attributes list, you'l see the detail view link accessor - on selecting this, the detail atteributes are available to you)
    In the Add Fields, it shows as student_id AND student_name. I was unable to delete the student_id field in the view since it is PKYou can set its 'display' UI hint to 'hide' in your VO.

  • Display Tag use with JSF Data Tables

    Has Anyone got to work the Display tag with JSF
    I have got soo far to display the table by using Display tag with JSF dataTables but unable to have a link or command button to navigate
    Theirs a online hack available for the same .....But i am unable to get to run it
    Has anybody got the solution for the same

    Hi ,
    I am trying to do the same but I have no success.
    My code is
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:jsp="http://java.sun.com/JSP/Page"
         xmlns:c="urn:jsptld:http://java.sun.com/jstl/core"
         xmlns:display="urn:jsptld:http://displaytag.sf.net">
    <jsp:directive.page contentType="text/html; charset=UTF-8" />
    <jsp:directive.page import="fi.tavutaito.hibernate.User,java.util.*,org.displaytag.tags.TableTag" />
         <h:dataTable value="#{sessionScope.users}" var="user" style=""/>
         <display:table name="sessionScope.users" class="" id="user">
              <display:column property="username"/>
              </display:table>
    </html>
    where users is a List Obj in the session. In output I receive just this page.
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="urn:jsptld:http://java.sun.com/jstl/core" xmlns:display="urn:jsptld:http://displaytag.sf.net">
    <jsp:directive.page contentType="text/html; charset=UTF-8"></jsp:directive.page>
    <jsp:directive.page import="fi.tavutaito.hibernate.User,java.util.*,org.displaytag.tags.TableTag"></jsp:directive.page><table style="">
    <tbody>
    <tr>
    </tr>
    <tr>
    </tr>
    </tbody>
    </table>
         <display:table name="sessionScope.users" id="user">
              <display:column property="username"></display:column>
              </display:table>
    </html>
    It seems to that display tags are not parsed...
    Do zou have an idea?
    Thanks a lot in advance
    beppoz

  • Dynamic table with JSF

    Hi, ALL!
    I need to create the dynamic table which should be able to automatically add th e rows after getting command from server without redrawing the whole page.
    Is it possible to do it with JSF ?
    Or I have to use smth else?
    Thank you

    You should use ajax.

  • Any CRUD example starting with Hibernate+MySQL +Tomcat  with JSF  ??

    Hi,
    I am eager to learn Hibernate integrated with JSF and work on it.
    Kindly let me have any CREATE - REMOVE - UPDATE - DELETE example.
    ex. employee , users etc etc...
    If any good material or link to start with this. USING DAO pattern please let me know.
    I need your help.
    Thanks
    Ghanshyam

    Ghanshyam,
    Go to the following URL http://www.jsftutorials.net/
    you will find some good examples there.

Maybe you are looking for

  • Unable to see Remote App and Desktop Connection in Group Policy Management Editor

    I am unable to see the Remote App and Desktop Connection in Group Policy Management Editor on my 2012 R2 DC. I am therefore not able configure the connection URL in Access RemoteApp and desktops in our Windows 8.1 client environment. Within the Group

  • Brand new MacBook Pro 2012 not booting install of Mountain Lion

    Hi, I have a brand new 15" MacBook Pro 2012 model (2.6Ghz, 8GB Ram) - works fine on OS X Lion. As I had just bought it I decided to upgrade it to Mountain Lion straight away, and here's where the problems start. After apparent install the machine re-

  • Exception Condition "Table_not_Exist" raised in query Level.

    Hi, I have a Hirarchy data in my Object level as below X ->   X1      ->-> X001 (Values or at this level) I have created a variable on this object in the query level ( Entry is Optional) and executing the query.then I am getting the error mesage  Exc

  • ERP 2005 and SAP ERP 6.0 are same

    Hi friends, First of all why i have asked ERP 2005 and SAP ERP 6.0 are same or not because i am creating a new system under transaction solution_manager in the solman system for the installation of the EHP4 packs. The problem here is when i create a

  • How do I temporarily delete apps to clear space for travel?

    I have iphone 5 with ios 7. I want to empty my phone of most everything so that I have enough room to take photos and video when I travel. What is the best way to do this and then be able to restore my phone when I return?