Adding checkbox to DataTable

I want to add a check box to my data table so the user can select one or more rows for an action (Delete in this case).
Right now, I use a simple ListModel and it's using my java bean data directly.
But, my java bean data doesn't know anything about selection, and thus does not have a "selected" property.
Is there a way that I can create a parallel check box array or something that ties in with my list of rows so I don't have to create a new "checkbox aware" bean for my data?

Just add a new property to the DTO, you don't need to do it in your backing bean.
Also see http://balusc.xs4all.nl/srv/dev-jep-dat.html#SelectMultipleRows

Similar Messages

  • Design problem with dynamically added row in datatable

    Hello all,
    I have a dataTable and have developped a method that dynamically adds rows to the dataTable. Each row is made up of two form controls. The problem I have now is that I don't know how to retrieve the values from the mutiple rows. Ideally I would need the values to be stored into a list.
    Can anyone help?
    Thanks in advance,
    Julien.
    Here is my code:
    <h:dataTable var="line" binding="#{TradeClientsAndQuantitiesBean.clientsAndQuantities}"  value="#{TradeClientsAndQuantitiesBean.listOfMiddleFormHelpers}">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="S�lectionnez un client"/>
                    </f:facet>
                    <h:selectOneMenu value="#{TradeClientsAndQuantitiesHelperBean.selectedClientTemp}">
                        <f:selectItems value="#{TradeClientsAndQuantitiesHelperBean.concatenatedLabelMap}"/>
                    </h:selectOneMenu>
                </h:column>   
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Renseignez une quantit�"/>
                    </f:facet>
                    <h:inputText value=""/>
                </h:column>   
            </h:dataTable>

    The values will just be put in the same row object you added to TradeClientsAndQuantitiesBean.listOfMiddleFormHelpers.
    It might be worth to read this article: http://balusc.xs4all.nl/srv/dev-jep-dat.html

  • Checkbox in datatable

    Hi,
    I use a data table in my jsf page.I have give a f:selectbooleanchkbox.
    When i select the chk box my data table has to be updated with the checked ones.
    problem here is:
    I have a button at the bottom of my page named reassign.when i click on the reassign button i shud get a pop up and this pop up has to be loaded with dynamic values.since a java script for pop up & both action cannot be called at a single shot , i use a use bean tag in my pop up to call a method in backing bean to load the pop mup with dynamic values.
    Doing this way(calling a bean method), will my data table be automatically updated?
    Presently am using a value changed listener on click of my chk box.but doing this way cant be efficient & does not seem to be user friendly as the form is submitted each time.
    Your suggestions would be appreciated.
    Thanks,
    padma.

    I think I finally pulled it of; I added an empty arraylist and assigned the value of the checkbox to it.
    I don't really know how to point to a certain element in that list, as value="#{theBean.theList[person.id]}" or value="#{theBean.theList['person.id']}" or value="#{theBean.theList[0]}" don't seem to evaluate to something meaningfull.
    It's kinda ugly, and I was hoping binding the tag to a method would get me a cleaner solution, but it appears it doesn't pass the f:attribute (??)...

  • ALV Sorting Not Working after Adding Checkbox to ALV

    Hi All.
    I am currently doing an ALV report using REUSE_ALV_GRID_DISPLAY function. I am sorting the list by Employee Name and Personnel Area. It works fine where the personnel are field and employee name field are merger together for same personnel are and employee name. But afterwards I added a checkbox field to the internal table and the list outputs a checkbox for each line. Afer  putting the checkbox the list no long merges the same personnel are and employee name fields according to original sorting.
    Can anyone explain if there is a way to solve this?
    Thanks a lot.
    Lily

    yes there is a way. Just see this..
    There is no Straight forward solution. There is a work around.
    REPORT  ztest_check_box                         .
    TYPE-POOLS: slis,icon.
    DATA: BEGIN OF it_vbap OCCURS 0,
           vbeln LIKE vbap-vbeln,
           matnr LIKE vbap-matnr,
           posnr LIKE vbap-posnr,
           kunnr LIKE vbak-kunnr,
           kwmeng LIKE vbap-kwmeng,
           check TYPE c,
           id TYPE icon-id,
          END OF it_vbap.
    DATA: it_fieldcat  TYPE slis_t_fieldcat_alv.
    DATA:  x_fieldcat  TYPE slis_fieldcat_alv.
    DATA: it_sort TYPE slis_t_sortinfo_alv,
          x_sort TYPE slis_sortinfo_alv.
    SELECT vbak~vbeln
           vbak~kunnr
           vbap~posnr
           vbap~matnr
           vbap~kwmeng
           INTO CORRESPONDING FIELDS OF TABLE it_vbap
           FROM vbak JOIN vbap
           ON vbak~vbeln = vbap~vbeln.
    SORT it_vbap BY matnr.
    DELETE it_vbap WHERE matnr IS INITIAL.
    LOOP AT it_vbap.
      it_vbap-id = '@T9@'.
      MODIFY it_vbap.
    ENDLOOP.
    x_fieldcat-fieldname = 'ID'.
    x_fieldcat-seltext_l = 'CHECK'.
    x_fieldcat-outputlen = 4.
    x_fieldcat-icon  = 'X'.
    x_fieldcat-col_pos   = 1.
    x_fieldcat-hotspot  = 'X'.
    x_fieldcat-tabname   = 'IT_VBAP'.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'MATNR'.
    x_fieldcat-seltext_l = 'MATNR'.
    x_fieldcat-col_pos   = 2.
    x_fieldcat-tabname   = 'IT_VBAP'.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'KUNNR'.
    x_fieldcat-seltext_l = 'KUNNR'.
    x_fieldcat-col_pos   = 3.
    x_fieldcat-tabname   = 'IT_VBAP'.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'VBELN'.
    x_fieldcat-seltext_l = 'VBELN'.
    x_fieldcat-col_pos   = 4.
    x_fieldcat-tabname   = 'IT_VBAP'.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'POSNR'.
    x_fieldcat-seltext_l = 'POSNR'.
    x_fieldcat-col_pos   = 5.
    x_fieldcat-tabname   = 'IT_VBAP'.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'KWMENG'.
    x_fieldcat-seltext_l = 'KWMENG'.
    x_fieldcat-col_pos   = 6.
    x_fieldcat-do_sum   = 'X'.
    x_fieldcat-tabname   = 'IT_VBAP'.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_sort-fieldname = 'MATNR'.
    x_sort-spos       = 1.
    x_sort-up = 'X'.
    x_sort-group = 'X'.
    x_sort-subtot = 'X'.
    APPEND x_sort TO it_sort.
    CLEAR x_sort.
    x_sort-fieldname = 'KUNNR'.
    x_sort-spos       = 2.
    x_sort-up = 'X'.
    APPEND x_sort TO it_sort.
    CLEAR x_sort.
    x_sort-fieldname = 'VBELN'.
    x_sort-spos       = 3.
    x_sort-up = 'X'.
    APPEND x_sort TO it_sort.
    CLEAR x_sort.
    *DATA:x_layout TYPE lvc_s_layo.
    *x_layout-box_fname = 'CHECK'.
    *x_layout-no_rowmark = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program = sy-repid
    *   is_layout          = x_layout
        i_callback_user_command = 'USER_COMMAND'
        it_fieldcat        = it_fieldcat
        it_sort            = it_sort
      TABLES
        t_outtab           = it_vbap[]
      EXCEPTIONS
        program_error      = 1
        OTHERS             = 2.
    IF sy-subrc ne 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *&      Form  itab_user_command
    *       text
    *      -->WHATCOMM   text
    *      -->WHATROW    text
    FORM user_command USING whatcomm TYPE sy-ucomm selfield TYPE
    slis_selfield.
      IF selfield-fieldname = 'ID'.
        READ TABLE it_vbap INDEX selfield-tabindex.
        IF sy-subrc = 0.
          IF it_vbap-check = ''.
            it_vbap-id = '@R7@'.
            it_vbap-check = 'X'.
          ELSE.
            it_vbap-id = '@T9@'.
            it_vbap-check = ''.
          ENDIF.
          MODIFY it_vbap INDEX selfield-tabindex.
        ENDIF.
      ENDIF.
      selfield-refresh = 'X'.
    ENDFORM.                    "itab_user_command
    if you want to make the above code to work in lower versions then you have to do this..
    then maintain the ICON using the view V_ICON from SM30 add the New Entry.
    get the properties from the below screen shot.
    http://img404.imageshack.us/img404/3338/testig9.png

  • Adding checkbox in Additional Tab of ME21N

    One requirement we need to do is to add checkbox in additional tab of the PO header. Is it advisable to add this field in this tab (standard) or we will just instead create a new tab in the PO header and then add the checkbox here. And then once this checkbox is ticked, we are going to assign 'X' to the field we've added in EKKO table. Kindly let us know your inputs on this. What is the better solution to this requirement? Thanks a lot!

    Hi Mariel,
    add a custom field in CI_EKKODB structure and create a screen variant using the transaction code SHD0 by maintaining the new field as checkbox.
    Satish

  • Adding checkboxes dynamically

    Hello!
    Maybe sombebody could help me out with following problem: I' m creating a survey with Web Dynpro and have therefore to do some dynamic ui- & context creation.
    My problem is the following: I' ve dynamically generated an context node & added some elements, which I now have to display as checkboxes.
    How do I create the binding between the checkboxes & the context-structure? It seems easy with radiobuttons where there's one field receiving the selected value, but I could'nt use bindChecked()-method on one boolean-column of my 0:n-structure as there's an exception thrown saying "could'nt find child node ...".
    Any help is more than appreciated!

    Hi Christian,
    I have to deal with surveys as well and had the same problem a couple of days ago. As a workaround I just created a new context attribute for each checkbox. For saving the results you can loop over every dynamically created attribute and therefore save the user input in an easy way.
    else if (questionType.equals("Check Box")) {
    for (int j=0; j < wdContext.nodeAnswerOptions().size(); j++) {
    //name of check box consists of QuestionNr + 'Check Box' + CheckBoxNr (both+1 to equal displayed question nr)
    IWDCheckBox checkBox = (IWDCheckBox)view.createElement(IWDCheckBox.class, "Q" + (i+1) + "Check Box" + (j+1));
    checkBox.setText(wdContext.nodeAnswerOptions().getAnswerOptionsElementAt(j).getAnswer());
    try {
    IWDNodeInfo nodeInfo = wdContext.getNodeInfo();
    nodeInfo.addAttribute("Q" + (i+1) + "Checked" + (j+1), "ddic:com.sap.dictionary.boolean");
    catch (ContextException e) {
    checkBox.bindChecked("Q" + (i+1) + "Checked" + (j+1));
    questionGroup.addChild(checkBox);
    As I mentioned before it's only a workaround and probably not the best solution. If you find a better way, please let me know.
    Are you dealing with IWDDropDown elements as well? If so you could have a look at this thread.
    Problems with dynamic IWDDropDownByIndex generation / context binding
    Cheers,
    Tom

  • Problem with checkbox and datatable

    Hi,
    I have a checkbox in one column of the data table. The checkbox is to be disabled if the status (which is another column in the table) is set to Completed. For all other rows, the checkbox is to be enabled. What happens is that, the checkbox is either enabled for all the rows or disabled for all the rows...
    This is how i have implemented it.
    public void setCheck(){
    int rows = dataTable1.getRowCount();
    OrderRunStatusBean osb = new OrderRunStatusBean();
    for (int i =0;i<rows;i++){
    dataTable1.setRowIndex(i);
    osb = (OrderRunStatusBean)dataTable1.getRowData();
    if (osb.getStatusName().equalsIgnoreCase("Completed")){
    dataTable1.setRowIndex(i);
    chkSelect.setDisabled(true);
    else
    chkSelect.setDisabled(false);
    Thanks!!!!
    -Tabitha
    PS
    I'm facing the same trouble with selecting and deselecting a checkbox as well.

    Hallo Tabitha,
    create a method called isDisabled() in your <Page>.java class containing the logic by which you want to disable the checkbox, for example:
         * Getter for property disabled.
         * @return Value of property disabled.
        public boolean isDisabled() {
            TableRowDataProvider trdp = (TableRowDataProvider)getBean("currentRow");
            String category = (String) trdp.getValue("MUSICCATEGORIES.MUSICCATEGORY");
            return category.equals("Rock");
        }This example is connected to a TableRow and returns true when the value of the database field is "Rock".
    Then bind the disabled property of the checkbox to the 'disabled' property:
    Click on the right of the disabled property in the Properties window, select the option 'Use Binding', select the 'Bind to an object' tab, select the Page1.disabled property and click on OK.
    Deploy and run the project.
    Hope this helps.
    Ciao,
    Fabio

  • Adding CheckBox and Text as child of a tree

    I want to have the following as the child of a tree :
    **CheckBox[reference of CheckBox]+some text
    example:
    checkbox text1
    checkbox text2
    checkbox text3
    I am unable to add both check box and text as the child of the tree.
    My nodes are generated at run time so number of checkboxes will be known only at run time.
    plz tell how can i achieve this functionality.
    thanx

    Just a small hint (The checkbox is not working yet - but shown):
    import java.awt.Component;
    import javax.swing.JCheckBox;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultTreeCellRenderer;
    public class CheckboxTreeRenderer extends DefaultTreeCellRenderer {
         @Override
         public Component getTreeCellRendererComponent(JTree tree, Object value,
                                                                     boolean sel, boolean expanded,
                                                                     boolean leaf, int row, boolean hasFocus) {
                   JPanel p = new JPanel();
                   p.add(new JCheckBox("Hallo " + row));
                   p.add(new JLabel(value.toString()));
                   return p;
    import java.awt.BorderLayout;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    public class CheckboxTreeFrame extends JFrame {
         public CheckboxTreeFrame(){
              super("A Checkboxtree");
              JTree t = new JTree(new String[]{"1", "2", "3"});
              t.setCellRenderer(new CheckboxTreeRenderer());
              JScrollPane p = new JScrollPane(t);
              add(p, BorderLayout.CENTER);
         public static void main(String [] args){
              CheckboxTreeFrame tf = new CheckboxTreeFrame();
              tf.setSize(200,300);
              tf.setDefaultCloseOperation(EXIT_ON_CLOSE);
              tf.setVisible(true);
    }

  • Adding checkbox on screen dynamically

    Hi all,
    how can we add checkbox on to a screen dynamically. please send me some details.
    thanks,
    samm

    Hi Try this ..
    Let Us say u have a Check box on selection screen p_cbox , if user selects this u want Check box ( for selection ) to appear in the output list ..
    While Setting the layout parameters for the Output you can use :
    DATA  g_r_layo1      TYPE   lvc_s_layo ,
    FORM alv_layo1.
      g_r_layo1-grid_title    =  'SD Delivery Note(Printed)'.
      g_r_layo1-cwidth_opt  =  g_c_mark.
      g_r_layo1-zebra       =  g_c_mark.
      g_r_layo1-no_rowmark  =  space.
    IF ALready Printed Delivery to be printed
      IF p_cbox             =  'X'.
        g_r_layo1-sel_mode  =  g_c_selmode.
      ENDIF.
    ENDFORM.                    " alv_layo
    g_r_layo1-sel_mode   will get u the check box ..
    This works for classes ..
    Thanks .

  • Adding checkbox to JTable cell

    Hi, I am tryin to add a checkbox to JTabel cell.
    But somehow i am ending up getting 'false' in the cell instead of checkbox.
    Can anyone please help me.
    here is my getColumnClass and getValuAt
    public Class getColumnClass(int column)
    { if(column==0) return Boolean.class;
         else return Object.class;
    public Object getValueAt(int nRow, int nCol) {
         if(nCol==0)
              return new Boolean(ch.isSelected());
    }

    You can use a cell rederer that will give you more flexibility .
    Add the renderer to a specific column and that will do the job.
    Here is the example:
    public class CheckBoxRenderer extends JCheckBox implements  TableCellRenderer {
        public CheckBoxRenderer() {
            super();
        public Component getTableCellRendererComponent(JTable table, java.lang.Object value,
                boolean isSelected, boolean hasFocus, int row, int column) {
            Color c = table.getBackground();
            this.setBackground(c);
            setSelected(value != null && ((Boolean) value).booleanValue());
            return this;
    }In order to edit the value in a check box you will need to write a cell editor which
    is going to be easy.

  • Hello guy i have problem with my code that it shows that "Datatable name tblCustomer already belongs to this Dataset" Notes : it happen when i uncheck and check my checkbox again

          string sProduct = "SELECT * FROM tbl_Product";
                string sCustomer = "SELECT * FROM tbl_CustomerInfo WHERE type = 'vip'";
                try
                    if (cbvipcus.Checked == true)
                        dtVipCustomer = FillComboBoxDataSource(cbcusname, sCustomer, "cus_id", "cus_name");
                        dtVipCustomer.TableName = "tblCustomer";
                        ds.Tables.Add(dtVipCustomer);
                        dtVipProduct = FillComboBoxDataSource(cbproname, sProduct, "pro_id", "pro_name");
                        dtVipProduct.TableName = "tblProduct";
                        ds.Tables.Add(dtVipProduct);

    Since you are appearantly reusing the same DataSet, you should clear it before adding the new DataTables. If you do this before the if-case you can make sure that they are always removed:
    if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
    foreach (DataTable dt in ds.Tables)
    ds.Tables.Remove(dt);
    if (cbvipcus.Checked == true)
    dtVipCustomer = FillComboBoxDataSource(cbcusname, sCustomer, "cus_id", "cus_name");
    dtVipCustomer.TableName = "tblCustomer";
    ds.Tables.Add(dtVipCustomer);
    dtVipProduct = FillComboBoxDataSource(cbproname, sProduct, "pro_id", "pro_name");
    dtVipProduct.TableName = "tblProduct";
    ds.Tables.Add(dtVipProduct);
    else if(cbvipcus.Checked == false)
    ds.Clear();
    cbcusname.DataSource = null;
    cbproname.DataSource = null;
    ClearTextBox(this.Controls);
    If this doesn't work you will have to tell us on what line the exception occurs and how the FillComboBoxDataSource method is implemented.
    Please remember to mark helpful posts as answer and/or helpful.

  • Adding h:dataTable with parameters in SQL query

    Hi,
    I've added a h:datatable to my web app in netbeans. I need this table to display records based on a sql query that contains a WHERE clause that has the currently logged-in user's id.
    Further I need a column with buttons that each perform an operation based on the primary key of the selected row.
    I have no Idea how to do any of this.
    Could anyone please help where to start or point me to a good tutorial.
    Thanks

    Hi BalusC.
    Thanks for the reply.
    Coincidentally I discovered your blog shortly after posting this question, and it has been a great help, thanks!
    I have another related problem now however. I am trying to display messages from the database, and then to allow a user to reply to these messages.
    Everything displays correctly and when I click on the reply link the right text area becomes visible, but for some reason, the action event of the last command button does not fire.
    Could you please help me figure out why it doesn't work.
    I also don't know how to retrieve the message from the right text area input.
    Thanks
    Here's the code in my Home.jsp
    <h:dataTable binding="#{Home.messageTable}" id="messageTable" value="#{Home.messages}" var="dataItem">
                                                                <h:column>
                                                                    <f:facet name="header">
                                                                        <h:outputText value=""/>
                                                                    </f:facet>
                                                                    <h:panelGroup layout="block" styleClass="message_main">
                                                                        <h:outputText styleClass="message_label" value="FROM :"/>
                                                                        <h:outputText styleClass="message_data" value="#{dataItem.sender}"/>
                                                                        <h:outputText styleClass="message_label" value="DATE :"/>
                                                                        <h:outputText styleClass="message_data" value="#{dataItem.dateString}"/>
                                                                        <h:outputText styleClass="message_label" value="SUBJECT :"/>
                                                                        <h:outputText styleClass="message_data" value="#{dataItem.subject}"/>
                                                                        <h:outputText styleClass="message_label" value="MESSAGE :"/>
                                                                        <h:outputText styleClass="message_body" value="#{dataItem.message}"/>
                                                                        <h:commandLink styleClass="message_label" action="#{Home.selectMessage}" value="Reply" />
                                                                        <h:panelGroup rendered="#{dataItem.selected}" layout="block" styleClass="reply_panel">
                                                                            <h:outputText styleClass="message_label" value="Enter reply:"/>
                                                                            <h:inputTextarea styleClass="message_body" />
                                                                            <h:commandButton action="#{Home.sendReply}" styleClass="message_label" value="Send Reply" />
                                                                        </h:panelGroup>
                                                                    </h:panelGroup>
                                                                </h:column>
                                                            </h:dataTable>And the related methods
    public String sendReply()
            Message msg = (Message)messageTable.getRowData();       
            msg.sendReply(?);// Needs the string value of the correct text area
            msg.setSelected(!msg.isSelected());       
            return null;
        public String selectMessage()
            Message msg = (Message)messageTable.getRowData();
            msg.setSelected(!msg.isSelected());
            return null;
        }

  • How do I change appearance states for checkboxes in InDesign CS6?

    Hello,
    I am creating an interactive fillable PDF form and need to use a custom checkbox.
    I am aware as to how I add my 'Icon' to the Sample Buttons and Form Box, but am having difficulty when attempting to alter the appearance states 'Normal' or 'Rollover' or 'Click'.
    It seems that when I turn my button into a checkbox, as soon as it becomes selected, it puts a god awful default tick inside it as opposed to allowing me to choose my own 'Normal' state.
    Please help.
    M/

    I am having the same problem as Mykel. Using CS6, I've created a form and added checkboxes. I had a request that I customize the checkboxes to make them easier to see when checked. I adjusted the states of the checkbox and they seemed to function well....but only in Acrobat Pro X. When I open the PDF in Acrobat Reader XI, then the checkboxes act strangely. (Most of the end users will be using Acrobat Reader, so this is a concern.) When intially checked, they appear in the modified way that I want them to. However, as soon as the user clicks somewhere else on the page, the modified checkbox reverts to the default checkbox with a tick mark in it instead.
    I'm exporting the PDF as an interactive PDF and have tried various settings. I've also experimented with creating a checkbox from scratch rather than modifying a provided checkbox. All to no avail. I'd welcome any thoughts or suggestions anyone may have. Hoping I've just missed a step in the process!
    Here are links to my original CS6 InDesign document and the PDF:
    https://workspaces.acrobat.com/?d=w15hEhbZV4LmGFdQYL-1pA
    https://workspaces.acrobat.com/?d=5rdmI1K-LG8iFoFC4FTRdA

  • Automatic Marking of a row Checkbox in tableview MULTISELECT

    Dear all,
    We are using a tableview with iterator and selectedrow-table in MULTISELECTMODE . The tableview gives back the table of the selected rows which have to be processed .
    After a users action and a fired event we have to store possible changed data out of the tableview into a internal memory table ( Export/Import to INDX database ).
    Therefore the user has to mark all rows with changed data to prevent that we have to check all rows (max. 20000 )out of the tableview for differences between the data in the memeory table and the tableview ( performance !! )
    Is ther any possibility to mark the checkbox on the left border of the data row automatically ( by event ? ) if one of the editable inputfields is changed by the user ? Otherwise the user has to scroll up to 40 columns to the left only to mark the row for saving the changed data .
    It would be great to get a hint !! Thanks in advance .

    Hi Craig,
    Yes this is clear .
    We already use that pattern tabid_row_cell for the cell identification in a javascript function.
    But how can I adress to the automaticly in MULTISELECTMODE added checkbox ( or the PrevSelectedtable ) which is not part of my columndefinitions table ? What is the name of that field ?
    The background of our problem with rowmarking is the fact that all data of an internal table are lost in event OnInputProcessing if we fill that table ( 45 columns )for the first time in OnInitialization and not in OnCreate like in most of the mentioned examples ( for instance with table sflight ) .
    On the other hand the OnCreate event will be proceeded after every click event , no matter if we use a stateful or stateless mode . And we want to read the database table for filling the internal table only once if we proceed the OnInit for the first time . 
    We have to select the data out from a ODS table with searchcriteria ( 4 values of table-keys ) from a pre-called start page . And the validation of automatic page attributes in OnCreate seems to fail in general , so all the needed attributes are empty in OnCreate.
    That's why we have to refill the internal table ( from INDX database ) everytime we proceed the OnInitialization event ( also after a simple pageDown ), so data changes inside the tableview object would have been overwritten without storing changes into the memory area of the internal table . This is an unwished emergency exit but we don't know how to deal with this on a better and easier way .
    I tried to save the internal table as a hidden page attribute in OnLayout getting an conversion error after syntax check - this worked very well in other cases .
    If there is a way to get a persistant existing internal table ( during all events ) and the tableview hold it's data changes we could forbear from the rowmarking .
    Best regards and hope that you can help
    Dirk Läufer

  • Is it possible to use Checkboxes with Table Views?

    Hi,
    I need help with adding checkbox. Here is the detail of what I have.
    In my application page, I have the Region Definition:
    Type - SQL Query (PL/SQL Function body Returning SQL Query)
    Region Source -
    DECLARE
    l_sql VARCHAR2(50);
    BEGIN
    Call Function_One(arg1, arg2 ..) ;
    IF ( :P11_REQ = Value1 ) THEN
    l_sql := ' SELECT Col1, Col2, Col3 FROM View1 ' ;
    ELSE
    l_sql := ' SELECT Col1, Col2, Col3 FROM View2 ' ;
    END IF;
    RETURN l_sql;
    END;
    Please note:
    1. ' View1 ' and ' View2 ' are views on two tables.
    2. The checkboxes are needed to select rows from these views to be inserted into another table for further processing.
    Questions:
    1. Can Checkboxes be added to views also, or, to tables only?
    2. If checkboxes can be added to views, How can I do that to each of the rows that will be returned?
    3. Is there a way to use ' Select * FROM View1 ', and be able to add the checkbox to each of the rows ?
    Would appreciate your help.
    Vasan

    Vasan,
    I usually call a plsql function to generate the HTML when I need a custom component like that. ie: create a procedure in a package. this should give you the idea. I usually create a dynamic plsql region to call the below procedure like this
    begin
    printTableWithCheckboxes();
    endl;
    procedure printTableWithCheckboxes is
    begin
    htp.p('<table>');
    for rec in (select id, name from test) loop
    htp.p('<tr>');
    htp.p('<td><input type="checkbox" name="' || rec.name || '" value="' || rec.id || '" /> </td>');
    htp.p('</tr>');
    end loop;
    end printTableWithCheckBoxes;

Maybe you are looking for