cancel
Showing results for 
Search instead for 
Did you mean: 

TableView: multiselect - Suppress the checkboxes for selection

08-24-2004 2:01 PM
855 views 15 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hello,

I have a TableView with mulitselect.

Can I suppress the first column with the checkboxes for the line-selection?

Does anybody know about this problem.

Thanks for any advice or path for more information.

Kind Regards

Petra

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Petra,

I suggest you choose SELECTIONMODE as "MULTILINEEDIT" and then fill the table SELECTEDROWINDEX with alll the lines of your Tableview.. for example:

<htmlb:tableView id = "tvmyTAB"

footerVisible = "FALSE"

table = "//mdl_TAB/TT_TABLE"

selectionMode = "MULTILINEEDIT"

allRowsEditable = "false"

iterator = "<%= mdl_TAB->itr_tab %>"

selectedRowIndexTable = "<%= mdl_TAB->selrowtab_TT_TABLE %>"

headerVisible = "false"

visibleRowCount = "150"

width = "100%" >

selrowtab_TT_TABLE will be of Table type of INT4 and the values will be 1, 2, 3, 4,5 and so on..

hope thsi helps..

Former Member
0 Likes

I'm not at work but does this code disable the selection checkboxes that are appened as the first column of a table when selected for MULTISELECT?


<htmlb:tableView id = "tvmyTAB"
      footerVisible = "FALSE"
              table = "//mdl_TAB/TT_TABLE"
      selectionMode = "MULTILINEEDIT"
    allRowsEditable = "false"
           iterator = "<%= mdl_TAB->itr_tab %>"
 selectedRowIndexTable = "<%= mdl_TAB->selrowtab_TT_TABLE %>"
      headerVisible = "false"
    visibleRowCount = "150"
              width = "100%" />

Former Member
0 Likes

Akshaya Rao, your code does not actually supress or "remove" that first column of checkboxes however.

Petra,

What you can do is set each column you want the user to edit as "editable" in your Iterator or columnDefinitions then add a button for saving.

Sample code from SBSHTMLB_TABLE, TableViewAllRowsEditable.bsp


      <%
        data: columnDefinitions type TABLEVIEWCONTROLTAB,
              wa                type TABLEVIEWCONTROL.

        wa-COLUMNNAME          = 'carrid'.
        wa-EDIT                = 'X'.
        wa-width               = '33%'.
        APPEND wa TO columnDefinitions.

        CLEAR wa.
        wa-COLUMNNAME          = 'connid'.
        wa-width               = '34%'.
        APPEND wa TO columnDefinitions.

        CLEAR wa.
        wa-COLUMNNAME          = 'seatsmax'.
        wa-EDIT                = 'X'.
        wa-width               = '33%'.
        APPEND wa TO columnDefinitions.

      %>
      <htmlb:tableView id                = "test"
                       selectionMode     = "none"
                       filter            = "server"
                       columnDefinitions = "<%= columnDefinitions %>"
                       table             = "<%= sflight %>"
                       width             = "100%"
                       visibleRowCount   = "8"
                       iterator          = "<%=iterator%>"
                       allRowsEditable   = "X"/>

Answers (2)

Answers (2)

Former Member
0 Likes

Hi Petra,

From my understanding it is not possible to suppress the automatic checkboxes when using the tableView.

Have you checked out the SBSHTMLB_TABLE example provided in se80, I will look at work tomorrow to see if I can see a way as well.

Former Member
0 Likes

Hi Petra,

How your users will multi-select items in tableView?

Dany

Former Member
0 Likes

Hi Dany,

In a tableView you can set a selection mode


<htmlb:tableView id="myTable"
                 table="<%=data%>"
                 selectionMode="MULTISELECT"
                 onRowSelection="MyRowSelect" />

Just do a F1 on the attribute "selectionMode" in the Tag Browser in SE80 for more info.

Former Member
0 Likes

Hi Craig,

<i>> Just do a F1 on the attribute "selectionMode" in the Tag Browser in SE80 for more info.</i>

Really? 😄

The question was: if you set the selectionMode attribute to MULTISELECT and, contemporary, you wan't your users don't see any checkbox, how they can multi-select rows they are seeing?

Then set selectionMode attribute directly to NONE.

Simply this.

Dany

Former Member
0 Likes

Dany, I'm sorry but what you just wrote doesn't make sense.

Petra, and do correct us if we are wrong. Wants to have the user able to edit or select multiple rows. However to do this she has to use MULTISELECT or MULTILINEEDIT and she doesn'T want the checkboxes in the first column that are automatically appended.

Therefore she basically has one choice in order to give the user the ability to choose what to edit and not have the checkboxes -> see my code above

Or do you have another code sample that works?

Former Member
0 Likes

Hi Craig,

No I haven't.

Excuses.

Dany

Former Member
0 Likes

Come on Dany, after the nice piece of code you did in another message - no ideas?

That was the only one I came up with but who knows maybe there is another possiblity

Former Member
0 Likes

Okay,

Then Render all rows and Columns using inputfields( width 100%)using the Iterator and then have the Selection Mode = NONE and all rows editable = TRUE.

I know we use it a couple different places at work. Mix and match few combinations and we can it to work.

'Shay

For example :

Try this Code in the IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS method

 

Message was edited by: Akshaya Rao

Former Member
0 Likes

Well Petra, it looks as though everyone seems to agree so I'll post the code for you again.

Sample code from SBSHTMLB_TABLE, TableViewAllRowsEditable.bsp


      <%
        data: columnDefinitions type TABLEVIEWCONTROLTAB,
              wa                type TABLEVIEWCONTROL.

        wa-COLUMNNAME          = 'carrid'.
        wa-EDIT                = 'X'.
        wa-width               = '33%'.
        APPEND wa TO columnDefinitions.

        CLEAR wa.
        wa-COLUMNNAME          = 'connid'.
        wa-width               = '34%'.
        APPEND wa TO columnDefinitions.

        CLEAR wa.
        wa-COLUMNNAME          = 'seatsmax'.
        wa-EDIT                = 'X'.
        wa-width               = '33%'.
        APPEND wa TO columnDefinitions.

      %>
      <htmlb:tableView id                = "test"
                       selectionMode     = "none"
                       filter            = "server"
                       columnDefinitions = "<%= columnDefinitions %>"
                       table             = "<%= sflight %>"
                       width             = "100%"
                       visibleRowCount   = "8"
                       iterator          = "<%=iterator%>"
                       allRowsEditable   = "X"/>

I don't think you'll get any other choice. But you don't need inputfields as marking the column to "EDIT" will let you edit inline.

Former Member
0 Likes

Akshaya Rao is correct the better way would be to create an Iterator for this but the easy way to test would be just making the columnDefintions on your page first.

Akshaya Rao remember the C in code is a small letter c if you can edit that and correct it then perhaps Petra might get another good example of code to try.

Former Member
0 Likes

Hi all,

thanks for your answers.

The user must be select the lines and I build the tableView with mulitselect.

Kind regards,

Petra

Former Member
0 Likes

Yes the user must select the lines and with MULTISELECT they can select more than one line at a time.

Please remember to reward points on all of your messages for helpful and verys helpful answers not just "Problem Solved"