Method cellForRowAtIndexPath if (cell == nil) {} condition strange behavior

This tableView’s are making me crazy. I just tested this behavior on new test project (iPad) with one tableView. I added 30 sections with one row per section and put this line inside if( cell == nil ) {} condition in cellForRowAtIndexPath method:
NSLog(@”Creating cell %d”,indexPath.section);
When I launch application I get this in output:
Creating cell 0
Creating cell 1
Creating cell 2
Creating cell 20
Creating cell 21
Only 22 cells are visible on first run. That’s ok, tableView created only cells that are visible. So far so good.
But when I scroll down to see the rest of the cells (8 other cells) the console only shows me this:
Creating cell 22
Why did tableView skipped creating last 7 rows and used them from queue instead? isn’t that kind a strange behavior? Or maybe is this a bug in apple’s tableView? Or maybe I am wrong and don’t quite understand the background of tableView reusing…?
Any help appriciated, thanks!

Ok, I find out that this is normal and native behavior for tableView's.

Similar Messages

  • Strange behavior of std::string find method in SS12

    Hi
    I faced with strange behavior of std::string.find method while compiling with Sunstudio12.
    Compiler: CC: Sun C++ 5.9 SunOS_sparc Patch 124863-14 2009/06/23
    Platform: SunOS xxxxx 5.10 Generic_141414-07 sun4u sparc SUNW,Sun-Fire-V250
    Sometimes find method does not work, especially when content of string is larger than several Kb and it is needed to find pattern from some non-zero position in the string
    For example, I have some demonstration program which tries to parse PDF file.
    It loads PDF file completely to a string and then iterately searches all ocurrences of "obj" and "endobj".
    If I compile it with GCC from Solaris - it works
    If I compile it with Sunstudio12 and standard STL - does not work
    If I compile it with Sunstudio12 and stlport - it works.
    On win32 it always works fine (by VStudio or CodeBlocks)
    Is there any limitation of standard string find method in Sunstudio12 STL ?
    See below the code of tool.
    Compilation: CC -o teststr teststr.cpp
    You can use any PDF files larger than 2kb as input to reproduce the problem.
    In this case std::string failes to find "endobj" from some position in the string,
    while this pattern is located there for sure.
    Example of output:
    CC -o teststr teststr.cpp
    teststr in.pdf Processing in.pdf
    Found object:1
    Broken PDF, endobj is not found from position1155
    #include <string>
    #include <iostream>
    #include <fstream>
    using namespace std;
    bool parsePDF (string &content, size_t &position)
        position = content.find("obj",position);
        if( position == string::npos ) {
            cout<<"End of file"<<endl;
            return false;
        position += strlen("obj");
        size_t cur_pos = position;
        position = content.find("endobj",cur_pos);
        if( position == string::npos ){
            cerr<<"Broken PDF, endobj is not found from position"<<cur_pos<<endl;;
            return false;
        position += strlen("endobj");
        return true;
    int main(int argc, char ** argv)
        if( argc < 2 ){
            cout<<"Usage:"<<argv[0]<<" [pdf files]\n";
            return -3;
        else {
            for(int i = 1;i<argc;i++) {
                ifstream pdfFile;
                pdfFile.open(argv,ios::binary);
    if( pdfFile.fail()){
    cerr<<"Error opening file:"<<argv[i]<<endl;
    continue;
    pdfFile.seekg(0,ios::end);
    int length = pdfFile.tellg();
    pdfFile.seekg(0,ios::beg);
    char *buffer = new char [length];
    if( !buffer ){
    cerr<<"Cannot allocate\n";
    continue;
    pdfFile.read(buffer,length);
    pdfFile.close();
    string content;
    content.insert(0,buffer,length);
    delete buffer;
    // the lets parse the file and find all endobj in the buffer
    cout<<"Processing "<<argv[i]<<endl;
    size_t start = 0;
    int count = 0;
    while( parsePDF(content,start) ){
    cout<<"Found object:"<<++count<<"\n";
    return 0;

    Well, there is definitely some sort of problem here, maybe in string::find, but possibly elsewhere in the library.
    Please file a bug report at [http://bugs.sun.com] and we'll have a look at it.

  • Strange behavior: action method not called when button submitted

    Hello,
    My JSF app is diplaying a strange behavior: when the submit button is pressed the action method of my managed bean is not called.
    Here is my managed bean:
    package arcoiris;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.model.SelectItem;
    public class SearchManagedBean {
        //Collected from search form
        private String keyword;
        private String country;
        private int[] postcode;
        private boolean commentExists;
        private int rating;
        private boolean websiteExists;
        //Used to populate form
        private List<SelectItem> availableCountries;
        private List<SelectItem> availablePostcodes;
        private List<SelectItem> availableRatings;
        //Retrieved from ejb tier
        private List<EstablishmentLocal> retrievedEstablishments;
        //Service locator
        private arcoiris.ServiceLocator serviceLocator;
        //Constructor
        public SearchManagedBean() {
            System.out.println("within constructor SearchManagedBean");
            System.out.println("rating "+this.rating);
        //Getters and setters
        public String getKeyword() {
            return keyword;
        public void setKeyword(String keyword) {
            this.keyword = keyword;
        public String getCountry() {
            return country;
        public void setCountry(String country) {
            this.country = country;
        public boolean isCommentExists() {
            return commentExists;
        public void setCommentExists(boolean commentExists) {
            this.commentExists = commentExists;
        public int getRating() {
            return rating;
        public void setRating(int rating) {
            this.rating = rating;
        public boolean isWebsiteExists() {
            return websiteExists;
        public void setWebsiteExists(boolean websiteExists) {
            this.websiteExists = websiteExists;
        public List<SelectItem> getAvailableCountries() {
            List<SelectItem> countries = new ArrayList<SelectItem>();
            SelectItem si_1 = new SelectItem();
            SelectItem si_2 = new SelectItem();
            SelectItem si_3 = new SelectItem();
            si_1.setValue("2");
            si_1.setLabel("ecuador");
            si_2.setValue("1");
            si_2.setLabel("colombia");
            si_3.setValue("3");
            si_3.setLabel("peru");
            countries.add(si_1);
            countries.add(si_2);
            countries.add(si_3);
            return countries;
        public void setAvailableCountries(List<SelectItem> countries) {
            this.availableCountries = availableCountries;
        public List<SelectItem> getAvailablePostcodes() {
            List<SelectItem> postcodes = new ArrayList<SelectItem>();
            SelectItem si_1 = new SelectItem();
            SelectItem si_2 = new SelectItem();
            SelectItem si_3 = new SelectItem();
            si_1.setValue(75001);
            si_1.setLabel("75001");
            si_2.setValue(75002);
            si_2.setLabel("75002");
            si_3.setValue(75003);
            si_3.setLabel("75003");
            postcodes.add(si_1);
            postcodes.add(si_2);
            postcodes.add(si_3);
            return postcodes;
        public void setAvailablePostcodes(List<SelectItem> availablePostcodes) {
            this.availablePostcodes = availablePostcodes;
        public List<SelectItem> getAvailableRatings() {
            List<SelectItem> ratings = new ArrayList<SelectItem>();
            SelectItem si_1 = new SelectItem();
            SelectItem si_2 = new SelectItem();
            SelectItem si_3 = new SelectItem();
            si_1.setValue(1);
            si_1.setLabel("1");
            si_2.setValue(2);
            si_2.setLabel("2");
            si_3.setValue(3);
            si_3.setLabel("3");
            ratings.add(si_1);
            ratings.add(si_2);
            ratings.add(si_3);
            return ratings;
        public void setAvailableRatings(List<SelectItem> availableRatings) {
            this.availableRatings = availableRatings;
        public int[] getPostcode() {
            return postcode;
        public void setPostcode(int[] postcode) {
            this.postcode = postcode;
        public List<EstablishmentLocal> getRetrievedEstablishments() {
            return retrievedEstablishments;
        public void setRetrievedEstablishments(List<EstablishmentLocal> retrievedEstablishments) {
            this.retrievedEstablishments = retrievedEstablishments;
        //Business methods
        public String performSearch(){
            System.out.println("performSearchManagedBean begin");
            SearchRequestDTO searchRequestDto = new SearchRequestDTO(this.keyword,this.country,this.postcode,this.commentExists,this.rating, this.websiteExists);
            SearchSessionLocal searchSession = lookupSearchSessionBean();
            List<EstablishmentLocal> retrievedEstablishments = searchSession.performSearch(searchRequestDto);
            this.setRetrievedEstablishments(retrievedEstablishments);
            System.out.println("performSearchManagedBean end");
            return "success";
        private arcoiris.ServiceLocator getServiceLocator() {
            if (serviceLocator == null) {
                serviceLocator = new arcoiris.ServiceLocator();
            return serviceLocator;
        private arcoiris.SearchSessionLocal lookupSearchSessionBean() {
            try {
                return ((arcoiris.SearchSessionLocalHome) getServiceLocator().getLocalHome("java:comp/env/ejb/SearchSessionBean")).create();
            } catch(javax.naming.NamingException ne) {
                java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
                throw new RuntimeException(ne);
            } catch(javax.ejb.CreateException ce) {
                java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ce);
                throw new RuntimeException(ce);
    }Here is my jsp page:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
             <html>
                 <head>
                     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                     <META HTTP-EQUIV="pragma" CONTENT="no-cache">
                     <title>JSP Page</title>
                 </head>
                 <body>
                     <f:view>
                         <h:panelGroup id="body">
                             <h:form id="searchForm">
                                 <h:panelGrid columns="2">
                                     <h:outputText id="keywordLabel" value="enter keyword"/>   
                                     <h:inputText id="keywordField" value="#{SearchManagedBean.keyword}"/>
                                     <h:outputText id="countryLabel" value="choose country"/>   
                                     <h:selectOneListbox id="countryField" value="#{SearchManagedBean.country}">
                                         <f:selectItems id="availableCountries" value="#{SearchManagedBean.availableCountries}"/>
                                     </h:selectOneListbox>
                                     <h:outputText id="postcodeLabel" value="choose postcode(s)"/>   
                                     <h:selectManyListbox id="postcodeField" value="#{SearchManagedBean.postcode}">
                                         <f:selectItems id="availablePostcodes" value="#{SearchManagedBean.availablePostcodes}"/>
                                     </h:selectManyListbox>
                                     <h:outputText id="commentExistsLabel" value="with comment"/>
                                     <h:selectBooleanCheckbox id="commentExistsField" value="#{SearchManagedBean.commentExists}" />
                                     <h:outputText id="ratingLabel" value="rating"/>
                                     <h:selectOneListbox id="ratingField" value="#{SearchManagedBean.rating}">
                                         <f:selectItems id="availableRatings" value="#{SearchManagedBean.availableRatings}"/>
                                     </h:selectOneListbox>
                                     <h:outputText id="websiteExistsLabel" value="with website"/>
                                     <h:selectBooleanCheckbox id="websiteExistsField" value="#{SearchManagedBean.websiteExists}" />
                                     <h:commandButton value="search" action="#{SearchManagedBean.performSearch}"/>
                                 </h:panelGrid>
                             </h:form>
                         </h:panelGroup>
                     </f:view>
                 </body>
             </html>
         here is my faces config file:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
        <managed-bean>
            <managed-bean-name>SearchManagedBean</managed-bean-name>
            <managed-bean-class>arcoiris.SearchManagedBean</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
        <navigation-rule>
           <description></description>
            <from-view-id>/welcomeJSF.jsp</from-view-id>
            <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>index.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>
    </faces-config>The problem occurs when the field ratingField is left blank (which amounts to it being set at 0 since it is an int).
    Can anyone help please?
    Thanks in advance,
    Julien.

    Hello,
    Thanks for the suggestion. I added the tag and it now says:
    java.lang.IllegalArgumentException
    I got that from the log:
    2006-08-17 15:29:16,859 DEBUG [com.sun.faces.el.ValueBindingImpl] setValue Evaluation threw exception:
    java.lang.IllegalArgumentException
         at sun.reflect.GeneratedMethodAccessor118.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.faces.el.PropertyResolverImpl.setValue(PropertyResolverImpl.java:178)
         at com.sun.faces.el.impl.ArraySuffix.setValue(ArraySuffix.java:192)
         at com.sun.faces.el.impl.ComplexValue.setValue(ComplexValue.java:171)
         at com.sun.faces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:234)
         at javax.faces.component.UIInput.updateModel(UIInput.java:544)
         at javax.faces.component.UIInput.processUpdates(UIInput.java:442)
         at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:935)
         at javax.faces.component.UIForm.processUpdates(UIForm.java:196)
         at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:935)
         at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:935)
         at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:363)
         at com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:81)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Thread.java:595)
    2006-08-17 15:29:16,875 DEBUG [com.sun.faces.context.FacesContextImpl] Adding Message[sourceId=searchForm:ratingField,summary=java.lang.IllegalArgumentException)Do you see where the problem comes from??
    Julien.

  • Strange behavior after using NIK plug-ins

    Every once in a while I encounter this strange behavior of Aperture. I first process the NEF's in Aperture (white balance, Exposure, Enhance... and, when needed, Cropping) and then I fine tune the image with the NIK plug-ins; when needed DfIne 2.0, Viveza, Color Efex Pro 3.0 and Sharpener Pro 3.0 Output Sharpener.
    If I look at the processed picture then, I get a perfect presentation of the photo;
    !http://users.skynet.be/fc419085/Aperture-1.jpg!
    But when I press Z to zoom into a 100% preview I get this;
    !http://users.skynet.be/fc419085/Aperture-2.jpg!
    When I select the Loup in the normal view mode I get this;
    !http://users.skynet.be/fc419085/Aperture-3.jpg!
    This doesn't happen with all my pictures, yesterday I processed a series of 8 pictures an 6 of them showed this behavior the other two acted normal and I can't see what I did differently whit these last two.
    When I export the strangely behaving photo's to a Tiff or a Jpeg, I get perfectly normal pictures.
    The original NEF behaves normal. I have seen this behavior with NEF's from a Nikon D200, D2x and a D300. I have Aperture 2.1.2 running on a 2.33 GHz Intel Core Duo MacBook Pro running Mac OS X 10.5.6
    Does anybody know what's happening and if so, how to solve this problem?
    Cheers,
    Ivan

    I did some testing and what I found is too weird to be true.
    First this mashed up look doesn't only happen after using NIK plug-ins, it also happens when making a roundtrip to Photoshop, given that certain conditions are met.
    Give it a try yourself. Crop an image to an uneven pixelcount dimension, for example 4227 x 2797 and make a roundtrip to Photoshop. Then have a 100% view look at the new image in Aperture. You'll have a mashed up view, at least I do.
    Now crop the same original image to an even pixelcount dimension, for example 4228 x 2798 and make an roundtrip to Photoshop once more. When you have a 100% view of the new image now, you'll see a perfectly normal photo.
    Do you think Aperture developers are reading this forum?

  • Strange Behavior connecting to Oracle

    Hi to All,
    On Server Windows 2003 I have installed Oracle 10g R2. On this Server run Toad for Oracle.
    If I run Oracle console, all work fine; running Toad the ORA-12154 error is displayed.
    I have tried to connect to DB with Toad from a client and all works.
    Have someone an idea on this strange behavior ?
    Thank You and Best Regards
    Gaetano

    This may be a problem?NO!
    12154, 00000, "TNS:could not resolve the connect identifier specified"
    // *Cause:  A connection to a database or other service was requested using
    // a connect identifier, and the connect identifier specified could not
    // be resolved into a connect descriptor using one of the naming methods
    // configured. For example, if the type of connect identifier used was a
    // net service name then the net service name could not be found in a
    // naming method repository, or the repository could not be
    // located or reached.
    // *Action:
    //   - If you are using local naming (TNSNAMES.ORA file):
    //      - Make sure that "TNSNAMES" is listed as one of the values of the
    //        NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
    //        (SQLNET.ORA)
    //      - Verify that a TNSNAMES.ORA file exists and is in the proper
    //        directory and is accessible.
    //      - Check that the net service name used as the connect identifier
    //        exists in the TNSNAMES.ORA file.
    //      - Make sure there are no syntax errors anywhere in the TNSNAMES.ORA
    //        file.  Look for unmatched parentheses or stray characters. Errors
    //        in a TNSNAMES.ORA file may make it unusable.
    //   - If you are using directory naming:
    //      - Verify that "LDAP" is listed as one of the values of the
    //        NAMES.DIRETORY_PATH parameter in the Oracle Net profile
    //        (SQLNET.ORA).
    //      - Verify that the LDAP directory server is up and that it is
    //        accessible.
    //      - Verify that the net service name or database name used as the
    //        connect identifier is configured in the directory.
    //      - Verify that the default context being used is correct by
    //        specifying a fully qualified net service name or a full LDAP DN
    //        as the connect identifier
    //   - If you are using easy connect naming:
    //      - Verify that "EZCONNECT" is listed as one of the values of the
    //        NAMES.DIRETORY_PATH parameter in the Oracle Net profile
    //        (SQLNET.ORA).
    //      - Make sure the host, port and service name specified
    //        are correct.
    //      - Try enclosing the connect identifier in quote marks.
    //   See the Oracle Net Services Administrators Guide or the Oracle
    //   operating system specific guide for more information on naming.This error is clear.
    SQL*Net is being asked to resolved TNS_ALIAS & it reports that it can not find the requested name.
    EITHER
    1) the requested name is not correct
    or
    2) SQL*Net is looking in the wrong tnsnames.ora file & still not finding the requested name.
    Good Luck solving your mystery

  • Strange behavior  in entity bean : get Timestamp

    Hello:
    I'm working with SUNONE 7 AppServer , over SunOS 5.9
    I've a strange behavior with entity's get methods which return Timestamp value.
    For example, I've got
    Timestamp date;
    If I do
    entity.setF(date) , ( date is a Timestamp with value "12/12/2005 12:30:00" )
    all works right, and in database is wrote right ( "12/12/2005 12:30:00" )
    But , if I do
    date = entity.getF()
    the, date variable has the value "12/12/2005 00:00:00"
    So, in get method is lost the time value of a Timestamp data
    Could be a code bug in my source , but if I use Jboss AS over Windows XP , all work right ( set and get methods ). The database is the same one ( Oracle 9i )

    Well, I found the solution.
    The problem was the ojdbc14.jar driver, which made wrong schema files.
    Exactly, with the bad ojdbc14.jar, generated this entry
    <_type>91</_type>
    when the right one for date types ( Timestamp ) is
    <_type>93</_type>
    I dont know why the new ojdbc14.jar works fine, but I paste its size
    good ojdbc14.jar : 1181679 bytes

  • Strange behavior in Webi : No data returned

    Hi,
    I am experiencing a strange behavior.
    I have created a condition object in universe.
    Start Date : DATE_DIM_TBL.DAY >= UPPER(to_char(to_date(@prompt('Enter start date','D',,mono,free),'dd/mm/yyyy HH24:MI:SS'),'dd-mon-yy'))
    End Date : DATE_DIM_TBL.DAY <= UPPER(to_char(to_date(@prompt('Enter end date','D',,mono,free),'dd/mm/yyyy HH24:MI:SS'),'dd-mon-yy'))
    Now when I create report to display years between 01-05-2005 and 04-05-2009. Report does not return any data.
    Where as when I execute the generated query from SQL prompt it return correct data.
    SELECT
      DATE_DIM_TBL.CALENDAR_YEAR_NAME
    FROM
      DATE_DIM_TBL
    WHERE
       ( DATE_DIM_TBL.DAY >= UPPER(to_char(to_date('01-05-2005 00:00:00','dd/mm/yyyy HH24:MI:SS'),'dd-mon-yy'))  )
       AND
       ( DATE_DIM_TBL.DAY <= UPPER(to_char(to_date('04-05-2009 00:00:00','dd/mm/yyyy HH24:MI:SS'),'dd-mon-yy'))  )
    can somebody please give any pointers about what has gone wrong in WebI.
    --Kuldeep

    Please find below
    20-APR-05
    02-JAN-00
    03-JAN-00
    04-JAN-07
    05-JAN-00
    06-JAN-08
    07-JAN-00
    08-JAN-09
    09-JAN-11
    Yes I tried SQL*PLus on BOBJ Server machine. SQL returns correct data.
    Do you think is it some setting in WebI, As It hapopens only when I use condition object as a filter in Webi report. When I create Report filter it works fine.
    --Kuldeep

  • Strange behavior with DefaultCellEditor

    Hello everybody,
    I found a strange behavior with DefaultCellEditor using a JTextField in a JTable. The following line will show, what I mean:
    setDefaultCellEditor(String.class,new DefaultCellEditor(new JTextField()));
    Imho this should do the same as JTable does already, when it installs a JTextField as default cell editor for cell values of the String class. But, it seems, that it is not the same:
    When I add this line in the constructor of a JTable subclass the editor component seems to be less wide and less high to the right and bottom - it looks so with Win95 with JDK 1.4.0 - but with Win2000 it is correct for example.
    My question is - how can it be, that the normal default cell editor does not have this behavior but when I use the line above, it is displayed in the wrong way?- What does the default cell editor in another way than I do it, that it has not this ugly display?
    I would like to look in the sources, but unfortunately I can't find the source code in JDK 1.4.0 - perhaps you have a hint, where to find it.
    greetings Marsian

    It seems the Label doesn't like it, that it is in a GridCell with rowspan = 2
    If it is in a normal cell (no rowspan), it works.
    If I add ColumnConstraints to the gridpane, it kind of works, but the Label still occupies more space than it should.
    Edited by: csh on 19.07.2012 03:51

  • Strange behavior with Label#setWrapText(true) in GridPane.

    I've got a strange behavior with a Label, which has setWrapText(true) in a GridPane.
    Check out the sample and click the button.
    You see, that the GridPane suddenly behaves as if it had GridPane.setVGrow and HGrow set for the lblStatus.
    (it takes the full available space).
    Furthermore the first column shrinks to a minimum, so that lblText1 can't display its text anymore.
    Tested with 2.1 GA.
    Any help with that?
    import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.geometry.Insets;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.Label;
    import javafx.scene.layout.GridPane;
    import javafx.stage.Stage;
    public class TestApp4 extends Application {
        public static void main(String[] args) {
            launch(args);
        @Override
        public void start(final Stage stage) throws Exception {
            GridPane gridPane = new GridPane();
            gridPane.setPadding(new Insets(2, 2, 2, 2));
            Label lblText1 = new Label();
            lblText1.textProperty().set("Some text");
            Label lblText2 = new Label();
            lblText2.textProperty().set("Some other text");
            Button btnClick = new Button();
            btnClick.textProperty().set("Click me");
            final Label lblStatus = new Label();
            lblStatus.setWrapText(true);
            gridPane.add(lblText1, 0, 0, 1, 1);
            gridPane.add(lblText2, 1, 0);
            gridPane.add(lblStatus, 0, 2, 2, 1);
            gridPane.add(btnClick, 0, 3, 2, 1);
            btnClick.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent actionEvent) {
                    lblStatus.setText("very long text, very long text, very long text, very long text,very long text, very long text");
            gridPane.setGridLinesVisible(true);
            Scene scene = new Scene(gridPane, 300, 300);
            stage.setScene(scene);
            stage.show();
    }Edited by: csh on 19.07.2012 03:35

    It seems the Label doesn't like it, that it is in a GridCell with rowspan = 2
    If it is in a normal cell (no rowspan), it works.
    If I add ColumnConstraints to the gridpane, it kind of works, but the Label still occupies more space than it should.
    Edited by: csh on 19.07.2012 03:51

  • Strange behavior of system with enabled FileVault2, Roaming profile

    Hello,
    I have encountered strange behavor of my Macbook Air after some testing.
    Macbook Air 2012 was newly installed with 10.8.4 and joined network account server on 10.8.4 server with Roaming profile (synced with server home directory). After installing some basic apps like iWork I turned on FileVault.
    Then I start to have the strange behavior - iWorks are not displaying content of document - it seams blank - just white screen without any borders where should be at least lines in numbers or empty cells.
    Another display problem is in Safari. On same pages (even default Top SItes) it`s flashing and especially when scrolling.
    Did you encountered something similar? I`m not able to get rid of it.
    Computers was used for some time before turining on FIle Vault and problem started to occur after this action. Disabling of FileVault didn`t helped (properly restarted between steps).
    I didn`t found anything strange in Console or elsewhere..

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, or by corruption of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and Wi-Fi on certain iMacs.  The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • Strange behavior of JTable..Help plz

    Hi,
    Assume i have 5 rows in my JTable. I wrote a function on right click i get a popup window with an option delete row, which deletes the row successfully,
    The problem is when i sort the data in JTable. on column click JTable is getting sorted, in which assume 2nd row got replaced with 4th row and vice versa.
    Now when i try to delete the 4th row, it is delete the 2nd row data, which was there at the place of 4th row before sorting. In this regard i am trying to print the row number before deleting. It is displaying as 4th, but deleting 2nd row.
    Hope i am clear. Please suggest me in solving this strange behavior of JTable sorting problem.
    Regards,
    Ravi

    MyTableModel tablemodel = new MyTableModel(colnames,values);
    TableSorter sorter = new TableSorter(tablemodel);
    JTable table = new JTable(sorter)
    tablemodel.removeRow(row); // last line is the code where i am deleting the row, it's deleting the wrong row.
    do i need to remove the last line code and make respective changes in TableSorter.java class.
    ore
    here itself do i need to do some changes. ?
    There is a method that will convert the view row to the model row private Row[] getViewToModel()
    my question is how TableSorter.java class comes to know that i am deleting the perticular row.

  • Strange behavior of GetStringUTFChars in Linux

    Good evening!
    I made an implementation of a native method in C++ for Windows and Linux, in windows it works fine, but in Linux I have a strange behavior of GetStringUTFChars here is the piece code :
    JNIEXPORT jint JNICALL Java_MyNativeMethod
    (JNIEnv *env, jobject obj, jstring IpAddress) {
    const char * ccpIpAddress = env->GetStringUTFChars(IpAddress, 0);
    jsize size = env->GetStringLength(ccpIpAddress);
    trace("IpAddress : %s size: %d", ccpIpAddress, size);
    Absolute normal... but when I pass as parameter a string '192.168.1.11'
    I receive from 'IpAddress : HB&#317;1 size: 0' to 'IpAddress : P9D7D6DwD&#65533;MS\H#M\H : 251'
    I made a little and simple test to print a String to verify if is Linux problem but IT WORKED FINE!
    I've notice that the differences between both programs are that the wrong one has been linked with a C lib, but the #define __cplusplus is OK also, and all the compile process use C++ code...
    This is my compilation line
    g++ -o lib{myLib}.so {myImpl}.cpp lib{C li}.so libstdc++.so -I {JAVA_HOME}/include/ -I {JAVA_HOME}/include/linux/ -shared -static -L{JAVA_HOME}/jre/lib/i386/
    (variables put for clarity) and (I tried with gcc also)
    the libstrd++.so is been used in my simple test link options too.
    I was wondering if there is some -Doption which should be defined that
    functions->GetStringChars(this,str,isCopy); implementation ask for...
    or if the link with a C code is messing the things in a different behavior
    Thanks for the help
    Pedro Ribeiro
    Sao Paulo - Brazil

    JNIEXPORT jint JNICALL Java_MyNativeMethod
    (JNIEnv *env, jobject obj, jstring IpAddress) {
    const char * ccpIpAddress = env->GetStringUTFChars(IpAddress, 0);
    jsize size = env->GetStringLength(ccpIpAddress);
    trace("IpAddress : %s size: %d", ccpIpAddress, size);
    =====================
    You tried to get the string length of C character array.
    I think you can get the length of jstring alone.
    Please advice me if I am wrong

  • Strange behavior of flex4 service call

    Hi Techies, I am stuck with strange behavior of flex4 service call. Our is a dashboard application where i have four modules(separae file for each) in a page. when page renders all these modules makes separate service call through remote objects. Though destination file is same but methods are separate for each modules. db+java takes 5 second for 1 and 3 module, 9 seconds for third module and 15 seconds for 4th module. Sinch LCDS calls are asynchronous ideally after 5 seconds module 1 and 2 should display data. similarly for 3rd module after 9seconds. For my wonder it doesnt go this way. data for all the modules appears simultaneously after 15-16 seconds.  It behaves like when data for all the modules is available then only it populates charts and grids. Looks like call is being made in sequence and once maximum taking method is done then control returns back to flex. Any pointer will be helpful to improvise this.
    Thanks,
    Rohit

    Hi Techies, I am stuck with strange behavior of flex4 service call. Our is a dashboard application where i have four modules(separae file for each) in a page. when page renders all these modules makes separate service call through remote objects. Though destination file is same but methods are separate for each modules. db+java takes 5 second for 1 and 3 module, 9 seconds for third module and 15 seconds for 4th module. Sinch LCDS calls are asynchronous ideally after 5 seconds module 1 and 2 should display data. similarly for 3rd module after 9seconds. For my wonder it doesnt go this way. data for all the modules appears simultaneously after 15-16 seconds.  It behaves like when data for all the modules is available then only it populates charts and grids. Looks like call is being made in sequence and once maximum taking method is done then control returns back to flex. Any pointer will be helpful to improvise this.
    Thanks,
    Rohit

  • String.replaceAll strange behavior...

    I have found strange behavior of String.replaceAll method:
    "aaaabaaaa".replaceAll("b","a"); // working fine
    "aaaabaaaa".replaceAll("b","a${"); // throws an exceptionThat could be probably a bug?
    p.s. using jdk_1.6.0_12-b04

    Welcome to the Sun forums.
    >
    "aaaabaaaa".replaceAll("b","a${"); // throws an exception
    Please always copy/paste the [exact error message|http://pscode.org/javafaq.html#exact]. We do not have crystal ball, and cannot see the output on your PC.
    >
    That could be probably a bug? >(chuckle) It has more to do with special characters in Strings, that need to be escaped. I am not up on the fine details, but try this code.
    import javax.swing.*;
    class TestStringReplace {
      public static void main(String[] args) {
        String result = "aaaabaaaa".replaceAll("b","c"); // working fine
        JOptionPane.showMessageDialog(null, result);
        result = "aaaabaaaa".replaceAll("b","c\\${"); // chars escaped
        JOptionPane.showMessageDialog(null, result);
    }

  • JDEV Team: Strange behavior in TOMCAT using DATATAGS (VERY CRITICAL)

    I am encountering some strange behavior when I deploy my application to TOMCAT.
    If I run in JDeveloper (webtogo) everything works fine but the behavior changes completely in TOMCAT.
    Let me try and explain my situation here.
    I have 3 jsps :
    1.iss_listApps.jsp which is used to browse all the available records, allows the user to navigate to a specific record and edit or delete.
    2. app_edit.jsp which is used to edit/delete a specific row passed from iss_listApps.jsp.
    3. app_edit_post.jsp which is used to save the changes.
    Note that I use an anchor ">Edit</a> to pass a row from the browser page to the edit page.
    For your convenience I have listed all the source files below.
    Now here are my problems:
    Problem 1. If I run it in JDeveloper, I am able to browse the records and go to a specific record to edit and delete by clicking on the "Edit" anchor provided in the browser page.
    I can also go to the edit page and backout out of it by not saving the changes. In that case I am back in my browser page and I can again click on the "Edit" anchor to a specific record.
    However if I am in TOMCAT, I am able to browse and go to a specific record so long as I make changes to it and save it. If for any reason, I do not save a record and I go back to my browser
    page then any subsequent calls to to edit a specific record goes to the same OLD RECORD that I did not save.
    I fail to understand why? Maybe the "webtogo" server automatically refreshes when I click on the "back tab". If so, how do I automatically refresh a jsp page when I click on the "back tab" in TOMCAT.
    I would sincerely appreciate any help on this.
    Problem 2. I have an include jsp tag in my browser page. defined as
    <jsp:include page="Message.jsp" flush="true">
    <jsp:param name="colspan" value="2"/>
    </jsp:include>.
    This section of the code is currently commented out because if I uncomment it then it runs ok in JDeveloper but in Tomcat it causes the browser page to always navigate to the first record if I want to edit a specific record.
    I would sincerely appreciate any answer on this.
    Here are my source files:
    1. iss_ListApps.jsp (browser page). Please see how the anchor is formed. It causes no problems
    in JDeveloper.
    <%@ page contentType="text/html;charset=WINDOWS-1252"%>
    <HTML>
    <base target="contentsframe">
    <head>
    </head>
    <body>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <jbo:ApplicationModule id="NewBC4J.NewBC4JModule" configname="NewBC4J.NewBC4JModule.NewBC4JModuleLocal" username="issue" password="issue"/>
    <jbo:RollBack appid="NewBC4J.NewBC4JModule" />
    <jbo:DataSource id="app_vo" appid="NewBC4J.NewBC4JModule" viewobject="ApplicationsView" ></jbo:DataSource>
    <jbo:RefreshDataSource datasource="app_vo" />
    <table width="100%" bgcolor="tan" border="0" align="center" cellpadding="3" cellspacing="0">
    <%--
    <jsp:include page="Message.jsp" flush="true">
    <jsp:param name="colspan" value="2"/>
    </jsp:include> --%>
    <form name="list" target="body" action="app_edit.jsp" method="post">
    <tr><th colspan="4">List of Valid Applications</th></tr>
    <tr>
    <th> </th>
    <th align="left"><u>Code</u></th>
    <th align="left"><u>Name</u></th>
    <th align="left"><u>Description</u></th>
    </tr>
    <tr>
    <jbo:RowsetIterate datasource="app_vo">
    <td>
    <a href="app_edit.jsp?RowKeyValue=<jbo:ShowValue datasource="app_vo" dataitem="RowKey"/>">Edit</a>
    </td>
    <td>
    <jbo:ShowValue datasource="app_vo" dataitem="Code" />
    </td>
    <td>
    <jbo:ShowValue datasource="app_vo" dataitem="Name" />
    </td>
    <td>
    <jbo:ShowValue datasource="app_vo" dataitem="A ppDesc" />
    </td>
    </tr>
    </jbo:RowsetIterate>
    </form>
    </table>
    <table width="100%" bgcolor="skyblue" align="center" cellpadding="10" cellspacing="0" >
    <tr>
    <form NAME="AddForm" action="app_add.jsp">
    <td>
    <input type = "submit" name="submit" value="Add" align="center" >
    </td>
    </form>
    </tr>
    </table>
    </body>
    <jbo:ReleasePageResources releasemode="Stateful" appid="NewBC4J.NewBC4JModule" />
    </html>
    2. Second Source File: app_edit.jsp (Allows editing of a record)
    <%@ page contentType="text/html;charset=WINDOWS-1252"%>
    <HTML>
    <base target="contentsframe">
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=WINDOWS-1252">
    <META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
    <TITLE>
    </TITLE>
    </HEAD>
    <BODY>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <jbo:ApplicationModule id="NewBC4J.NewBC4JModule" configname="NewBC4J.NewBC4JModule.NewBC4JModuleLocal" />
    <jbo:DataSource id="app_vo" appid="NewBC4J.NewBC4JModule" viewobject="ApplicationsView" />
    <jbo:Row id="myrow" datasource="app_vo" rowkeyparam="RowKeyValue" action="Find">
    <jbo:SetAttribute dataitem="*"/>
    </jbo:Row>
    <table width="100%" bgcolor="skyblue" border="0" align="center">
    <tr>
    <td>
    <table width="100%" bgcolor="tan" border="0" align="center" cellpadding="3" cellspacing="0">
    <form NAME="iForm" action="app_edit_post.jsp">
    <tr>
    <th colspan="2">
    "Edit/Delete Applications"
    </th>
    </tr>
    <jsp:include page="Message.jsp" flush="true">
    <jsp:param name="colspan" value="2"/>
    </jsp:include>
    <tr>
    <td align="right"><b><font color="red"> Name:</font></b></td>
    <td> <jbo:InputText datasource="app_vo" dataitem="Name" cols="50" />
    </td>
    </tr>
    <tr>
    <td align="Right"><b><font color="red"> Description: </font></b></td>
    <td> <jbo:InputTextArea datasource="app_vo" dataitem="AppDesc" cols="50" rows="5" />
    </td>
    </tr>
    </table>
    <!-- Create a table for the save and Delete Buttons -->
    <table width="100%" bgcolor="skyblue" align="center" cellpadding="10" cellspacing="0" >
    <tr>
    <input name="RowKeyValue" type="hidden" value="<jbo:ShowValue datasource="app_vo" dataitem="RowKey"/>" />
    <td>
    <input type = "submit" name="submit" value="Save">
    </td>
    </form>
    <form NAME="DelForm" action="app_del_post.jsp">
    <input name="RowKeyVal" type="hidden" value="<jbo:ShowValue datasource="app_vo" dataitem="RowKey"/>" />
    <td>
    <input type = "submit" name="submit" value="Delete">
    </td>
    </form>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </BODY>
    </HTML>
    <jbo:ReleasePageResources releasemode="Stateful" />
    3. Third source file app_edit_post.jsp (ALlows saving the changes made to a specific record)
    <%@ page contentType="text/html;charset=ISO-8859-1"%>
    <HTML>
    <BODY>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <jbo:ApplicationModule id="NewBC4J.NewBC4JModule" configname="NewBC4J.NewBC4JModule.NewBC4JModuleLocal" />
    <jbo:DataSource id="app_vo" appid="NewBC4J.NewBC4JModule" viewobject="ApplicationsView" ></jbo:DataSource>
    <%
    try
    %>
    <jbo:Row id="row3" datasource="app_vo" rowkeyparam="RowKeyValue" action="Update" >
    <jbo:SetAttribute dataitem="*" />
    </jbo:Row>
    <jbo:Commit appid="NewBC4J.NewBC4JModule" />
    <p><font face="Arial, Helvetica, sans-serif"><b><font color="006699">Application Successfully Updated</b></font></font> </p>
    <%
    catch(Exception exc)
    out.println("<pre> ");
    exc.printStackTrace(new java.io.PrintWriter(out));
    out.println("</pre>");
    %>
    <br>
    <br>
    <form action="app_ListApps.jsp" method="post"><input type="submit" value="Click to Continue"></form
    <jbo:ReleasePageResources releasemode="Stateful" />
    </BODY>
    </HTML>
    null

    I would not expect the 'back' button to automatically refresh the page. This button basically traverses the history of pages. Since Tomcat is caching your pages, you can try to control it's interaction with the browser by:
    1. Adding cache control pragmas to the returned content so it doesn't get cached.(look at www.w3c.org at the HTTP spec)
    2. dont rely on the back button, place a link on your pages to go back to the list page.
    3. change your cache control settings in your browser to check for a new page every time a url is visited.

Maybe you are looking for

  • Adobe Acrobat 9 Pro does not connect to update server

    I'm having an issue connecting to the update server. Here's the message I get. Any help?

  • Problem with audio jack iPad 4

    Yo, i'm from México, last year (March 4 2013) My mom gave me an iPad 4 has a birthday present from march to august anything was cool. But on august i was on the school and i just unplugged my headphones, then 1 hour later i plugged them and only one

  • How to detect imbedded image inside GroupWise email?

    Hi, I am using GroupWise 8.0. I created a new mail and used File->Attachments->Attach Files...to attach files, and selected one MS WORD and one Excel file to attach to this emai. Then I launched Paint to open a jpg file name image.jpg, selected the i

  • N95 8GB cannot view gallery photos/ uploads photos...

    Hiya, I have had the same problem with my N95 8GB with viewing photos in my gallery! I have now got my 5th replacement handset (Orange) since August 29th due to various faults and issues. The main one being trying to transfer photos from my PC to my

  • Diff  ws_upload and gui_upload

    The difference is that the DataProvider is used for the upload instead of GMUX. waht is dataprovider and GMUX? regards