Can you select the row in a table view without highlighting the cell?

I have an an app with a table view which is presented modally. Cell selections in this table are saved in the parent controller so that they can be reselected if the table is reloaded after being dismissed.
When the cell is first highlighted, I want to momentarily highlight the cell and have it fade out, which I do by unselecting the cell from the modal view controller's didSelectRowAtIndexPath by calling setSelected:animated on the table view cell.
However, when I present the table view controller modally again and want to display the previously selected cell as selected, I don't want the cell background to be highlighted, and I'm having trouble doing this.
In order to make sure the table view knows the cell is selected, I am calling selectRowAtIndexPath. I need to make sure the cell is selected so that I can set/unset the cell's accessoryType. However, this has the sideeffect of highlighting the cell too, which looks weird and confusing to the user.
I've tried things like temporarily setting the cell's selection style to none, but while that stops the cell background from highlighting? I've tried setting the selectionStyle to UITableViewSelectionStyleNone, but while this prevents the cell background from highlighting, the cell text still changes to white, so it the text is invisible against the white background.
Is there a easy way of setting a cell to selected in the table view without also changing the highlight and text colour of the actual cell? Immediately setting the cell to be unselected still makes the highlight visible for a split second.

I tried that, but setting the highlighted property doesn't seem to affect it.
I figured out how what I was doing wrong though. I was setting selection style UITableViewSelectionStyleNone, selecting the cell, then setting the selection style back to whatever it had previously been. This causes the background not to draw highlighted, but the text and accessory type to still draw highlighted.
In order to fix this, I moved the code to set the cell selection style to whatever it had previously been to the didDeselectRowAtIndexPath method.

