TableView in JSP - Nonclickable Cells

Hi,
I have a TableView in a JSP. Some cells in it are clickable (like tje first column and the headerline) How can I set the whole table non-clickable?
Thanks ahead,
Burkhardt

Hi,
define for all actions an click-event and in your Controller-Class define the event-methods with no functions.
Regards,
Gerhard

Similar Messages

  • How to dynamically load an Image into a TableView when its row/cell becomes visible?

    Hi,
    I am building an application that shows tables with large amounts of data containing columns that should display a thumbnail. However, this thumbnail is supposed to be loaded in the background lazily, when a row becomes visible because it is computationally too expensive to to this when the model data is loaded and typically not necessary to retrieve the thumbnail for all data that is in the table.
    I have done the exact same thing in the past in a Swing application by doing this:
    Whenever the model has changed or the vertical scrollbar has moved:
    - Render a placeholder image in the custom cell renderer for this JTable if no image is available in the model object representing the corresponding row
    - Compute the visible rows by using getVisibleRect and rowAtPoint methods in JTable
    - Start a background thread that retrieves the image for the given rows and sets the resulting BufferedImage in a custom Model Object that was used in the TableModel (if not already there because of an earlier run)
    - Fire a corresponding model change event in the EDT whenever an image has been retrieved in the background thread so the row is rendered again
    Btw. the field in the model class holding the BufferedImage was a weak reference in this case so the memory can be reclaimed as needed by the application.
    What is the best way to achieve this behaviour using a JFX TableView? I have so far failed to find anything in the API to retrieve the visible items/rows. Is there a completely different approach available/required that uses the Cell API? I fail to see it so far.
    Thanks in advance for any hints here.

    Here’s what I have tried so far:
    I have defined a property in my model object that contains a weak reference to the image that is expensive to load. I have modeled that reference as an inner class to the object so I have a reference to its enclosing object. That is necessary because my cell factory otherwise has no access to the enclosing model object, which it needs to trigger loading the image in the background.
    The remaining problems I have is, that I don’t have sufficient control over the loading process, i.e. I need to delay the loading process until scrolling has stopped and abort it as soon as the user starts scrolling again and the visible content changes. Imagine that loading an image for a table row (e.g. a thumbnail for a video) takes 200ms to load and a user quickly scrolls through a few hundred records and then stops. With my current set-up, the user has to wait for all loading processes that were triggered in the cell factories to finish until the thumbnails of the records they are looking at will appear (imagine an application like finder to be implemented like that, it would simply suck UX-wise). In my swing application a background thread that loads images for the visible records is triggered with a delay and stopped as soon as the visible content changes. This works well enough for a good user experience. I don’t see how I can do this based on the cell API. It is nice to have all this abstracted away but in this case I do not see how I can achieve the same user experience as in my swing application.
    I also tried registering a change listener to the TreeCell’s visible property to make that control the image loading but I don’t seem to get any change events at all when I do that.
    I must be missing something.

  • HTMLB TableView Iterator & Edit columns, cells

    Hi friends,
    I am getting errors when , I tried to edit the columns, & Cells of  HTMLB TableView by using Iterator.Actually, I got the whole edit buttons and when I edit the values of particular column & cell fileds, it is not saving the values, instead it is giving same old values. The code I used is as follows.
    <u><b>To Edit the  columns,</b></u>
    method
    IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS.
    FIELD-SYMBOLS: <def> LIKE LINE OF p_column_definitions.
      APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
    <def>-COLUMNNAME = 'STUDENTID'.<def>-EDIT = 'X'.
    endmethod.
    <u><b>To Edit the  cells,</b></u>
    RENDER_CELL_START Method:
    method
    IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
    CASE p_column_key.
    WHEN 'ICON'.
    WHEN 'STUDENTID'.
           IF p_edit_mode IS NOT INITIAL.
    ENDIF.
    WHEN 'SDATE'.
           IF p_edit_mode IS NOT INITIAL.
    ENDIF.
    ENDCASE.
    endmethod.
    <u><b>To Edit the SDATE cells,</b></u>
    WHEN 'SDATE'.
      IF p_edit_mode IS NOT INITIAL.
    DATA: date TYPE STRING.
    date = m_row_ref->SDATE.
    p_replacement_bee = CL_HTMLB_INPUTFIELD=>FACTORY(
                          id        = p_cell_id
                           value     = date
                           type      = 'DATE'
                             showHelp  = 'TRUE'
                             cellValue = 'TRUE' ).
                               ENDIF.
    Why the either column or cell is not saving the new values, when I edit them? where it went wrong? please mail me in this regard.
    regards
    CSM Reddy

    Hi REDDY CSM 
    To learn coding these Methods.
    You need to learn everything from scratch about MVC.
    To learn functionalities of Methods in Controller and how to use them,its Better,if you start with some tutorial(Little application) on MVC.
    Here is link,Just follow this,You will get some Exposure to these methods.
    http://help.sap.com/saphelp_erp2005/helpdata/en/c8/101c3a1cf1c54be10000000a114084/frameset.htm
    Rest keep posting whenever you face and Problem..
    Happy Coding..!!
    Vijay Raheja

  • JavaFX 2.1 TableView that includes WebView cells

    I want to create a JavaFX table that, in the cells of one column, allows the user to edit XHTML text. I only need very basic formatting capabilities like bold, italic, striketrough.
    I have already managed to implement this by using my own subclass of TableCell and using a WebView for each cell (HTMLEditor would of course have been another choice, but my guess is that for my requirements, WebView should be sufficient).
    However, to make editing comfortable for the user, I need the following feature: the cell height needs to resize if the user enters multi-line text. .
    I had some ideas I have tried out, like using the loadContent method, creating an event handler in javascript, and setting the preferred size of the cell in it.
    I got none of my ideas to work properly, so I am stuck.
    Has anybody been successful in implementing something similar ?
    What I hope for is a code sample that implements this feature or parts of it.

    Have you tried 2.2?
    Add a style that reverts the color back to the caspian default:
    #myTable .table-cell {
        -fx-text-fill: -fx-text-inner-color;
    }By the way, this.getTableRow().getStyleClass().remove("triggerHighLight .table-cell") will not work because the styleClass property is a List<String> (technically and ObservableList<String>) so you need to remove each styleClass individually.
        this.getTableRow().getStyleClass().remove("triggerHighLight");
        this.getTableRow().getStyleClass().remove("table-cell");
        But then, you really don't want to remove the table-cell styleClass.

  • Loading custom TableView cell asynchronously

    hey all.i have custom cell which has a label and an image in it..i load the images synchronously the tableView but when i scroll down it frozen..so i want to load it asynchronously..to do that i read some tutorials and i found that site http://www.markj.net/iphone-asynchronous-table-image/ and import that files into my project but i cant use it..i wrote like that
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
              static NSString *CellIdentifier = @"Cell";
              Cell *cell =(Cell*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
              if (cell == nil)
                        [[NSBundle mainBundle] loadNibNamed:@"Cell" owner:self options:nil];
                        cell=satir;
      else
      asyncImageview* oldImage = (asyncImageview*)
                        [cell.contentView viewWithTag:999];
                        [oldImage removeFromSuperview];
              CGRect frame;
              frame.size.width=75;
              frame.size.height=75;
              frame.origin.x=0;
              frame.origin.y=0;
              asyncImageview* asyncImage = [[[asyncImageview alloc] initWithFrame:frame] autorelease];
              NSURL* url = [thumb objectAtIndex:indexPath.row];
              [asyncImage loadImageFromURL:url];
      NSLog(@"url : %@",url);
              [cell.contentView addSubview:asyncImage];
        return cell;
    but i se nothing here..what is wrong there or what can  do to load images asynchronously

    thanks for the reply..i tried like in that example before..my app is like that
    @interface FirstViewController : UIViewController
    when i change it like UITableViewController the application crashed suddenly..why is that ?

  • Tableview custom cell problem

    Hi everyone.
    I created a iOS tabbed application using xcode 4.2 and storyboard. I added one tableviewcontroller with custom cell on it, when clicking the row, I want to open one tableviewcontroller, i used the following code below
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
        categoryClass *cc = [datas objectAtIndex:indexPath.row];
        [tableView deselectRowAtIndexPath:indexPath animated:NO];
        iSubProducts *subProducts = [[iSubProducts alloc] init];
        subProducts.title = cc.categoryName;
        subProducts.catID = cc.categoryID;
        [[self navigationController] pushViewController:subProducts animated:YES];
        [subProducts release];
    but when I click the row it gives me the following error:
    *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath
    on my iSubProducts tableviewcontroller, i have the following:
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
        static NSString *CellIdentifier = @"myCell2";
        iSubProductsCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        productSubClass *cc = [datas2 objectAtIndex:indexPath.row];
        NSLog(@"Product Name: %@", cc.productName);
        cell.txtProductName.text  = cc.productName;
        cell.txtProductDesc.text = cc.productDesc;
        return cell;
    I assume this is where the error occurs, the cell is returning a nil value. When I try to attach the iSubProducts tableviewcontroller using or from a button, it all works fine, but if its coming from row clicked, this error shows up.
    Im quite new with iOS development, and maybe there is a error opening tableviewcontroller from a tableviewcontroller with a custom cell on it. I've been bangin my head for 2 days now and googled a lot, unfortunately I didn't find any solution. I'm pretty sure there's no error on the iSubProducts tableviewcontroller since its working if i tried pushing it from a button. Please I need advice on this one, Im so stucked right now with this issue. Thank you everyone.

    Hi,
    you need to create a tableViewCell in case the dequeueReusableCell-call doesn't return one.
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
        static NSString *CellIdentifier = @"myCell2";
        iSubProductsCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil)
            cell = (iSubProductCell *)[[UITableViewCell alloc] init....
        productSubClass *cc = [datas2 objectAtIndex:indexPath.row];
        NSLog(@"Product Name: %@", cc.productName);
        cell.txtProductName.text  = cc.productName;
        cell.txtProductDesc.text = cc.productDesc;
        return cell;
    Dirk

  • Why does a UITableView cell.contentView.bounds.size.width change with cell reuse?

    I use `cell.contentView.bounds.size.width` to calculate the position of a text field in a UITableView cell. When the cell is created, debug code reports the width as 302. When the cell scrolls off the screen and then back on, the debug code reports that the it is 280--every time. It doesn't seem to want to go back to 302 and stays stuck at 280. The net result is that the text field gets put in the wrong place the second time the field is put into the cell's contentView, though it was put in the right place the first time.
    I figure 22 is significant somehow, but I don't know what it is. Guessing it might be the disclosure arrow, I moved the "clear the cell" code up front of the width determination, including setting the accessory to nada.
    Can anybody tell me what's going on here?
    The code (with irrelevant--that I know of--stuff snipped out) looks like this:
    <code>
        // Customize the appearance of table view cells.
        - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
            static NSString *CellIdentifier = @"Cell";
                  NSUInteger section = [indexPath section];
                  NSUInteger row = [indexPath row];
            UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
            if (cell == nil) {
                cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
            // Configure the cell.
            while( [cell.contentView.subviews count] ){
                id subview = [cell.contentView.subviews objectAtIndex:0];
                [subview removeFromSuperview];
            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        8< snip!
                  CGFloat          theCellWidth = cell.contentView.bounds.size.width - 44.0;
                  CGFloat theLineHeight = [[UIFont boldSystemFontOfSize: [UIFont labelFontSize]+1.0] lineHeight];
            NSLog(@"cell.contentView.bounds.size.width %1.0f",cell.contentView.bounds.size.width);
            if (0==section) {
                            switch (row) {
                                      case 2:
                        while( [cell.contentView.subviews count] ){
                            id subview = [cell.contentView.subviews objectAtIndex:0];
                            [subview removeFromSuperview];
                        cell.selectionStyle = UITableViewCellSelectionStyleNone;
                                                cell.textLabel.text = @" ";
                                                cell.detailTextLabel.text = @"The Age";
                                                theAgeTextField.frame = CGRectMake(10.0, 2.0, theCellWidth, theLineHeight);
        //                NSLog(@"cell.contentView %@",cell.contentView);
                                                theAgeTextField.text = theAge;
                                                theAgeTextField.font = [UIFont boldSystemFontOfSize: [UIFont labelFontSize]+1.0];
                                                theAgeTextField.keyboardType = UIKeyboardTypeDecimalPad;
                                                theAgeTextField.borderStyle = UITextBorderStyleNone;
                                                theAgeTextField.userInteractionEnabled = NO;
                                                [cell.contentView addSubview:theAgeTextField];
                                                cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
                                                break;
        8< snip! (lots of closing braces and other stuff omitted)
            return cell;
    <hr>
    </code>
    **Want to try this one at home, boys and girls?**
    Start with a new Navigation-based Application. Put the following code into RootViewController.m:
    <code>
        - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
            return 5;
        // Customize the appearance of table view cells.
        - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
            static NSString *CellIdentifier = @"Cell";
            UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
            if (cell == nil) {
                cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
            NSLog(@"cell.contentView.bounds.size.width %1.0f",cell.contentView.bounds.size.width);
            // Configure the cell.
            return cell;
    </code>
    There are only two changes in the default code required to make this happen: changing the number of rows in the section ("return 5") and the style of the cell must be _UITableViewCellStyleSubtitle_. Then, when you run the program, you'll see five lines of this:
    <code>
        2011-06-18 11:10:19.976 TestTableCells[7569:207] cell.contentView.bounds.size.width 302
        2011-06-18 11:10:19.978 TestTableCells[7569:207] cell.contentView.bounds.size.width 302
        2011-06-18 11:10:19.979 TestTableCells[7569:207] cell.contentView.bounds.size.width 302
        2011-06-18 11:10:19.980 TestTableCells[7569:207] cell.contentView.bounds.size.width 302
        2011-06-18 11:10:19.982 TestTableCells[7569:207] cell.contentView.bounds.size.width 302
    </code>
    Drag some cells off the screen (drag up--down doesn't do anything) and when they reappear, you get this:
    <code>
        2011-06-18 11:10:24.013 TestTableCells[7569:207] cell.contentView.bounds.size.width 320
        2011-06-18 11:10:24.047 TestTableCells[7569:207] cell.contentView.bounds.size.width 320
        2011-06-18 11:10:24.130 TestTableCells[7569:207] cell.contentView.bounds.size.width 320
    </code>
    Frankly, I'm frustrated as heck with this, and am so very tempted to pony up the $99 (without a working app, even) so I can have somebody at Apple weigh in on this one.
    <hr>
    Wanna' see something more interesting? Try this in place of the `static NSString...` line:
    <code>
            NSString *CellIdentifier = [NSString stringWithFormat: @"%d", arc4random() ];
            NSLog(@"%@",CellIdentifier);
    </code>
    Now, every time, the width in the log is _always_ 302. It would seem, then, that a reused cell has different content width than the original cell.
    Anybody got a clue on this?

    Hi,
    i guess the reason is that a newly create cell is create with a default frame by initWithStyle:
    But it's not yet added to any superview so you're logging that default size.
    After returning the new cell the tableViewController adds that cell as subview to the tableView which can lead to a resize of that cell.
    If the cell is scrolled off screen it's just removed from superview but stays the same size. If it's reused later it's still having the same size it had when removed from superview.
    Dirk
    initWithStyle:
    But it's not

  • How to dismiss keyboard for an invisible table cell (iPhone)?

    I have a table cell contains a textfield, and I scroll the tableview to make the cell invisible.
    When I switch to another view, I want to dismiss the keyboard. But app crash when I call [theTextField resignFirstResponder], as the textfield seems invalid.

    Hi,
    I have used the following KMs in my transformation with the following options:
    IKM SQL Incremental Update
    INSERT    <Default>:true
    UPDATE    <Default>:true
    COMMIT    <Default>:true
    SYNC_JRN_DELETE    <Default>:true
    FLOW_CONTROL    <Default>:true
    RECYCLE_ERRORS    <Default>:false
    STATIC_CONTROL    <Default>:false
    TRUNCATE    <Default>:false
    DELETE_ALL    <Default>:false
    CREATE_TARG_TABLE    <Default>:false
    DELETE_TEMPORARY_OBJECTS     <Default>:true
    LKM SQL to SQL
    DELETE_TEMPORARY_OBJECTS    <Default>:true
    CKM Oracle
    DROP_ERROR_TABLE    <Default>:false
    DROP_CHECK_TABLE    <Default>:false
    CREATE_ERROR_INDEX    <Default>:true
    COMPATIBLE    <Default>:9
    VALIDATE    <Default>:false
    ENABLE_EDITION_SUPPORT    <Default>:false
    UPGRADE_ERROR_TABLE    true

  • Passing data to tableview

    Hi,
    i want to display the data fetched from a database (SQL) table in Tableview using jsp dynpage.i got sample only for static datas using vector in help.sap
    If anybody have any links or sample codes pls give here.
    /Points will be rewarded for helpful answers/
    Thanks & Regards,
    Art Tech.

    > Hi,
    >
    > Thanks for ur reply.Could u tell me some more detaily
    > how to pass the retrieved data to tableview if
    > possible with coding example.
    >
    > Thanks & regards,
    > ArtTech
    Hi,
    Example :
    public UserInfoBean implements serialazable {
        public String deptName="";
        public String firstName = "";
        //write the getter and setter methods
    public dataBean getDate(Conn){
        // make the connection
         while (rs.next()){
               dataBean.setDeptName(rs.getString("DEPTName"));
               dataBean.setFirstName(rs.getString("FName"));
        return dataBean;
    data.jsp
      <jsp:useBean id="userInfo" scope="request"
         class="packageName.UserInfoBean">
          </jsp:useBean>
    Dept Name : <input type="text" id="deptName" value="<%= userInfo.getDeptName() %>"/>
    First Name : <input type="text" id="fName" value="<%= userInfo.getFName() %>"/>
    I Think now retrieving data from database storing in a bean and then displaying the jspDynpage is clear.
    Thanks
    ritu

  • Refreshing TableView (or recall CellValueFactory)

    Hi,
    I have a similar use case as in my code sample:
    In my TableView I have a cell value factory which returns a value, which is dependent on some other values. When this other value changes, I want to refresh the TableView (or recall the cell vallue factory).
    If you run the code, click the "Add" button. The cell value factory for column2 should then return "true", but the view is not updated unless I sort the columns.
    I tried tableView.requestLayout(); but with no success.
    import javafx.application.Application;
    import javafx.beans.property.SimpleBooleanProperty;
    import javafx.beans.property.SimpleStringProperty;
    import javafx.beans.value.ObservableValue;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    import javafx.util.Callback;
    public class TestApp2 extends Application {
        public static void main(String[] args) {
            Application.launch(args);
        private ObservableList<String> someOtherStrings = FXCollections.observableArrayList();
        private ObservableList<String> items = FXCollections.observableArrayList("String1", "String2");
        @Override
        public void start(Stage stage) throws Exception {
            VBox root = new VBox();
            TableView<String> tableView = new TableView<String>();
            tableView.setItems(items);
            TableColumn<String, String> column1 = new TableColumn<String, String>("Value");
            column1.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<String, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(TableColumn.CellDataFeatures<String, String> stringStringCellDataFeatures) {
                    return new SimpleStringProperty(stringStringCellDataFeatures.getValue());
            TableColumn<String, Boolean> column2 = new TableColumn<String, Boolean>("Boolean");
            column2.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<String, Boolean>, ObservableValue<Boolean>>() {
                @Override
                public ObservableValue<Boolean> call(TableColumn.CellDataFeatures<String, Boolean> personStringCellDataFeatures) {
                    return new SimpleBooleanProperty(someOtherStrings.contains(personStringCellDataFeatures.getValue()));
            Button button = new Button("Add");
            button.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent actionEvent) {
                    // TableView should update after this.
                    someOtherStrings.add("String1");
            tableView.getColumns().addAll(column1, column2);
            root.getChildren().addAll(tableView, button);
            Scene scene = new Scene(root);
            stage.setScene(scene);
            stage.show();
    }

    Try
            column2.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<String, Boolean>, ObservableValue<Boolean>>() {
                @Override
                public ObservableValue<Boolean> call(final TableColumn.CellDataFeatures<String, Boolean> personStringCellDataFeatures) {
                    //return new SimpleBooleanProperty(someOtherStrings.contains(personStringCellDataFeatures.getValue()));
                  return new BooleanBinding() {
                    {super.bind(someOtherStrings);}
                    @Override
                    public boolean computeValue() {
                      return someOtherStrings.contains(personStringCellDataFeatures.getValue());
            });

  • Cell.text with multi line content

    Hello anybody.
    Here is my code .
    story_title = [[NSMutableArray alloc] init];
    scripture_location = [[NSMutableArray alloc] init];
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    cell.text = [story_title objectAtIndex:indexPath.row];
    cell.lineBreakMode = UILineBreakModeWordWrap;
    cell.text = [scripture_location objectAtIndex:indexPath.row];
    return cell;
    How can i make multi line in single cell . My code is diplayed last array list content. The line break is not working.
    Please help me with example
    Nalan.

    Double click on the text box and look in properties. There are many different options there including text wrap.
    (of course I'm referring to a form field and not a bunch of text that was included in the original document)

  • Re-using table cells

    If I deque a cell for reuse, will it retain the CGRect? using which it was initialized earlier...
    here is the code ...
    CGRect *frame = CGRectMake(10.0, 0.0, 220.0, 25.0);
    UILabel *value;
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"someID"];
    if (cell == nil)
    cell = [[[UITableViewCell alloc] initWithFrame:frame reuseIdentifier:@"SomeID"] autorelease];
    value = [[[UILabel alloc] initWithFrame:frame] autorelease];
    value.font = [UIFont systemFontOfSize:12.0];
    value.textAlignment = UITextAlignmentCenter;
    value.textColor = [UIColor blackColor];
    value.lineBreakMode = UILineBreakModeWordWrap;
    value.font = [UIFont systemFontOfSize:14.0];
    value.text = @"old text";
    else {
    value = [[[UILabel alloc] initWithFrame:frame] autorelease];
    value.font = [UIFont systemFontOfSize:12.0];
    value.textAlignment = UITextAlignmentCenter;
    value.textColor = [UIColor blackColor];
    value.lineBreakMode = UILineBreakModeWordWrap;
    value.font = [UIFont systemFontOfSize:14.0];
    value.text = @"new text";
    [cell.contentView addSubview:value];
    The problem in my app is when it reloads the table, the contents' positions gets changed.

    http://apptools.com/examples/tdcolor.php
    HTH
    "Doc_666" <[email protected]> wrote in
    message
    news:ggol0a$41q$[email protected]..
    > Hi to all
    >
    > I manage a fairly large website that I have generated
    from scratch a few
    > years
    > ago. I have always tightly controlled the layout and
    text formats through
    > CSS,
    > but am now being ?forced? to use a corporate-type
    template with an
    > incredibly
    > slow and cumbersome online editor. I am in the process
    of re-creating the
    > template with DW so that I have local control and much
    easier
    > design/coding
    > tools. One of the thing I need to re-create is a
    rollover nav bar that
    > re-sizes
    > when the text size is increased by the user and
    stretches with different
    > window
    > sizes and screen sizes ?etc. I propose to use a table
    layout to allow this
    > re-sizing to happen, but can find no way of using
    individual cells within
    > the
    > table as rollover buttons. I?d appreciate some help in
    trying to figure
    > out how
    > best to achieve this effect.
    >
    > Thanks in advance
    >
    > Doc
    >
    >

  • TableView doesn't scroll after using pushviewcontroller

    have tabbarcontroller application. In which on first tab itself I have table view. I haven't added anything to NIB file. I have just created subclass of UITableViewController. My cells are custom. It does show the table with proper values.
    But on didSelectRow: method, I have called pushViewController. Once I press back from pushViewController and come back to original screen and start scrolling, my application terminates.
    Can anyone please help me out for this?
    //Code
    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    static NSString *CellIdentifier = @"Cell";
    CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil)
    cell = [[[CustomCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    // Configure the cell...
    NSString *TitleValue = [listOfTitles objectAtIndex:indexPath.row];
    cell.primaryLabel.text = TitleValue;
    NSString *DateValue = [listOfDates objectAtIndex:indexPath.row];
    cell.secondaryLabel.text = DateValue;
    NSString *descValue=[listOfDesc objectAtIndex:indexPath.row];
    cell.thirdlabel.text = descValue;
    if([unreadFlag objectAtIndex:indexPath.row] == @"0")
    cell.primaryLabel.font = [UIFont boldSystemFontOfSize:15.0];
    else {
    cell.primaryLabel.font = [UIFont systemFontOfSize:15.0];
    return cell;
    //[CustomCell release];
    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    return 105;
    #pragma mark -
    #pragma mark Table view delegate
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    CustomCell *testcell = [tableView cellForRowAtIndexPath:indexPath];
    testcell.primaryLabel.font = [UIFont systemFontOfSize:15.0];
    [unreadFlag replaceObjectAtIndex:indexPath.row withObject:@"1"];
    selectedNS = [listOfIds objectAtIndex:indexPath.row];
    //Initialize the detail view controller and display it.
    DetailViewController *dvController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:[NSBundle mainBundle]];
    dvController.selectedNS=selectedNS;
    [self.navigationController pushViewController:dvController animated:NO];
    [dvController release];
    dvController = nil;
    testcell.primaryLabel.font = [UIFont systemFontOfSize:15.0];
    [testcell release];
    - (UITableViewCellAccessoryType)tableView:(UITableView *)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath {
    //return UITableViewCellAccessoryDetailDisclosureButton;
    return UITableViewCellAccessoryDisclosureIndicator;
    - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
    [self tableView:tableView didSelectRowAtIndexPath:indexPath];
    Thank you,
    Ankita

    Hi: That happened to me too on my HP 350 G1. On mine, I went into the control panel, and I changed the view to Large Icons (because it is easier for me to find stuff that way). Then I found a Synaptics Luxpad control panel icon. I clicked on that and found that the scrolling feature was unchecked. I checked it, hit apply and close and now I can scroll again.

  • Crashed when call [tableView reloadData]

    Hi guys.
    I am facing with problem related UITableView. Below report has been displayed on the console.
    GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB. Type "show warranty" for details.
    This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all
    Attaching to process 2706.
    kill
    error while killing target (killing anyway): warning: error on line 1987 of "/SourceCache/gdb/gdb-966/src/gdb/macosx/macosx-nat-inferior.c" in function "macosxkill_inferiorsafe": (os/kern) failure (0x5x)
    Current language: auto; currently objective-c
    quit
    The Debugger has exited with status 0.(gdb)
    In MyViewController.h
    @interface MyViewController : UIViewController <UITableViewDataSource, UITableViewDelegate> {
    IBOutlet UITableView *uiTableView;
    NSMutableArray *tableData;
    @property (nonatomic, retain) NSMutableArray *tableData;
    @property (nonatomic, retain) UITableView *uiTableView;
    @end
    In MyViewController.m
    - (void)viewDidLoad {
    tableData = [[NSMutableArray alloc] init];
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)aTableView {
    return 1;
    - (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section {
    return [tableData count];
    - (UITableViewCell *)tableView:(UITableView *)tableView
    cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
    reuseIdentifier:CellIdentifier] autorelease];
    NSUInteger row = indexPath.row;
    NSString *text = [[NSString alloc] initWithFormat@"%@", [tableData objectAtIndex:row]];
    cell.textLabel.text = text;
    [text release];
    return cell;
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    @end
    in MyConnection.m // This is implementation of NSURLConnection
    - (void)addTextInArray
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    [self performSelectorOnMainThread:@selector(addRow) withObject:nil waitUntilDone:YES];
    [pool release];
    - (void)addRow
    [tableController.tableData addObject:@"text in row"];
    - (void) updateTable {
    [tableController.uiTableView reloadData];
    After all texts has been added, application calls updateTable.
    At this moment, application crashed. In order word,
    - (UITableViewCell *)tableView:(UITableView *)tableView
    cellForRowAtIndexPath:(NSIndexPath *)indexPath
    It crashed in above method.
    Please help me guys,
    What is wrong me ?
    Thanks in advance.

    Thank you. Ray.
    First,
    NSLog(@"updateTable: isMainThread=%d", [NSThread isMainThread]);
    in console:
    2009-11-18 18:37:23.440 MyApplication[5412:20b] updateTable: isMainThread=1
    2009-11-18 18:37:23.445 MyApplication[5412:20b] updateTable: isMainThread=1
    2009-11-18 18:37:23.446 MyApplication[5412:20b] updateTable: isMainThread=1
    NSLog(@"cellForRow: isMainThread=%d", [NSThread isMainThread]); // add
    NSLog(@"--> tableData.count=%d row=%d", [_courseDetailList count], indexPath.row); // add
    2009-11-18 18:37:23.450 MyApplication[5412:20b] cellForRow: isMainThread=1
    2009-11-18 18:37:23.450 MyApplication[5412:20b] --> tableData.count=3 row=0
    2009-11-18 18:37:23.453 MyApplication[5412:20b] cellForRow: isMainThread=1
    2009-11-18 18:37:23.453 MyApplication[5412:20b] --> tableData.count=3 row=1
    2009-11-18 18:37:23.454 MyApplication[5412:20b] cellForRow: isMainThread=1
    2009-11-18 18:37:23.454 MyApplication[5412:20b] --> tableData.count=3 row=2
    GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB. Type "show warranty" for details.
    This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all
    Attaching to process 5412.
    kill
    error while killing target (killing anyway): warning: error on line 1987 of "/SourceCache/gdb/gdb-966/src/gdb/macosx/macosx-nat-inferior.c" in function "macosxkill_inferiorsafe": (os/kern) failure (0x5x)
    quit
    The Debugger has exited with status 0.(gdb)
    *Second, I've post the code below*
    My application is navigation based application. It connects with the server, then it downloads data and displays it as table.
    //MyApplicationAppDelegate.h
    #import <UIKit/UIKit.h>
    #import "MyNSURLConnection.h"
    @interface MyApplicationAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    UINavigationController *navigationController;
    MyNSURLConnection *connectionObject;
    @property (nonatomic, retain) IBOutlet UIWindow *window;
    @property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
    @property (nonatomic, retain) MyNSURLConnection *connectionObject;
    - (void)displayTableView;
    - (void)setConnURL:(NSString *)url;
    - (void)startURLRequest;
    + (MyApplicationAppDelegate *)sharedAppDelegate;
    @end
    //MyApplicationAppDelegate.m
    #import "MyApplicationAppDelegate.h"
    #import "RootViewController.h"
    #import "MyViewController.h"
    @implementation MyApplicationAppDelegate
    @synthesize window;
    @synthesize navigationController;
    @synthesize connectionObject;
    #pragma mark -
    #pragma mark Application lifecycle
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    // Override point for customization after app launch
    navigationController.toolbarHidden = NO;
    [window addSubview:[navigationController view]];
    [window makeKeyAndVisible];
    [navigationController setToolbarHidden:YES animated:NO];
    [navigationController setNavigationBarHidden:YES animated:NO];
    connectionObject = [[MyNSURLConnection alloc] init];
    [self displayTableView];
    - (void)applicationWillTerminate:(UIApplication *)application {
    // Save data if appropriate
    - (void)displayTableView
    MyViewController *tableController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
    [self.connectionObject setTableController:tableController];
    [navigationController pushViewController:tableController animated:NO];
    [tableController release];
    NSLog(@"stack=%@", navigationController.viewControllers);
    - (void)setConnURL:(NSString *)url
    [connectionObject setUrl:url];
    - (void)startURLRequest
    [connectionObject startConnection];
    + (MyApplicationAppDelegate *)sharedAppDelegate
    return (MyApplicationAppDelegate *)[UIApplication sharedApplication].delegate;
    #pragma mark -
    #pragma mark Memory management
    - (void)dealloc {
    [navigationController release];
    [window release];
    [super dealloc];
    @end
    // MyNSURLConnection.h
    #import <Foundation/Foundation.h>
    @interface MyNSURLConnection : NSObject {
    NSString *url;
    UIViewController *tableController;
    @property (nonatomic, retain) NSString *url;
    @property (nonatomic, retain) UIViewController *tableController;
    - (void)startConnection;
    - (void)setTableController:(UIViewController *)controller;
    - (UIViewController*)getTableController;
    - (void)setRequest:(NSString *)openUrl;
    @end
    //MyNSURLConnection.m
    #import "MyNSURLConnection.h"
    #import "MyViewController.h"
    @implementation MyNSURLConnection
    @synthesize url;
    @synthesize tableController;
    - (void)startConnection
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.url]
    cachePolicy:NSURLRequestUseProtocolCachePolicy
    timeoutInterval:45];
    NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
    if(!theConnection) {
    NSLog(@"Connection failed.");
    - (void)setTableController:(UIViewController *)controller
    if(tableController != controller) {
    [tableController release];
    tableController = [controller retain];
    - (UIViewController*)getTableController
    return [[tableController retain] autorelease];
    - (void)setRequest:(NSString *)openUrl
    if(url != openUrl) {
    [url release];
    url = [openUrl retain];
    - (void)connection:(NSURLConnection *)theConnection didReceiveResponse:(NSURLResponse *)response
    NSLog(@"Response.");
    - (void)connection:(NSURLConnection *)theConnection didReceiveData:(NSData *)data
    NSMutableString *string = [[NSMutableString alloc] init];
    NSString *asData = [[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:NSASCIIStringEncoding];
    MyViewController *controller = (MyViewController *)tableController;
    NSLog(@"Data: %@", asData);
    for(int i = 0; i < [asData length] - 10; i= i+10) {
    for(int j = i; j < i + 10; j ++) {
    [string appendFormat:@"%c", [asData characterAtIndex:j]];
    [controller addRow:[[NSString alloc] initWithString:string]];
    [string setString:@""];
    [asData release];
    [string release];
    [controller.uiTableView reloadData];
    - (void)connection:(NSURLConnection *)connection
    didFailWithError:(NSError *)error
    - (void)connectionDidFinishLoading:(NSURLConnection *)connection
    @end
    //MyViewController.h
    #import <UIKit/UIKit.h>
    @interface MyViewController : UIViewController <UITableViewDataSource, UITableViewDelegate> {
    IBOutlet UITableView *uiTableView;
    NSMutableArray *tableData;
    @property (nonatomic, retain) NSMutableArray *tableData;
    @property (nonatomic, retain) UITableView *uiTableView;
    - (void)addRow:(NSString *)text;
    @end
    // MyViewController.m
    #import "MyViewController.h"
    #import "MyApplicationAppDelegate.h"
    @implementation MyViewController
    @synthesize uiTableView;
    @synthesize tableData;
    // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    - (void)viewDidLoad {
    [super viewDidLoad];
    tableData = [[NSMutableArray alloc] init];
    - (void)viewWillAppear:(BOOL)animated
    [[MyApplicationAppDelegate sharedAppDelegate] setConnURL:@"http://www.google.com"];
    [[MyApplicationAppDelegate sharedAppDelegate] startURLRequest];
    - (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
    - (void)viewDidUnload {
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)aTableView {
    // Number of sections is the number of regions
    return 1;
    - (void)addRow:(NSString *)text
    [tableData addObject:text];
    - (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section {
    return [tableData count];
    - (UITableViewCell *)tableView:(UITableView *)tableView
    cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    NSLog(@"cellForRow: isMainThread=%d", [NSThread isMainThread]); // add
    NSLog(@"--> tableData.count=%d row=%d", [tableData count], indexPath.row); // add
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
    reuseIdentifier:CellIdentifier] autorelease];
    NSUInteger row = indexPath.row;
    NSString *text = [[NSString alloc] initWithFormat:@"%@", [tableData objectAtIndex:row]];
    cell.textLabel.text = text;
    [text release];
    return cell;
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSLog(@"Selected row: %d", indexPath.row);
    - (void)dealloc {
    [super dealloc];
    @end
    Thanks in advance.

  • Crash after scrolling tableView

    Hi,
    I've got a new problem...
    I have a ViewController with a UITableView on it. In the viewWillAppear method there's a xml parse object and it returns a NSMutableArray .
    The cellForRow method looks like this:
    - (UITableViewCell *)tableView:(UITableView *)tableView
    cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"TopView"];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"TopView"] autorelease];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    Article *articleObject = [streamingParser.list objectAtIndex:indexPath.row];
    cell.text = articleObject.title;
    [articleObject release];
    return cell;
    When I scroll the table in the simulator it crashs. If I debug the program when I'm scrolling it shows me that the streamingParser.list is nil.
    Will the List deallocated after cellForRow?
    I haven't released the streamingParser object.
    THX

    I've solved the problem.
    I forgot to initialize the object for the whole viewController.
    [[NSArray alloc] init];

Maybe you are looking for

  • Not able to load data in 0MATERIAL_ATTR

    Hi , For Infoobject 0MATERIAL I am maintaining both attribute and text. I am able to load text into 0MATERIAL successfully. But, when I am trying to load datasource 0MATERIAL_ATTR, I am getting error 'DataSource 0MATERIAL_ATTR(ECCCLNT711) must be act

  • Unable to read Simplified Chinese in downloaded excel

    Hi, We are running an MDMP Simplified Chinese SAP system. After extracting some data with both English and Simplified Chinese and saving it as excel file, we are not able to view the Simplified Chinese characters when it is opened in MS Excel.  "Garb

  • IOS App Store purchase buttons greyed out

    So, we have two iphones and two iPads.  Today, I upated one of the iPads to 6.0.1 and now, in the APP STORE, all the purchase buttons are screwed up.  First, they are no longer rectangle - they are square and only showing the first few letters.  Seco

  • Apps crash when MacBook not connected to external monitor

    I have been using my macbook connected to a Samsung T240M 24 inch monitor/tv for several months now with no problems at all until 2 days ago. Everything functions perfectly when the computer is connected to the external monitor, however, when I disco

  • Apple TV is NOT Full Screen

    My Apple TV stopped showing anything in full screen.  It is plugged into an HDMI port on my TV.  None of the apps, such as Netflix, or movies thru AirPlay play in full screen.  I have tried all of the settings, including a total reset of the Apple TV