Hi,
Are these 2 things possible in BSP tableview - Using tableview to accept user inputs and adding new empty rows dynamically to the tableview? My requirement is as follows:
1. My client wants that I should have a tableview with Inputfields & dropdownboxes in which the user can enter & save values in the database.
2.Initially the tableview should have 1 empty row for input & as the user enters some value in it a new row should be added to the tableview for the next entry.
If anyone has done this please help me out.
Regards
Tejaswini
Hi Naresh,
Yes I am modifying my internal table with the values from the tableview. Everytime a new row is added I want to display the existing internal table values in the table view and also give the user a new row for input. But the previous values are getting lost and the tableview is displayed with empty rows alongwith a new row for input.
My code for onInputProcessing() is as follows:
DATA temp LIKE LINE OF tab1.
CASE event->name.
WHEN 'button'.
case event->id.
when 'ADD'.
temp-zr8klpaya = table_event->get_cell_value(
row_index = table_event->selectedrowindex
column_index = '2' ).
temp-zr8klgoaq = table_event->get_cell_value (
row_index = table_event->selectedrowindex
column_index = '3' ).
IF temp IS NOT INITIAL.
APPEND temp TO tab1.
ENDIF.
endcase.
Can you explain to me what your requirement was and how you have developed the logic for it?
Regards
Tejaswini
Hi
You can edit the lines in table view using table view iterators.For details of iterators you can see the following weblog by Brian
/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
i have also done the same thing in of the requirement by giving empty rows in table.
actually i ahve appened few blank rows in the table in onCreate event.
Hope it will help you.
regards
Naresh
Hi Naresh,
Thanks for the suggestions,I will try them out.
How do you append new lines to the tableview at runtime?Suppose the user enters values in the first empty row I need to generate another empty row so that he can enter further data.
Regards
Tejaswini
Hi,
I went through the weblogs & I am now using tableview iterator to add new rows to my internal table on click of a button that is present in the tableview. But I am facing a new problem. I want the data that I have input in the previous rows to appear in the tableview. But I am getting empty rows. How do I assign the values of the internal table to the tableview? This is how I am doing it now.
<htmlb:tableView id = "tv1"
table = "<%= tab1 %>"
allRowsEditable = "TRUE"
selectionMode = "LINEEDIT"
selectedRowIndex = "<%= index %>"
iterator = "<%= iterator %>" >
</htmlb:tableView>
When I am checking in onInputProcessing the tab1 has values that I enter in it.But it does not appear inn the tableview. Please help I am unable to think what else is to be done.
Regards
Tejaswini
Two minor remarks:
(1) "APPEND INITIAL LINE TO itab." is the fastest way to empty lines in the table.
(2) In terms of debugging, sometimes you can not debug into our classes, as they have the system flag set. Look in the menu of debugger, and just activate system debugging to debug through all of our code as well.
Add a comment