Similar Messages

  • To insert a new row in a table control without affecting the other rows

    Halo experts,
    I have a Table control TCTRL in a program .
    The lt_tab contains two cols A and B
    In change mode of the transaction Col A is in display mode and Col B is in change mode
    When i press the + button to insert a new blank entry .I need a blank row with both col A and col B input enabled w/o affecting the display of above and below rows of table control
    In PBO module of subscreen 101
    LOOP AT lt_tab  WITH CONTROL tctrl.
    MODULE tctrl_status.
    endloop.
    In the user command of 0101
    i am writn
    When 'INS'.
    INSERT INITIAL LINE INTO itab.
    Inside MODULE tctrl_status.
    IF lt_tab IS INITIAL.
        LOOP AT SCREEN.
          IF screen-name = 'COLA'.
          screen-input = 1.
      ENDIF.
        ENDLOOP.
          MODIFY SCREEN.
    endif.
    but the problem here is still the Col A is in display mode and Col B is in change mode after output
    .Here modify statement is happening but it does not update the TCTRL-COLS-Screen structure for the col A ( which I have set statically while designing the screen ).I dont want to make the entire row in edit mode only the inserted row ( for both Col A and Col B) and the rest shud remain as it is
    Thanks
    Kallu

    hi Naveen
    I have made my tctrl input disabled for both the columsn and
    I have a module before the PBO loop where I set the like
    module set_tctrl_status.
    IF gv_ok_code NE gc_disp.
        LOOP AT tctrl-cols INTO gs_cols.
          IF gs_cols-screen-name = 'ColB'.
            gs_cols-screen-input = 1.
            MODIFY tctrl-cols FROM gs_cols INDEX sy-tabix.
          ENDIF.
        ENDLOOP.
    This is just to set the Col B in edit mode when in change and create status.
    But if i press the INS button for that change i am coding inside the loop endloop of the pBO like
    if itab is initial.
    LOOP AT tctrl-cols INTO gs_cols.
    gs_cols-screen-input = 1.
    MODIFY tctrl-cols FROM gs_cols INDEX sy-tabix.
    endloop.
    But the problems i it is setting the enite rows as input enabled . I want tos et only that row inpur enabled

  • Can you change your iphone to a new account, without wiping the phone?

    Hi
    I have a macbook pro and an iphone and my mum has an iphone. But the problem is that my mums iphone is hooked up with my itunes account and i want to create her, her own. We use separate laptops, but im sick of not being able to use imessages or icloud, as i dont want out stuff to get merged. Is it possible to do this without wiping her iphone? she wants to keep her notes, message, photos, etc. is it also possible to transfer my itunes music libary to this new account?

    Specifically I'm looking to keep all my photo's on the phone.

  • Select discontiguous rows in a table with the keyboard

    I am using jdk 1.3.1 and have tried this on 1.4 as well. I don't seem to be able to select discontiguous rows in a table using the keyboard. I can Ctrl-click with the mouse to do this but can't find a way to do this with the keyboard. I searched and found somebody asked this same question before and the reply was it works in 1.3.1. I am not seeing this. What could I be missing? The Ctrl-Up and Ctrl-Down keys don't do anything and neither does the spacebar.

    I'm pretty sure you can't do this using the standard JTable interface.
    You might be able to write your own keyboard listener and fake focus events for up&down arrow, but making this work seamlessly with JTable seemss like it would not be trivial.

  • Selecting multiple rows in a table

    Hi All,
    I have one problem with selecting multiple rows in a table.I tried with setting table property-selectionMode as Multi, but i dinn't get the solution.
    please provide me solution for this.
    Thanks & Regards,
    Sreelakshmi.

    HI
    Int leadSelection = wdcontext.nodemodelnode.getLeadSelection();
      for(int i=0;i<wdcontext.nodeModelNode.size;i++)
        if(wdcontext.nodeModelNode.isMultiselected(i) || leadSelection ==i)
               String name = wdcontext.nodemodelnode.getnameelementatindex(i).getName();
               String  address = wdcontext.nodemodelnode.getaddresselementatindex(i).getAddress();
               String age = wdcontext.nodemodelnode.getAgeelementatindex(i).getAge();
            Create a method for the Table Property onLeadSelect() where you can open a popup window
             Create a value node and with attributes same as Table attributes and then set the values of the table
             to the value node attributes.
    Thanks

  • Dynamic Select of Row in a table in webdynpro Abap

    Hi,
      I have an requirement, I have an table  and a button, I need to select a row in a table based on button action.
    For example : in a table i have 3 rows. I am submiting a value in a button, I want to see that row highlighted for the value I am sending through button.
    Please let us know the code how to implement this.
    Thanks

    Hi,
    First you have to go to table and set its property "SELECTION MODE" to single or multi lead depending on ur need.
    Then in the ACTION of the button you can use the following code to get the values in the selected row.
    DATA:
         node to get table node for finding no. of rows
            lo_nd_one  TYPE REF TO if_wd_context_node,
         Get selected row for finding no. of rows
       it_table               TYPE        wdr_context_element_set,
         workarea to get selected row
            wa_table                LIKE LINE OF           it_table,
    To get the Selected line item into an internal table
      CALL METHOD lo_nd_one->get_selected_elements
        RECEIVING
          set = it_table.    " data in internal format
      IF it_table[] IS NOT INITIAL.
      type conversion for work area
        READ TABLE it_table INTO wa_table INDEX 1.
    if a row is present
        IF  sy-subrc IS INITIAL.
        Get the values of each attribute
          CALL METHOD wa_table->get_static_attributes
            IMPORTING
              static_attributes = wa_final.       "<Selected data in work area.>  ---> this will have your data
        ENDIF.
    Here wa_final is the work area which is of your table fields type.
    This wa_final will have the selected row.

  • How do i select a row when a table is loaded?

    Hello Guys
    could somebody help me? I'm new to ADF and I'm trying to make a SearchPage. It works but I get this behavior:
    #1: I bound the Table with the ResultSet of a EJB-SessionBean find-Method. When the SearchPage is loaded, a the SessionBean-find-Mehod is called. I want, that the Table only shows the ResultSet when the CommandButton "Search" is clicked not on PageLoad.
    #2. In the ResultSet shown in the table no row is preselected. How can i change that?
    # 3. The Table is placed in a TabbedPanel in a showDetailItem "SearchResult". After i select a row I want to show the Details of the selected row-Object in anoteher showDetailItem "Details". How could i handle that?
    Thnx a lot for your Help!

    Hello Frank,
    thank you for responding!
    #1) I tryed #1 but i got the Exception Illegal . I followed the steps you recommended as follow:
    a) On the button "Search" add an af:setPropertyListener. It looks like this:
    <af:commandButton actionListener="#{bindings.getDelegateFindAllBySearchCriteria.execute}"
    text="Suche starten"
    disabled="#{!bindings.getDelegateFindAllBySearchCriteria.enabled}"
    id="cb1" inlineStyle="margin-left:8px;">
    <af:setPropertyListener from="#{true}" to="#{viewScope.executeOK}" type="action"/>
    </af:commandButton>
    b) Have the RefreshCondition property on the iterator in the pageDef file looking for a memory flag e.g #{viewScope.executeOk==true?true:false}. In the ExpressionBuilder I get "#{adfFacesContext.viewScope}" but not #{viewScope}
    I got an error message writing this in de pageDefinition. It accepted: #{viewScope.executeOk==true}. It is right, if TRUE -> TRUE, if FALSE -> FALSE
    The compiler says: "executeOK is an unknown property"
    After that i started the Application and got an
    <14.04.2011 16:59 Uhr MESZ> <Error> <HTTP> <BEA-101020> <[ServletContext@17109869[app:EHRCPD_PISA_TT module:EHRCPD_PISA_TT-ViewController-context-root path:/EHRCPD_PISA_TT-ViewController-context-root spec-version:2.5]] Servlet failed with Exception
    java.lang.IllegalStateException
         at oracle.jbo.uicli.binding.JUSearchBindingCustomizer.getViewCriteria(JUSearchBindingCustomizer.java:2161)
    #2) I set DisplayProperty to "selected" but it did not works. I checked the rows (they are 2) but they are the same. If i debbug the application i see, that the resultSet got from the Database (JPA) is OK. The size of the resultSet is 2 and the Objects retrieved are different. What i'm doing wrong?
    #3) This worked perfectly! Thank you!
    I hope, I get this working.
    Thnx again

  • Select all rows in af:table

    Hi,
    I need to select all rows in af:table, not only on current page.
    I have following code on custom select all action:
    getTable2().getSelectionState().addAll()and on button that needs to perform some action on selected rows I have this code
            Set selectedRowSet = getTable2().getSelectionState().getKeySet();
            if (!selectedRowSet.isEmpty()) {
                Iterator it = selectedRowSet.iterator();
                while(it.hasNext()) {
                    Key key = (Key)it.next();
           }selectedRowSet.iterator() method throws java.lang.ClassCastException: oracle.jbo.Key.
    When I select rows with af:tableSelectMany, which is inside selection facet and selects only rows on current page, this works fine.
    Any ideas?
    Thanks

    Hi,
    you can only access those data that is queried and part of the CollectionModel to the time you select all
       RichTable _table = employeesBackingBean.getEmployeeTable1();
       RowKeySet rks = new RowKeySetImpl();
      CollectionModel model = (CollectionModel)_table.getValue();
      int rowCount = model.getRowCount();
          for (int i = 0; i < rowCount; i++) {
               model.setRowIndex(i);
               //note that in the simple POJO case, the row key is the same
               //as the index. However, it would be wrong to just rely on this
               //because other models or custom table models my return a more
               //comples key. Therefore we iterate over the available rows to
               //obtain the keys.
               Object key = model.getRowKey();
               //add the row keys to the RowKeySet to mark selected
               rks.add(key);
       _table.setSelectedRowKeys(rks);
       AdfFacesContext.getCurrentInstance().addPartialTarget(_table);Frank
    Frank

  • Get only the rows where there are no matches in the tables

    To include in the results of a join with no matching rows, you can use a full outer join. In MS SQL Server provides the FULL OUTER JOIN operator, which allows you to include all rows from both tables, regardless of the presence or absence of values.
    You can add a WHERE clause in a FULL OUTER JOIN to get only the rows where there are no matches in the tables. The following query returns only those products for which there are no matches in the sales order.
    SELECT p1.Name, p2.SalesOrderID
    FROM  TAB1 p1
    FULL OUTER JOIN TAB2 p2
    ON p1.ProductID = p2.ProductID
    WHERE p1.ProductID IS NULL
    ORDER BY p.Name ;
    FULL OUTER JOIN is not supported in ABAP.  How can you solve this?
    Thanks in advance,
    Serena

    Similar problems can often be solved by using subqueries, please have a look here and try applying it.
    http://help.sap.com/abapdocu_702/en/abenwhere_logexp_subquery.htm
    Thomas

  • I am unabel to select all rows in advance table using Select All option

    Hi all ,
    I am unable to select all the rows in advance table . Select All option in advance table selects all rows present in working page but doesnt select the rows which we get by clicking next button ... i am having a requirement to select all the rows with a single click on select all , is it possible ..
    Plz help
    Thanking you all

    Hi,
    I'm using an adf table but i don't want to have the "Select All" and "Select None" options above the table. Does someone know how i have to remove those links?
    Or is there indeed a solution to override the methodes of those links?
    Message was edited by:
    Alexander

  • How to display All the rows in a Table

    Hi All,
    Our requirement is, we need to display all the records of an VO in a table. We should not have navigation bar with previous and next. Runtime only will come to know how many records the VO has. Is it possible to achieve our requirement using setNumberOfRowsDisplayed() method in OATableBean ?

    Do u want to do it declaratively or programmatically.
    Declaratively You can set no of rows property of table bean. If u want to set it programmatically then u can do it as discussed in the thread..
    Regards,
    Ram

  • Select a row from a table and throw an url

    Hi experts,
    I'm trying to select a row from a table in Visual Composer. What I need to do it's to click over this row and throw an Url. At the moment, I've added a column with a Pushbutton with the formula to show the link; it works fine. But I need to do it without buttons just selecting the row.
    Is there anyboby who knows about that?
    Thanks a lot.
    Belen

    Hi
    To do this you will have to use a data store and a guard condition on the line which is triggered by the select action. You need to store a value in the data store each time a select action is performed. The guard condition should check for this and only perform the action when the value in the data store is greater than 0.
    Jarrod Williams

  • Select multiple rows from dual table

    Is it possible to select multiple rows from dual table using a single select statement.
    i.e., i want the out put to be
    column_name
    1
    2
    3
    4
    Edited by: vidya.ramachandra on Dec 14, 2009 8:24 AM

    Aside from the fact you're responding to an old thread...
    1002424 wrote:
    While using CONNECT BY, I see it always leave behind one row.
    Suppose I have a condition based on which I have to generate constant rows like
    SELECT 1 FROM DUAL WHERE ROWNUM < N;
    Here if N = 0, still it gives out single row.... you are obviously doing something wrong in your code elsewhere, because that SQL statement does not always return a single row...
    SQL> SELECT 1 FROM DUAL WHERE ROWNUM < 0;
    no rows selected
    SQL>

  • How do you add additional rows to a table

    ...on Word of Mac?

    If you just want to add an extra row at the end of the table all you have to do is hit tab while in the last cell, shroudlupe.
    If you want to add a row in the middle or top of a table, highlight the row above or below where you want the new one to be and then go to the "Table" menu. Go down to the "insert" option and choose whichever is appropriate from "Rows below" or Rows above".
    (If you want to insert more than one row ,then select multiple rows at the first step above, rather than just one , and it will insert the same number of rows that you have selected).
    Another way of doing it, after selecting a row in a table, is to simply access the contextual menu by holding down the control key and clicking, or by "right clicking", and then select "insert rows" from the options presented.
    Cheers
    Rod

  • I had to re-install XP on my laptop. I installed itunes. Now I want to restore my music from backup CD's. But the option device under file is greyed out. I can't select restore from backup. How do I make the restore option active. I have an ipod nano

    I had to re-install XP on my laptop. I then installed itunes again. Now I want to restore my music from backup CD's. But the option device under file is greyed out. I can't select restore from backup. How do I make the restore option active? i have an IPOD nano.

    I think it's QuickTime player causing the problem, when I try to open it I get the windows error that an error has occured
    Let's try swapping out your QuickTime again, taking a few extra explicit precautions this time.
    Head into your Add/Remove programs. uninstall QuickTime.
    Next, we’ll manually remove any leftover program files and folders.
    1. On the Start menu, click My Computer (or double-click My Computer on the Desktop).
    2. In My Computer, open Local Disk.
    3. Open Program Files.
    4. Right-click on the QuickTime folder and click Delete from the shortcut menu.
    5. Navigate to C:\Windows\system32\.
    6. Remove the files QuickTime.qts and QuicktimeVR.qtx. (If “Hide filename extensions for known file types” is enabled on the PC, then those two files will appear as “QuickTime” and QuickTimeVR”.)
    7. Restart your computer.
    Now download and save a copy of the latest standalone QuickTime installer to your hard drive. (We'll run the install from there rather than online.)
    Latest Quicktime Installers … get the one that doesn’t mention iTunes
    Switch off antivirus and antispyware applications prior to the install. Start the install by doubleclicking the QuickTimeInstaller.exe.
    If that install goes through okay, restart the PC and try launching iTunes again. Does your iTunes launch properly now?
    (If you get an error message on the QuickTime uninstall or standalone reinstall, let us know what it says. Include error message numbers if you're getting any.)

Maybe you are looking for