How to get first index in ListItemCollectionPosition

Hi Every One
   I have one issue in SPList.ListItemCollectionPosition. it is return second page start index( query). I need to get first page index(query). I am using following code.
int totalItemCount = SPWeb.Lists.TryGetList("ListName").ItemCount;
radListView.VirtualItemCount = totalItemCount;
int startindex = radListView.CurrentPageIndex;
int t = ((RadDataPager)radListView.FindControl(RAD_PAGER_ID)).PageSize;
List<string> qu = new List<string>();
SPQuery query = new SPQuery();
query.RowLimit = Convert.ToUInt32(t);
string pagingData = string.Empty;
SPListItemCollectionPosition poss = null;
while (true)
query.ListItemCollectionPosition = poss;
SPList sp1List = SPWeb.Lists.TryGetList("ListName");
SPListItemCollection lic = SPWeb.Lists.TryGetList("ListName").GetItems(query);
poss = lic.ListItemCollectionPosition;
if (poss != null)
qu.Add(poss.PagingInfo.ToString());
else if (poss == null)
break;
quCount = qu.Count;
startindex = qu.Count <= startindex ? 0 : startindex;
SPListItemCollectionPosition pos = new SPListItemCollectionPosition(qu[startindex]);
thanks
navaratan
Navaratan Sharma

Hi,
Thanks for your sharing, it would be helpful to those who stuck with the similar issue.
Best regards
Patrick Liang
TechNet Community Support

