Troublesome iterator

Can anyone debug this block of code for me? I have a list os System objects registered to a Shop object & held in an Array. I'm sending a message to them via the Shop object to display a list of Systems with a system price less than or equal to the message parameter (an integer). Code is as follows:
public final void systemsByPrice(int price) {   
// of all the systems registered with the shop
// DO list systems with a price less than or
// equal to the method parameter
int queryPrice=price;
Iterator iter=theSystems.iterator();
while(iter.hasNext()) {
System sys=(System)iter.next();
int sysPrice=sys.getPrice();
if(sysPrice<=queryPrice); {
sys.display();
problem is its only displaying the system with the highest price regardless of the parameter supplied.

if(sysPrice<=queryPrice); {
sys.display();
You have an extra semicolon in there, try making it
if(sysPrice<=queryPrice) {
sys.display();
}Thanks Mossi, that was the problem. Fixed it and its working fine now. I couldn't understand what was wrong because the logic seemed ok and the compiler didn't complain. Even staring at it for 10mins didn't work either despite the fact I know the semi-colon doesn't belong there. Ah well, practice makes perfect.

Similar Messages

  • Query update on each iteration problem (MS SQL Sever / ODBC / Native Driver

    Hello,
    I�ve been working to learn some Java and now JDBC over the past 10 or so months.
    I think I have a general understanding of how to perform queries and work with data using JDBC. However, I�ve run into a problem. I�m trying to do a query of a set of data in a database based on the value of a status column. I want to loop over the messages and perform various functions with the data then update their status in the database. It�s preferable to do these 250 to 1000 rows at a time, but no more and no less.
    I�m connecting to MS SQL Server 2000, currently with ODBC. I�ve also tried it with the Java SQL Server 2000 drivers provided by Microsoft with the same results.
    I�ve found that I can do a one table query and loop though it with a while (rs.next()) {�} and run an Update statement with executeUpdate on each iteration without any problems, no matter the number of rows returned in query.
    I have not been able to use the updateString and updateRow inside the while loop. I keep getting errors like this at the line with the updateRow():
    Exception in thread "main" java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Row update failed.
    This occurs no mater how many rows I select, 1 or more.
    The real problem I�ve been having is that the query I need to loop though joins across several tables and returns some rows from some of those tables. This only seems to work when I query for 38 or less selected rows and I use an Update statement with executeUpdate on each iteration. The updateString and updateRow methods never work. Any number of rows selected greater than 38 causes a deadlock where the Update is waiting for the select to compete on the server and the Update can�t proceed until the Select is complete.
    As I stated above I�ve tried both ODBC and the native SQL Server driver with the same results. I have not tried any other databases, but that�s moot as my data is already in MS SQL.
    Questions:
    How can I avoid or get around this 38 row limit without selecting each row, one at a time?
    What am I doing wrong with the updateString and updateRow?
    Is there a better approach that anyone can suggest?
    Here�s some sample code with the problem:
    import java.sql.*;
    public class db1{
         public static void main(String[] args) throws Exception{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              String url = "jdbc:odbc:eBrochure_live";
              Connection con = DriverManager.getConnection(url, "sa", "d3v3l0p");
              Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
              Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://dcm613u2\\dcm613u2_dev:1433", "sa", "d3v3l0p");
              Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
              Statement stmt2 = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
              stmt.executeUpdate("USE [myDatabase]");
              stmt2.executeUpdate("USE [myDatabase]");
              String qGetMessages = "SELECT TOP 250 t1.messageUUID, t1.subjectHeader, t2.emailAddress as toAddress " +
              "FROM APP_Messages as t1 JOIN APP_addressBook_contacts as t2 " +
              "     On t1.toContactID = t2.contactID " +
              "WHERE t1.statusID = 'queued'";
              ResultSet rs = stmt.executeQuery(qGetMessages);
              while (rs.next()) {
                   String messageUUID = rs.getString("messageUUID");
                   String subjectHeader = rs.getString("subjectHeader");
                   System.out.println(messageUUID + " " + subjectHeader);
                   String updateString = "UPDATE APP_Messages " +
                        "SET statusID = 'sent' " +
                        "WHERE messageUUID = '" + messageUUID + "' ";
                   stmt2.executeUpdate(updateString);
              con.close();
    Thanks for the help,
    Doug Hughes

    // sorry, ps.close() should be outside of if condition
    String sql = "UPDATE APP_Messages SET statusID = 'sent' WHERE messageUUID = ?";
    Statement statement = con.createStatement();
    PreparedStatement ps = con.prepareStatement(sql);
    ResultSet rs = statement.executeQuery("your select SQL");
    if ( rs.next() )
    ps.clearParameters();
    ps.setString(1, rs.getString("your column name"));
    ps.executeUpdate();
    ps.close();
    rs.close();
    statement.close();

  • Not able to update data in iterator

    Our scenario is something like this:
    We do not directly bind UI components to VO, that is, for example we do not directly drag and drop a VO as a table. Instead we use POJO to exchange data between the UI and model layers.
    Our requirement is to show form with pagination. If there are 5 records we show each record in form layout with navigation keys to show next, previous, first and lat records.
    Since we do not bind the data directly to VO, the form data is coming from pojo. Our implementation is as below
    A java class named personPojo with fields
    fname
    lname
    code
    A method getAllPersons which queries all the person records from db table, populates it in a list<personPojo> and returns this list.
    We are using an iterator which is based on this List<personPojo> that is returned from the method. Inside this iterator we have a panelFormLlayout with input components mapped to the pojo fields as below
    <af:iterator value="sampleBackingBean.getAllPersons" var="row"
                   id="i4">
              <af:inputText value="#{row.fname}" id="it6">
    <af:inputText value="#{row.lname}" id="it7">
    <af:inputText value="#{row.code}" id="it8">
         </af:iterator>
    The problem we are facing is, when we update the fields in the form, the data is not getting stored in the field of the pojo. That is, if currently 3rd record/element is shown from the list and we update name to "John". Then click on next button to go to next record and update name to "Smith". Now on clicking previous, we should be able to see the name "John", instead in our case no data is shown. But, if we hard code the data in the list, then the list shows the data properly. The issue is when we update it does not show the updated value as it is not getting set in the pojo. We have made sure the pagination works fine, that is clicking next or previous is correctly showing the records
    Can you please let us know what we may be missing here or if you have any other suggestions to implement a form with pagination

    hi,
    Hope following useful
    http://docs.oracle.com/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_iterator.html
    http://blogs.oracle.com/shay/entry/working_with_the_afiterator_co

  • What is difference between Iterator and Collection Wrapper?

    Hi all,
                  I dont understand the actual difference between Iterator and Collection Wrapper. I observed both are used for the same purpose. Could any one please let me know when to use Collection Wrapper and when to use Iterator??
    Thanks,
    Chinnu.

    L_Kiryl is right.
    Collections support global iteration (through collection->get_next( )) and local iteration (through iterator->get_next( )).
    Each collection has a focus object. Initially, the first object has the focus.
    Any global iteration moves the focus, which is published by the event FOCUS_CHANGED of the collection.
    If you want to iterate on the collection without moving the focus (and without triggering timeconsuming follow-up processes) you can use local iteration. To do so, request an iterator object from the collection and use this to iterate.
    And one more advantage of using iterator: it takes care of deleted entities. If you use global iteration then when you reach deleted entity it will be an exception. But there is no exception with iterator in the same situation.

  • InputText value is not getting updated in Iterator

    Hi All,
    We are using jdeveloper 11.1.1.5.
    I have having 2 bounded taskflows TF1 and TF2. In TF1 I am having Page1.jspx and in
    TF 2 I have Page2.jspx.
    I am having 1 page fragment Frag1.jsff inside that I am having 1 textbox and a button. Text box is binded to the iterator "iter1".
    In Page1.jspx I have added fragment as a region and also I have added the iterator "iter1" in the bindings of page1.jspx
    On page load I am getting the value in the text box after that I am updating the text
    box value and on click of button I am trying to get the text box value using
    following methods.
    (1) Finding the Iterator getting the row and then finding the value as
    Row.getAttribute("Name");
    DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("IName of the Iterator");
    Row row = dciter.getRowAtRangeIndex(0);
    row.getAttribute("Name of the attribute);
    (2) Finding the RichSelectOneChoice component and then getting value
    RichSelectOneChoice textbox= jsfUtils.findComponentInRoot("ID of the component");
    textbox.getValue();
    (3) Using the page definition attribute as :-
    +jsfUtils.resolveExpression("#{data.PageDefName.inputtextname.inputValue}");+
    Every time I am getting null value. Is there anything I am missing here.
    When I applied autosubmit="true" property on the textbox I am getting value from the
    1st method.
    *Question 1 : - Is it necessary to use autosubmit property on the text box for the values to get updated in Iterator ?*
    *Question 2 : - Why I am not able to find the value using 2nd method ?*
    *Question 3 : - Is there anything wrong in getting value from page definition using 3rd method?*
    Now When on click on button on page1 on some condition, I am navigating it to page2
    and there is a button on page2 which invokes the TaskFlow return activity and so
    returning back to TF1.
    Now again I am clicking on the button on page1 but this time again I am getting value
    of the textbox as null using all the methods :(
    I have checked various post and tried putting *changeEvent="ppr"* in ur pageDef
    against the respective VO entry but still after returning back from TF2 to TF1 values
    are lost in the Iterator.
    I tried sharing data control with calling taskflow but still I am not getting the
    updated values.
    Please suggest.
    Thanks in advance.
    --NavinK

    Hi Suresh,
    I already have autoSubmit=true for input text and partialSubmit=true for button but still getting the same error.
    --Navin K                                                                                                                                                                                                                                                                                       

  • Displaying the results of an iterator in JTextfields.

    Hi people,
    I have got two methods which basically iterate through statements (forward and back).
    However I have a separate class which is basically the GUI for my program. I want the user to be able to click the next button and it iterates through the list and displays the element in the list in the JTextField.
    The problem I am having is that it will not display the element in the predefined fields, does anyone know how I can go about this? My code for my two methods is below:
    public void MusicNext()
               try
               if(titerator==null)
                   titerator = iList.listIterator();
               if(titerator.hasNext())
                   System.out.println(titerator.next());//Just prints out the iterator atm.
               else
                  titerator = null;
                  MusicNext();
               catch(ConcurrentModificationException ex)
                  titerator = iList.listIterator();
                  System.out.println("Iterator has been reset.");
              public Music MusicNext(String pTitle)
                Music tTitle = null;
             boolean found = false;
                Iterator it = iList.iterator();
                if(it.hasNext() && !found)
              tTitle = (Music) it.next();
              found = tTitle.getTitle().equalsIgnoreCase(pTitle);
                return tTitle;
            public void MusicPrevious()
               try
               if(titerator==null)
                   titerator = iList.listIterator();
               if(titerator.hasPrevious())
                   System.out.println(titerator.previous());//Just prints out the iterator atm.
               else
                  titerator = null;
               catch(ConcurrentModificationException ex)
                  titerator = iList.listIterator();
                  System.out.println("Iterator has been reset.");
               catch(NoSuchElementException ex)
                  //titerator = iList.listIterator();
                  System.out.println("No such element.");
         }I am pretty sure they shouldn't be void but should return an element, but I am really not sure what to return.
    Many Thanks,
    Rob.
    (Sorry I posted this before but I left out alot of detail).

    Don't get or instantiate the iterator in often-called methods.
    It should be get or instantiated as a class global field once and for all.
    Your ListIterator is good for such treatment becuase it can be
    freely scanned backward, while Iterator can't.

  • How to pick max value from a column of a table using cursor and iteration

    Hello Everybody
    I have a table loan_detail
    and a column in it loan_amount
    now i want to pick values from this table using cursor and then by using iteration i want to pick max value from it using that cursor
    here is my table
    LOAN_AMOUNT
    100
    200
    300
    400
    500
    5600
    700i was able to do it using simple loop concepts but when i was trying to do this by using cursor i was not able to do it .
    Regards
    Peeyush

    SQL> SELECT MAX(sal) Highest_Sal,MIN(sal) Lowest_Sal FROM emp;
    HIGHEST_SAL LOWEST_SAL
           5000        800
    SQL> set serverout on
    SQL> DECLARE
      2    TYPE tmp_tbl IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
      3    sal_tbl tmp_tbl;
      4    CURSOR emp_sal IS
      5      SELECT sal FROM emp;
      6    counter INTEGER := 1;
      7  BEGIN
      8    FOR i IN emp_sal LOOP
      9      sal_tbl(i.sal) := counter;
    10      counter := counter + 1;
    11    END LOOP;
    12    DBMS_OUTPUT.put_line('Lowest SAL:' || sal_tbl.FIRST);
    13    DBMS_OUTPUT.put_line('Highest SAL:' || sal_tbl.LAST);
    14  END;
    15  /
    Lowest SAL:800
    Highest SAL:5000
    PL/SQL procedure successfully completed.
    SQL> Even smaller
    SQL> DECLARE
      2    TYPE tmp_tbl IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
      3    sal_tbl tmp_tbl;
      4    CURSOR emp_sal IS
      5      SELECT sal FROM emp;
      6    counter INTEGER := 1;
      7  BEGIN
      8    FOR i IN emp_sal LOOP
      9      sal_tbl(i.sal) := 1;
    10    END LOOP;
    11    DBMS_OUTPUT.put_line('Lowest SAL:' || sal_tbl.FIRST);
    12    DBMS_OUTPUT.put_line('Highest SAL:' || sal_tbl.LAST);
    13  END;
    14  /
    Lowest SAL:800
    Highest SAL:5000
    PL/SQL procedure successfully completed.
    SQL> Edited by: Saubhik on Jan 5, 2011 4:41 PM

  • Removing duplicate values from selectOneChoice bound to List Iterator

    I'm trying to remove duplicate values from a selectOneChoice that i have. The component binds back to a List Iterator on the pageDefinition.
    I have a table on a JSF page with 5 columns; the table is bound to a method iterator on the pageDef. Then above the table, there are 5 separate selectOneChoice components each one of which is bound to the result set of the table's iterator. So this means that each selectOneChoice only contains vales corresponding to the columns in the table which it represents.
    The selectOneChoice components are part of a search facility and allow the user to select values from them and restrict the results that are returned. The concept is fine and i works. However if i have repeating values in the selectOneChoice (which is inevitable given its bound to the table column result set), then i need to remove them. I can remove null values or empty strings using expression language in the rendered attribute as shown:
    <af:forEach var="item"
    items="#{bindings.XXXX.items}">
    <af:selectItem label="#{item.label}" value="#{item.label}"
    rendered="#{item.label != ''}"/>
    </af:forEach>
    But i dont know how i can remove duplicate values easily. I know i can programatically do it in a backing bean etc.... but i want to know if there is perhaps some EL that might do it or another setting that ADF gives which can overcome this.
    Any help would be appreciated.
    Kind Regards

    Hi,
    It'll be little difficult removing duplicates and keeping the context as it is with exixting standard functions. Removing duplicates irrespective of context changes, we can do with available functions. Please try with this UDF code which may help you...
    source>sort>UDF-->Target
    execution type of UDF is Allvalues of a context.
    public void UDF(String[] var1, ResultList result, Container container) throws StreamTransformationException{
    ArrayList aList = new ArrayList();
    aList.add(var1(0));
    result.addValue(var1(0));
    for(int i=1; i<var1.length; i++){
    if(aList.contains(var1(i)))
         continue;
    else{
    aList.add(var1(i));
    result.addValue(var1(i));
    Regards,
    Priyanka

  • Write to measurement file at every n iterations

    Hi guys,
    I would like some help with saving data in labview 2010 SP1 (base development system). I am using a "Write to measurement fil express VI" inside a while loop and the data out from the DAQmn Read is wired to the signal in of the "Write to measurement fil express VI".
    The way I have wired it is the VI saves the data as a text file after it has recorded 100 samples (the nuber of samples to read in this case was set to 100). I would like to know if there is a way to control the rate at which the express VI saves the data. As in, I want the express VI to save the data at specified time interval or at every nth iteration. I have attached the main VI and its 2 sub-VIs for reference. Please let know if anyone can help me resolve this issue. Thank you for your time and inputs in this regard.
    Raj

    Robert,
    First, you must understand that the above code resides inside a loop. The blue square i terminal is known as the iteration terminal. It provides the current loop iteration count, starting from zero.
    The first input (x) to the Quotient & Remainder Function comes from this iteration count (i) terminal of the loop.
    The second input (y) to the Quotient & Remainder Function comes from the control N.
    We wish to write to the measurement file every N iterations of the loop. If we take our current iteration count (i) and divide by our desired N, every Nth iteration of the loop, the remainder will be zero. For all other iterations, the remainder will be non-zero.
    That being said, we check the remainder and compare it to zero. If it is zero, we will send a True value to the Enable terminal on the Write To Measurement File Express VI. Any time a True value is sent, we will write to file. Anytime a False value is sent, nothing will be written to the file.
    The green new_file input on the Write To Measurement File Express VI is used when the "Save to series of files (multiple files)" radio button is selected in the Configure dialog box of this Express VI. When "Save to one file" is selected, this option does not apply, and so it is not included in the input list, which is why you are not seeing this.
    This new_file input is used to tell the Write To Measurement File Express VI when to start writing to a new file.
     

  • Af:iterator and getting values from a particular row

    Hi,
    I am using af:iterator to loop through a resultSet in a VO.
    <af:iterator binding="#{backingBeanScope.backing_subscribe.i1}"
    value="#{bindings.SubscriptionPublicView1.collectionModel}"
    var = "row"
    id="i1">
    For each iteration, I display a row of data from my VO in a panel box.
    Each panel box has a command Link.
    Usually, from my backing bean, I do something like this to get an attribute off of a view Iterator.
    Row currentRow = getIterator("SubscriptionPublicView1Iterator").getCurrentRow();
    int sid = (Integer)currentRow.getAttribute("Sid");
    However, in this case, I am always getting the 'sid' from the first record in the collectionModel, and not the 'sid' that corresponds to the commandLink that is selected by the user.
    What is the best way to do this when using an af:iterator?
    Thanks,
    Joel

    Hi,
    Timo - as usual - is correct. Using an iterator does not guarantee that selecting a row is set as current in the ADF binding. For this you need to use an action listener on the command component you click on. To get the rowKey of the selected row, you can use a setPropertyListener on the command link that writes the row key of the selected item into memory
    <af:setPropertyListener from="#{row.key} to="#{viewScope.key}" type="action"/>
    This value then can be looked up in the managed bean to set the row as current in the ADF binding
    Frank

  • How to get iterator values from a managed bean ?

    Due to a bug in selectOneChoice i'm not able to get the label list i want to display directly from an iterator when the value binding is a managed bean.
    To solve the problem i would like to create a managed bean that contains that list and use it as the selectItems to display.
    I would like that the values in that managed bean loaded from the a data control iterator.
    My question is :
    1) is it possible to access the iterator values from a managed bean, i mean without any reference to a page definition
    2) how to do ? is it documented somewhere ? any example ?
    Thank you

    I got it also with this code:
    package view.managedBeans;
    import classification.bean.ClassificationDocument;
    import classification.castor.ClassificationLanguage;
    import java.io.FileNotFoundException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Hashtable;
    import java.util.List;
    import java.util.Locale;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.generic.DCGenericDataControl;
    import org.exolab.castor.xml.MarshalException;
    import org.exolab.castor.xml.ValidationException;
    public class ClassificationLanguageList {
    private java.util.List<SelectItem> supportedLanguages = new ArrayList();
    public ClassificationLanguageList() throws FileNotFoundException,
    MarshalException,
    ValidationException {
    FacesContext ctx = FacesContext.getCurrentInstance();
    ValueBinding vb = ctx.getApplication().createValueBinding("#{data.ClassificationDocumentDataControl}");
    DCGenericDataControl classificationDocumentDataControl = (DCGenericDataControl)vb.getValue(ctx);
    ClassificationDocument classificationDocument = (ClassificationDocument)classificationDocumentDataControl.getDataProvider();
    ClassificationLanguage[] classificationLanguage = classificationDocument.getClassification().getClassificationLanguageList().getClassificationLanguage();
    for (int counter = 1; counter < classificationLanguage.length; counter++) {
    SelectItem language = new SelectItem();
    language.setValue(classificationLanguage[counter].getClassificationLanguageCode());
    language.setLabel(classificationLanguage[counter].getClassificationLanguageLabel());
    supportedLanguages.add(language);
    public void setSupportedLanguages(java.util.List<SelectItem> supportedLanguages) {
    this.supportedLanguages = supportedLanguages;
    public java.util.List<SelectItem> getSupportedLanguages() {
    return supportedLanguages;
    }

  • New version 9.0.1 on Windows 7 has a problem running JavaScript math iterations.

    Dialog Error Box reads:
    A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
    Script: http://www.classictesla.com/java/javatc/script/JTC_geotc.js:1299
    The above dialog has never come up before. This program ran fine forever and has not changed. With Firefox 8, the program ran in 0.3 seconds. IMMEDIATELY as I allowed the browser to upgrade to 9.0.1, the program is now not working.
    About 1000 people use this program. Knowing how slow fixes can be, I have to inform them not to allow FF to upgrade to version 9. Really sucks as I've been a FF fan forever.
    If you go to that website, click the "Load Sample Coil" button, then scroll down and click the RUN JAVATC button, you'll see the problem
    If there is a problem with the script, why only now after so many years of running? I can run it just fine on version 8. If there's something I can do on my end, I would love to (just tell me what the problem is).
    My guess = "version 9 is limiting the number of iterations a script can run". This code use to run in 0.3 seconds and now is just hung. A very sad day for me. I guess I have to figure out how to go back to old version 8.

    Only Firefox 9 seems to have that problem. Firefox 8 and Firefox 10 (beta) and later work. It helps a bit if I disable javascript.options.methodjit.content, but then it still takes 4 seconds compared to 0.2 or 0.3 seconds with the other Firefox versions. So that looks like a bug with the JIT compiler.

  • Problem with iterator in tableview

    Hi, Im having a problem with an iterator in a tableview. Sometime ago I use an iterator in a BSP with flow logic, I created the class fill the methods GET_COLUMN_DEFINITIONS and RENDER_CELL_START. And worked fine.
    Now, Im working in another BSP and this time I wanted to use MVC, so I have been reading but cant figure it out what Im missing out.
    In the controller of my page I add the Interface IF_HTMLB_TABLEVIEW_ITERATOR
    I ridefine the methods GET_COLUMN_DEFINITIONS and RENDER_CELL_START (I think that you dont have to redifine GET_COLUMN_DEFINITIONS but did it anyway just in case).
    This is my RENDER_CELL_START
      IF NOT ( p_column_key = 'ICON' ).
        RETURN.
      ENDIF.
      FIELD-SYMBOLS: <row> TYPE ANY, <col> TYPE ANY.
      DATA: ti_results TYPE ZBSPREP_VEND_T,
                 wa_results TYPE ZBSPREP_VEND.
      ASSIGN p_row_data_ref->* TO <row>.
      ASSIGN COMPONENT p_column_key OF STRUCTURE <row> TO <col>.
      wa_results = <col>.
      DATA: html_bee TYPE REF TO CL_BSP_BEE_HTML.
      CREATE OBJECT html_bee.
      LOOP AT it_results INTO wa_results.
        icon = CL_BSP_MIMES=>SAP_ICON( id = 'ICON_GREEN_LIGHT' ).
      ENDLOOP.
      p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY( id = p_cell_id src = icon ).
    In my table view the column ICON doesnt show anything and the rare part is if I put breakpoint in the method and execute the page doesnt stop.
    So I dont know if Im missing something.
    My tableview layout is this:
    <htmlb:tableView id             = "Monitor"
                                     selectionMode  = "SINGLESELECT"
                                     onRowSelection = "rowSelection"
                                     table          = "<%= it_results %>"
                                     iterator        = "<%= iterator  %>"
                                     design         = "ALTERNATING"
                                     filter         = "SERVER"
                                     sort           = "SERVER"
                                     headerVisible  = "FALSE"
                                     footerVisible  = "FALSE">
    I declare a attribute iterator TYPE IF_HTMLB_TABLEVIEW_ITERATOR.
    Someone could give a hand ?

    Solved, I forget to set the attribute of the view in the REQUEST Method.
    result_view->set_attribute( name = 'iterator' value = me ).

  • Visa Open and Close on every iteration of loop

    I have noticed that when you open the front panel of the Instrument I/O Assistant, the diagram starts with a visa session open, sets timeout property, writes, reads, parses data and ends with a visa session closed.  If I were to place this into a while loop the visa session would open and close on each iteration of the loop. 
    Is it common practice to open and close the visa session on each iteration?

    No you would not want to open and close that often. If you want to use the Instrument I/O assistant what I would do is configure it the way you want and then save it under another name so you can open the block diagram. Pull the VISA open and close outside of your loop.
    Using LabVIEW 2010SP1 and TestStand 4.5

  • What happens to the while loop iteration counter if it runs unchecked?

    I want to use the iteration counter to initialise a value on the first loop of a while statement. ie i = 0, x = 100. Fine. The application I am building will be left to run for weeks or months on end without stopping (hopefully :¬)). What happens to the iteration counter in this situation? Does it reset to 0 or what? I don't want it reinitialising any values while the loop is running other than when it starts.
    I set up a while loop to try to figure out what happens and the iteration counter stops at 2147483648 which is 2^31 - 1.
    Any help would be appreciated,
    Thanks,
    Niel.

    It might be something you already looked at, but perhaps it's an option to perform the initialization outside (before) the while loop. That way it will be initialized correctly only once, no matter what the iteration counter does.
    Of course if you need the counter for other purposes than initialization you might have the same problem...
    Note that a lot of the timer functions also overflow after a certain time (I believe 24 or 48 days?) so be careful running very long loops (but you already knew that probably).

Maybe you are looking for