Getting current index of forEach tag

How do you get the current index of the forEach tag, that is looping through a Vector?
<c:forEach var="rows" items="${myRequestManager.solPORList}">

Yes, use the varStatus attribute:
<c:forEach items="${variables}" var="variable" varStatus="status">
   <c:out value="${status.index}"/>
   <c:out value="${status.count}"/>
</c:forEach>status.index, the current index, starts with 0. status.count, a running count of loop iterations, starts with 1.
Get a JSTL book. Shawn Bayern's "JSTL In Action" is the best, IMO. - MOD

Similar Messages

  • Get Current Index of System Ring

    I need to know the index of the ring box that is currently displayed on the Front Panel during runtime.
    The values of the ring box don't necessarily correspond to their indices so I can't just wire the ring box itself to the DisabledItems[] property.
    The way I am having to get the index of the "currently displayed" item of the ring control is by doing the following:
    A read to the Strings[] Property returns an array of Strings of the "Items" of the ring control.
    A read to the RingtText.Text returns the string value of the current Item displayed in the ring control.
    I use the search function to search the Strings array for the current text and it gives me the index of the current item displayed in the ring control. 
    Is there a way to get the index of the currently shown index of the ring control directly?
    Solved!
    Go to Solution.

    mikeporter wrote:
    Ah, I think I see the issue. The problem is that you can assign non-sequential values to a ring control so index 0 might have a value of 128 but index 1 could have a value of 42 (which in case you forgot is the meaning of life, the universe and everything...). Therefore, the index isn't necessarily the same as the terminal value - though the way most people use them, it often is.
    Mike...
    My favorite use for a ring uses values like 0xFF0000, 0x0000FF, ect....  (Now if the silly items editor was updated I could just drop color constants into value)
    Status changed 3 days ago !! WoooHooo!
    Jeff

  • How to find out the current index

    Hello Experts,
               How to find the current index and whatever we entered in that table how to ratrieved that entry value.pls give the suggest..

    Hi,
    To get current index write below piece of code in the outbound plug for your F4 help pop up.
    We have to write this in the outbound plug itself otherwise it will not work.
    let me know whethere it worked or not
    cl_chtmlb_config_utility=>outbound_plug_event_info( EXPORTING iv_event_string = lv_event_string
                                                          IMPORTING ev_index        = gv_index ).
    Regards,
    Swapna

  • How to get Current Row values in Af:ForEach

    Hi,
    We have a requirement to conditionally Display/Hide CommandLink item in af:forEach Loop.
    <af:forEach items="#{bindings.RegionalAreaPVO.rangeSet}" var="parent">
    <af:spacer height="10" id="s1"/>
    <af:commandLink inlineStyle="font-weight:bold;" text="#{parent.ItemName}" partialSubmit="true" actionListener="#{backingBeanScope.RegionalAreaBean.launchTaskflow}" id="cl1" rendered="*#{backingBeanScope.XXWFCRegionalAreaBean.modelEligibleflag eq true}*">
    <af:setActionListener from="#{parent.Code}" to="#{parentNode}"/>
    </af:commandLink>
    </af:forEach>
    I have added a Cutom Managed Bean Class and Returning boolean value to Control Render property which is working. But now i want to add business Logic based on 'parent.ItemName' or 'parentNode' Values in the bean method to return proper Boolean value.
    But i am unable to get the Current Iteration values in the bean method.
    I am using below EL expressions to get the values. But no luck.
    String nameel = (String)ADFUtil.evaluateEL("#{bindings.parent.ItemName}");
    String codeel = (String)ADFUtil.evaluateEL("#{parent.Code}");
    String nodeEl = (String)ADFUtil.evaluateEL("#{parentNode}");
    Also, i have tried getting the Row object like below but i am getting the First row details always. My intention is to get Current row values and use them for Business logic.
    ViewRowImpl row =
    (ViewRowImpl)ADFUtil.evaluateEL("#{bindings." + VoName +
    "Iterator.currentRow}");
    String code = (String)row.getAttribute("Code");
    Any help is highly appreciated.
    Thanks
    Kaja

    Hi Sascha,
    I have tried that. But in my case the functional logic behind the Rendering is based on more complex logic. Hence i am trying to add a method to return a boolean in Render property of the Link.
    But the real problem for me is, in the Managed bean method i am not finding a way to get the Current Iteration index. If i can get the Current iteration index, i can get the Corresponding Component ID of Command link (In the forEach Loop Component Id's are getting generated Dynamically based on Iteration Index), i can use that and add additional logic and derive true/false to return.
    Any inputs?
    Thanks
    Kaja

  • 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.

  • Get the index of the current line in use

    Dear All,
    Well how can i get the index of the current line in use?
    this the code I am using :
    Dim i As Integer
    Set oBatchForm = SBO_Application.Forms.GetForm(Form_Id, 1)
    Set oMainMatrix = oBatchForm.Items.Item(Matrix_Id).Specific
    For i = 1 To oMainMatrix.VisualRowCount
        If oMainMatrix.IsRowSelected(i) = True Then
           GB_SelRow = i
            Exit For
        End If
    Next
    Exit Sub
    This code is not working when there is a line in the document type texte.
    please advice.

    Hi Mary,
    this is code in C#.NET which is working fine, try to do same in your code:
    for(int irow=1; irow<=oMatrix.RowCount; irow++)
         if(oMatrix.IsRowSelected(irow))
         SelectRow = irow;
                    break;
    Hope it helps.

  • Get index in foreach loop

    Hi,
    I have to iterate a list and get a value from another list. Something like this:
    for (String element: A)
      x.replaceAll(element, B.get(A.indexOf(element)));
    }Is there a another way to get the index we are at?
    JoSE
    ====

    So...the code you have provided iterates though the
    whole collection aswell. It's not better in any way.
    And it may be even slower (depending on the
    implementing class) as it has to call a.get(i) to
    retrieve the object. I like the style of the new for
    better. Where's the problem????It might be slower on a LinkedList (or any other List that doesn't implement RandomAccessList), but in general it will be much faster, because in your code you called .indexOf() which is an expensive operation in allmost all List implementations (I can't think of a default implementation where it's fast right now).

  • Get Current row in Editable ALV

    Hi,
    I have editable alv, when i press "insert row" or "Append row" i need to get current inserted/appended row element reference or index.
    How can i get this??
    Please suggest.

    Hi kranthi ,
    While inserting row you must be selecting a row, you can get the index of the selected row by this following code
    get Index of selected table item
    CALL METHOD NODE_NAME->GET_LEAD_SELECTION_INDEX
    RECEIVING INDEX = Lv_Indx.
    ( DATA: Lv_Indx Type i )
    or while you are appending a row you can use Describe int_table LINES lv_line and use the value of 'lv_line' as the index.
    Regards

  • Get Current year in Query Designer

    Dear all
    I don't know how to determine current year in Query Designer.
    I have a report, i want to see some indexs in bance sheet and income statement in current year and previous year. but, I can only assign with the fixed year (ex, 2010), this is not flexible. I want to get current year on system and calculate previous year.
    Please help me solve this problem
    Thanks

    Hi,
    You can use the SAP Exit variable 0CALYEAR for current year. For Previous year you can offset this by -1.
    You can refer this link for more Information,
    http://help.sap.com/saphelp_bw33/helpdata/en/3f/89533e5ff4d064e10000000a114084/content.htm
    Regards,
    Hari.
    Edited by: Hari Krishnan K on Jul 20, 2010 10:36 AM

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • How to get current PopUp Window

    Dear All,
    I am using NetWeaver 7.1 sp1 and facing a problem. Actually I want to show a view in popup window. The popup window works fine but i want to get currently popup window. How can i get it in View and controller ??
    I found a solution : wdContext.currentPopupElement().getWindowInstacnce();
    but in wdContext there is no method like .currentPopupElement(). plz help.

    Hi
    wdContext.currentPopupElement().getWindowInstacnce();
      Here PopupElement is a attribute of IWDWindow type where u have to put the window instances (say For close or life control of that popup)
    For further plz go through these doc
    1. [Dialog|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/903fed0d-7be4-2a10-cd96-9136707374e1&overridelayout=true]
    2. [Popup Window|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a04870c5-749b-2b10-06ba-d25515ef39e3&overridelayout=true]
    Best Regards
    Satish Kumar

  • How can i get current time of a given timezone

    how can i get current time of a given timezone
    for example: Asia/Hong_Kong
    my code is like this, but the result is not correct.
    what's wrong?
    import java.util.*;
    public class test {
    public static void main(String[] args){
              String s = "Asia/Hong_Kong";
              String tempS = "";
              TimeZone myTime = new SimpleTimeZone(s);
              //TimeZone myTime = TimeZone.getTimeZone(s);
              Calendar myCal = new GregorianCalendar(myTime);
              tempS = myCal.get(Calendar.YEAR)+"-"+
                        (myCal.get(Calendar.MONTH)+"-"+
                        myCal.get(Calendar.DATE)+" "+
                        (myCal.get(Calendar.HOUR)+":"+
                        myCal.get(Calendar.MINUTE)+":"+
                        myCal.get(Calendar.SECOND);
              System.out.println(tempS);
    output is : 2001-7-15 11:16:48
    but the correct time should be: 2001-8-16 7:17:48
    the correct time should be 2001-8-16

    Certain indexes in the Calendar API start at 0 rather then 1, so, when you get the value, you may want to increment.
    I'm not sure why the time is incorrect. You may want to call getAvailableIDs() and make sure that the desired TimeZone ID is supported by your version. I doubt that Sun would have incorrect support for the time zone, but it may not be included, or perhaps it is included with a diffrent ID. You can always create your own time zone as well, by passing the String offset to getTimeZone(), the offset being how many hours beyond or before GMT. Hopefully this helps.

  • How does BR get current date, user, and associate member with Attribute Dim

    I need use Business rules or Calc script to implement following functions:
    1. Get current date and the name of user who is running the BR and save the information to cube.
    I don't find any functions to get current date and users.
    Also, since text and date is store in relational database and essbase cube only stores the index, it looks that the value can't be changed or stored by using "==" directly, is there any function to change value of members with Text or Date types in BR/Calc script?
    2. End users select attribute value (via smart list) of products or projects(Sparse dimensions) in data form, run BR to update the association of these members with attribute dimension.
    I don't find any functions to change the attribute association in BR/Calc, is there any CDF (Custom Defined Function) that can do it?
    Thanks!

    Hi,
    For the date functionality, check out the post below.
    Re: Days behaviour between two dates
    As for the username, there is a little tricky way that requires an unused or a new dimension along with a smart list of user names. It's also possible to capture the user name from the cookies and pass it on to the form. The latter is possible through validatedata.js however requires hefty coding here and there.
    As for the attributes, it's not possible to update metadata through business rule. So no luck in there.
    Cheers,
    Alp

  • Using ViewObject with a foreach tag in a jsp

    Hi guys I have the following scenario:
    1- I call a certain .jsp page
    2- a controller class (extends servlet) is called, this class: takes a view object, executes it's query, forwards the result to the jsp page.
    3- jsp page has a foreach tag that iterates over the query result.
    My problem is that foreach tag only takes list or array in its "items" attribute.
    Now is there a way to put the view object result in an array/list? in other words in my servlet what should I put in the request so that the foreach tag can iterate over the rows of the query. Thank you in advance for the reply.

    Thank you for the reply.
    But my application is not a web based one.
    I am developing a framework (as swf) in which some other swf files (target files) are played as movie clip. Since the framework swf should be considered as a general one, no direct linking to the other swfs preferred. I follow some (my own) rules to get things worked. For example, I need to show a simple movie cilp as the title in the framework. This movie clip will be different in different target swfs, and they will be stored inside the target swfs itself. I was thinking about giving them a unique id (eg. title_id) and after loading the target swfs, show their titles (movie clips) in one of the framework's empty movie clip (using attachMovie).
    Could please suggest me any idea to get things work?

  • 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

Maybe you are looking for

  • Creating Condition Table.. Key fields and line items

    dear all I am creating a Condition table and have 6 fields, I want to make 5 of them as key fields and also header line fields. I want my 6th field as line item field but I am unable to do that. My last key field is also shoiwing in line item. Please

  • Conversion of DATS to DEC in transfer rule

    Dear all, I have a requirement to Activate mapping field in Infosource - transfer rule. I have to map ZDATE (datatype - DEC) with ZOLDDATE (Datatype - DATS). I know it can be directly mapped so DATS field will be automatically converted to DEC like b

  • Sorting without reloading the page

    Hi, I'd like to know how processing several sorting operations without reloading and ask the database each time the sorting of the elements is made. For that I guess a copy of the result tree obtained by the sql query, written in the xsql page, must

  • WD ABAP : EMBED Internet PAGE Web on WebDynpro

    Hi Experts, how can i embed an Internet Page (for exemple GOOGLE.COM) on my WebDynpro ABAP Application ... In order, i developped this code : data api_component  type ref to if_wd_component.   data window_manager type ref to if_wd_window_manager.   d

  • ERROR LOG IN XLS

    I Had run a BDC in session method through SM35. I need to download the error log generated in XLS file or any other format. Is there any method in SM35 to get it download?