Similar Messages

  • How to get the index of selected values in SelectManyChoice...

    How to get the index of selected values in SelectManyChoice... the value which i get is coming when i submit the value second time

    By using the given code i get the value of the selected indices, but problem here is i get the value when it get submits at the second time... First time the length of that int array is 0.
    Second time it shows the value two times (i.e) First time submitted value and the second time submitted value. After that it works fine.. I have problem while clicking first time only..
    The Following error also raises.. One multiselect is dependent on other multiselect.
    DF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase PROCESS_VALIDATIONS 3
    java.lang.ArrayIndexOutOfBoundsException: 6
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.findObjectFromIndex(FacesCtrlListBinding.java:334)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.getInputValue(FacesCtrlListBinding.java:199)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.internalGet(JUCtrlValueBinding.java:2416)
         at oracle.jbo.uicli.binding.JUCtrlListBinding.internalGet(JUCtrlListBinding.java:3717)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.internalGet(FacesCtrlListBinding.java:500)
         at oracle.adf.model.binding.DCControlBinding.get(DCControlBinding.java:749)
         at javax.el.MapELResolver.getValue(MapELResolver.java:164)
         at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
         at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
         at com.sun.el.parser.AstValue.getValue(Unknown Source)
         at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)

  • How to get all INDEXes from a database

    How to get all INDEXes in a database? I need to store them in script file (.SQL). My database version is 10.2.0.3.0.
    Edited by: Iniyavan on Sep 18, 2009 1:39 PM

    --Thanks, Koppelaars. The second query works. But I'm unable to store in spool file. May be it's due to CLOBs in the output. I did the following:
    set head off
    set feedback off
    set linesize 32727
    set pagesize 50000
    spool c:\indexes.sql
    select dbms_metadata.get_ddl('INDEX',INDEX_NAME,'MYSCHEMA')
    from user_indexes;
    spool off
    --In the spool file, I find only this
    CREATE UNIQUE INDEX "MYSCHEMA"."A" ON "MYSCHEMA"."BNK_DEALID" ("DEAL_ID")
    PCTF
    CREATE INDEX "MYSCHEMA"."ACCENT_RAC_REPORT" ON "MYSCHEMA"."ACCENT" ("SCHEME", "VAL
    CREATE INDEX "MYSCHEMA"."ACCENT_REPORT" ON "MYSCHEMA"."ACCENT" ("SCHEME", "APP_REF
    CREATE UNIQUE INDEX "MYSCHEMA"."ACCENT_X" ON "MYSCHEMA"."ACCENT" ("DEAL_ID")
    P
    CREATE UNIQUE INDEX "MYSCHEMA"."ACCNAV_X" ON "MYSCHEMA"."ACCNAV" ("SCHEME", "ACCNA
    --How to get all the DMLs in one SQL file?
    --Nagappan, I'm using WIN.

  • I'm a MB Pro beginner (after 25 years with PC). I have an Iomega ext HD, but how do get it indexed. I'm trying searches in Finder, and it says "searching Iomega drive" - but I don't think it's indexing. How do I force it to index?

    I'm a MB Pro beginner (after 25 years with PC). I have an Iomega ext HD, but how do get it indexed?, and it doesn't come up with any results I'm trying searches in Finder, and it says "searching Iomega drive" - but I don't think it's indexing. How do I force it to index?

    Well I'm leaning the other way. I think my present MBP will be the last Apple product I buy.
    With the way Apple is going, all New Mac computers are sealed unit that don't allow the user to upgrade them in any way. They are getting more expensive initially. They are impossible to fix, even by Apple. All the parts are either soldered to the Logic Board or glued inside the case parts. The add on warranty only covers manufacturing defects and is expensive. And to fix one out of waranty is close to if not more then a new system.
    The only thing different in a Mac, and most other products Apple sells, is the operating system and the cases they come in. As for the OS both have their glitches and at this time there are no viruses that infect OS X. There is more software available for Windows. More choices as to what hardware you can use or upgrade to at a later date.
    Mac computers are becoming large iPads or iPhones with built in keyboards.
    jeremy_from_rome wrote:
    And as for the question: PC or Mac, the consensus that I hear from colleagues and friends is just as you state it: stay with Mac, be patient, work at it, and you’ll never look back! Thanks again

  • How to get the index of a h:column element?

    Hi!
    I'd like to know how to get the index of a <h:column> element.
    Here is the code of what I'm trying to do:
    <h:column>
         <a:commandLink
              value="#{familyAction.familyDocsByPrj}"
              action="#{homeAction.search(ROW_INDEX)}"
              reRender="rightAppPanel" />
    </h:column>When clicking a row, I'd like to make a "search" depending on the selected row.
    Does anybode know how to do that?
    Thanks a lot :)

    Thanks a lot for all your answers! :)
    I finally got to do something with my little knowledge =P
    I created a new class containing all the data needed for the dataTable (including a "String id").
    And that's what I get:
    <h:column>
         <a:commandLink
              value="#{familyAction.familyDocsByPrj.name}"
              action="#{homeAction.search(familyAction.familydocsByPrj.id)}"
              reRender="rightAppPanel" />
    </h:column>

  • How to get count,index and compare to arraylists

    hi
    how to get count,index and comparing of 2 arraylist.... plz suggest me asap...

    How is your question related to JDBC? And what have you done so far with your code?

  • How to get the index of the word at current cursor position in the word?

    Dear All
    I am implementing a spell checker of my native language in Word. Whenever I run spell checker it start from the first word. How can I make it to start from the current cursor position? How can I get the index of the word at the current cursor position?
    Thanks in advance.
    Dharam Veer Sharma

    hi Dharam Veer Sharma,
    Thanks for sharing the solultion with us.
    It is helpful for others who have the same issue. And if you have any Office developing issue, please feel free to open a new thread.
    Have a nice day.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Is there a way to find out how to get the index of a column?

    Hello,
    I want to know the index of a column for example the column at the first position in a jtable is 0 so how can i get this index?
    for example: the column called "surname" is index 0 but the user can move the column. So the name stays the same but the index of the column changed. I search for a method like
    table.getColumnIndex("surname");

    I think it really depends on what the OP is trying to do. I think the program
    below offers up the possible choices pretty well.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class TableColumnIndexDemo extends JFrame {
         private JTable table;
         private String[] names = new String[]{ "One", "Two", "Three", "Four", "Five" };
         public static void main( String args[] ) {
              SwingUtilities.invokeLater( new Runnable() {
                   public void run() { new TableColumnIndexDemo(); }
         public TableColumnIndexDemo() {
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              DefaultTableModel model = new DefaultTableModel( names, 1 );
              table = new JTable( model );
              JButton button = new JButton( "Print indices" );
              button.addActionListener( new ActionListener() {
                   public void actionPerformed( ActionEvent e ) {
                        printIndices();
              getContentPane().setLayout( new BorderLayout() );
              getContentPane().add( button, BorderLayout.NORTH );
              getContentPane().add( new JScrollPane( table ), BorderLayout.CENTER );
              getContentPane().add( new JLabel( "Move columns around then print indices" ), BorderLayout.SOUTH );
              setSize( 300, 150 );
              setVisible( true );
              printIndices();
         private void printIndices() {
              TableColumnModel columnModel = table.getColumnModel();
              TableModel model = table.getModel();
              StringBuffer sb = new StringBuffer();
              System.out.println( "Visible order");
              for ( int k = 0; k < columnModel.getColumnCount(); k++ ) {
                   if ( k > 0 ) sb.append( ", " );
                   sb.append( k ).append( " " ).append( columnModel.getColumn( k ).getIdentifier() );
              System.out.println( sb );
              sb = new StringBuffer();
              System.out.println( "By name using getColumnIndex(TableModel,name)" );
              for( int k = 0; k < names.length; k++) {
                   if ( k > 0 ) sb.append( ", " );
                   sb.append( getColumnIndex( model, names[k] ) ).append( " " ).append( names[k] );
              System.out.println( sb );
              sb = new StringBuffer();
              System.out.println( "By name using columnModel.getColumnIndex(name)" );
              for( int k = 0; k < names.length; k++) {
                   if ( k > 0 ) sb.append( ", " );
                   sb.append( columnModel.getColumnIndex( names[k] ) ).append( " " ).append( names[k] );
              System.out.println( sb );
              sb = new StringBuffer();
              System.out.println( "Model index by visible order");
              for ( int k = 0; k < columnModel.getColumnCount(); k++ ) {
                   if ( k > 0 ) sb.append( ", " );
                   TableColumn column = columnModel.getColumn( k );
                   sb.append( column.getModelIndex() ).append( " " ).append( column.getIdentifier() );
              System.out.println( sb );
         public static int getColumnIndex(TableModel model, String name) {
             for(int i = 0; i < model.getColumnCount(); i++) {
                 if( model.getColumnName(i).equalsIgnoreCase(name) ) {
                     return i;
             return -1;
    }

  • How to get the index of a Column

    Hello,
    I want to know the index of a column for example the column at the first position in a jtable is 0 so how can i get this index?
    for example: the column called "surname" is index 0 but the user can move the column. So the name stays the same but the index of the column changed. I search for a method like
    table.getColumnIndex("surname");

    So why do you post questions on multiple forums.
    Like I said you are wasting peoples time. We don't know what has been suggested on the other forums. So by answering the question here we are wasting our time because you also probably got the answer on the other forum as well.

  • How to get selectedRow index from TableColumnModel

    Hi Folks, Can anybody suggest me how can i get the selected row index from TableColumnModel. User can add any number of rows to the table , but when user clicks on any row I need to get that Index.
    This is very urgent requirement.
    I'll will be glad if i get quick answer.
    Below is my problem description in detail:
    I'm using 5 column table. Each column is having its own customised editor.
    now when user clicks on add button I'm populating one row in table(which contains 5 columns). In similar fashion user can add n number of rows. Now my question is if user clicks on any row i have to get the selected row index, based on that i have to do some other manipulations.
    I have tried out using ListSelectionModel it works fine . But when I use setter method to set the selected row index it is not able to produce current selected row. Below is the code snippet
    ListSelectionModel selModel = arl.getTableSelectionModel();
              selModel.addListSelectionListener(new ListSelectionListener() {
              public void valueChanged(ListSelectionEvent listSelEvt) {         
              ListSelectionModel mdl = (ListSelectionModel)   listSelEvt.getSource();      
              setSelectedRow(mdl.getMaxSelectionIndex());
    private static int getSelectedRow(){
            return selectedRow;      
        private static void setSelectedRow(int row){
          selectedRow = row;When i call getSelectedRow() it is not giving me the current selected row index.
    Please suggest me the right approach.
    This is very very urgent for me.
    Thanks,
    Joe

    Hi Camickr,
    Actually there are two columns, one is having JComboBox list and other is just JTextField. Now when user selects particular item from JComboBox list then some corresponding value has to be populated in second column. ie second column value should be kept changing depending on the user selection from JComboBox.
    Now the problem is user can add one row (which contain above two columns) and can selects item and clicks on "add" button to add another row and selects some desired item from JComboBox and that corresponding value will be populated in next column. Now that actual problem is if user clicks on first row again to change the item from JComboBox I'm unable to set the corresponding value in its next column. For this reason I'm asking you how can i get the current row?
    Below is the code snippet:
    cbo.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                  //  JComboBox cb = (JComboBox)evt.getSource();                    
                    cbo = (JComboBox)evt.getSource();                                   
                    String item = (String) cbo.getSelectedItem();
                    item = item.trim(); 
                    int row = getSelectedRow();
                    if(getSelectedRow() == -1){              
                        return;
                    String len = (String)mdlListner.getValueAt(getSelectedRow(),mdlListner.LENGTH);                           
                    String dt = (String)mdlListner.getValueAt(getSelectedRow(),mdlListner.DATA_TYPE);               
                    len = len.trim();
                    if(item.equalsIgnoreCase(stringN) ||
                            item.equalsIgnoreCase(charN) ||
                             item.equalsIgnoreCase(binaryN))
                      jftLengthField.setEnabled(true);               
                      if(len.equalsIgnoreCase(notApplicable)){          
                        mdlListner.setValueAt("",getSelectedRow(),mdlListner.LENGTH);                                       
                        jftLengthField.setBorder(null);                   
                    else{
                            mdlListner.setValueAt(notApplicable,
                                        getSelectedRow(),mdlListner.LENGTH);
                            jftLengthField.setEnabled(false);
                    }); Pls suggest me the solution for this.
    Thanks,
    Joe

  • How to get row index of data table in the while ValueChangeListener fired?

    Hi,
    i have a data table in my page, which contains various components like inputText, selectOneChoice in each row.
    i am invoking a method ValueChangeListener attribute of the selectOneChoice component. I have given the autoSubmit=true for this component.
    <tr:selectOneChoice id="ratingModelType"
    value="#{childRatio.ratingModelType}" binding="#{pageManager.form.bindRatioType}"
    valueChangeListener="#{pageManager.form.onRatingModelTypeChange}" autoSubmit="true"
    contentStyle="width:150px" required="#{!childRatio.disableChildRatioRatingModelType}"
    requiredMessageDetail="#{appBundle['error.ratingModelTypeShouldNotBeEmpty']}">
    <f:selectItems value="#{pageManager.catalog['Rating Model Type']}" />
    <tr:selectOneChoice>In that method i want to fetch the map(with all updated values) relevant to the currently modified row of the table.
    Since i am not using the selectionListener or any radio buttons in the page i am not able to get the row index of the table.
    somebody please tell me how to get the row index of the table, while ValueChangeListener fired?
    Thanks in advance.
    Subbu

    Hi niki,
    Thank you so much. With your suggestion i got the result exactly what i want.
    thanks again.
    --subbu                                                                                                                                                                                                                               

  • How to get the index of subform in dynamic Forms??

    We are creating a Dynamic Form in which there is a field "PAN number" in a block. With the Script, we are replicating the blocks. Suppose there are 10 blocks (hence 10 PAN number fields will be there) and if the user wants to enter the PAN number in any of the blocks, how can we get the index of the block on which a value has been entered?

    Are you sure you are using JTree? (I couldn't find a method named getIndex at all!)
    As I couldn't quite understand what you are getting at, one thing that would be helpful is if you refer to "How to use Trees" in The Java Tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

  • How to get first 10 records from the database using JSP

    i want ot get first 10 records from the database and then after clicking the next button in the page,it must show the next precceding 10 records from the database.i am getting the first 10 records .but how to post to the same page to get another preceeding 10 record.

    Search the forums - this has been asked a lot. I usually recommend experimenting with tops and order bys until you're satisfied.
    Kind regards,
      Levi

  • How to get correct index in XD02 BDC

    Hi,
      I’m using XD02 in a BDC pgm to delete multiple e-mail addresses from contact person of a customer based on the details in the spread sheet.
    There can be more than one contact person for a customer,and I’m using KNVK-NAME1 and KNVK-NAMEV to sort all contact person  through an itab to get line index of correct contact person but this index is different from what  BDC  index sequence in SM35. Can some one tell me what’s  the sorting fields that BDC XD02 used for contact person in the hidden code.
    Thanks in advance.
    G.C.

    Hi, Bhaskar :
        Can you tell me more detail of the code? How do I use KNVA-ABALAD in BDC?
    Since I don't know what sequence that BDC going to display so, how can I fill the upload point?
    Thanks,
    G.C.

  • How to get the index of the minimize point

    Need to get the index of the minimize point, marked as red cycle in the attached word file.
    It is a collected data from different sample devices, so the curve may change a bit each time. But the overall profile is the same, just 2 main peaks.
    I tried to detect the Y difference to see when the difference values change from negative to positive.
    But, there are noise as tiny peak when zoom in, shown in word file. Then tried to use median filter to make it smooth. (Maybe better method should be used.)
    But there are still some bigger regional peak. Any suggestion?
    Is there any labview function or better algorithm can make it. Many thanks for your help.
    Solved!
    Go to Solution.
    Attachments:
    Curve shots(zoom in).doc ‏294 KB
    Sample Data 1.vi ‏22 KB
    Sample Data 2.vi ‏16 KB

    A trick I often use is to sample the data with a much higher speed than needed. Then I apply some simple averaging methods or and median filter. After that I downsample the signal to a adequate rate by averaging x samples. This have been a saver for me more than once. How successful it is depends of noise character type. It just a hint as it may not be applicable in your application 
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

Maybe you are looking for