Hello,
in a tableview using an iterator I try to display listboxes with different content in one column as kind as a F4-Help. The type is always the same: shsvaltab.
I tried different things to pass the reference into p_replacement_bee for the dropdownListBox in the iterator:
- store the data in the row/line itself and get it in the iterator
- store the data in an own public table and access the line via read table in the iterator
- using the "p_replacement_bee = CL_HTMLB_DROPDOWNLISTBOX=>FACTORY(..) thing
The result is always the same: the cell is empty. The reference is passed correctly to p_replacement_bee as I saw in the debugger.
Do I use always the same table content for the column the listbox is displayed correctly. But for performance reasons we don't want to provide the same list box 30 times in each row but load the values "on demand" with the onSelect-Event. Initially the default entry - which can be different for the rows - should be the only entry in the list.
Does anyone faces the same problem or has a solution?
Thanks in advance,
Bernd
Hallo Bernd,
First, whenever I see things such as "the cell is empty" it points to some programming bug. What I usually find is that some table you feed into the ddlb is a local "data:" type table. So once the method is completed, the table is gone. Be careful to hook the tables onto class attributes to keep them alive a little longer.
Now the real question is this: do we have N * exactly the same listbox? If yes, then it is easy. Long time ago we developed the <htmlb:dataContainer>. This is effectively the content of the table rendered once under a specific ID. And then all <htmlb:dropdownListbox> tags are told to use the dataContainer. So they are rendered empty, and once in the browser, all DDLB will load themselfs from the dataContainer.
Here are bits and piece as example:
<% DATA: cols TYPE TIHTTPNVP, col TYPE IHTTPNVP. col-name = 'red'. col-value = 'Apple'. APPEND col TO cols. col-name = 'yellow'. col-value = 'Bananana'. APPEND col TO cols. col-name = 'orange'. col-value = 'Orange & Tagerine'. APPEND col TO cols. %> <htmlb:dataContainer name = "dC" table = "<%=cols%>" nameOfKeyColumn = "NAME" nameOfValueColumn = "VALUE" /> <htmlb:dropdownListBox id = "d1" dataContainerName = "dC" /> <htmlb:dropdownListBox id = "d2" dataContainerName = "dC" /> <htmlb:dropdownListBox id = "d3" dataContainerName = "dC" />
++bcm
Hello Brian,
I was aware of this local data problem - that's the reason I uses a static attribute of another global class.
The data container reduces the amount of data which is transported via the network. But our problem is the rendering time. We have about 30 lines in our table and 30 times a listbox with 100 entries as F4-help. The rendering takes about 4 seconds on a 2,8 GHz PC. So we want to reduce the amount of the listbox entries to excatly one -the preselected one - and load the complete list when the onSelect-Event is triggered.
Unfortunatley the onSelect-Event does not work with the datacontainer-tag.
Any ideas?
Regards,
Bernd
Hi,
on this DDLB topic, I have a problem...
First the Disclaimer 😊
I have studied the blogs
I have studied the SBSText_HTML DropDownListBox example
This is another piece of scaffolding for my app
I have searched the forum and found this similar thread
Question:
This thread and the DropDownListBox example show how to use:
DATA: t TYPE TIHTTPNVP, entry TYPE IHTTPNVP.
entry-name = 'key_red'. entry-value = 'Red'. APPEND entry TO t.
entry-name = 'key_green'. entry-value = 'Green'. APPEND entry TO t.
entry-name = 'key_blue'. entry-value = 'Blue'. APPEND entry TO t.
entry-name = 'key_black'. entry-value = 'Black'. APPEND entry TO t.
%>
<htmlb:dataContainer name = "myDataContainer"
table = "<%= t %>"
nameOfKeyColumn = "NAME"
nameOfValueColumn = "VALUE" />
<htmlb:dropdownListBox id = "myDropdownListBox14"
dataContainerName = "myDataContainer" />
(this code is from the htmlb example)
my Problem is, I am prototyping this example in my BSP as a stepping stone to filling the dataContainer with results from SAP-ABAP.
But when I put this code in my prototype I get the error message Field t is unknown it is neither in Tables or a Data statement
I have tried putting the data statement into different events in the Event Handler but to no avail - and I have tried creating a Table t in the page attributes but no success.
Do you have any idea where I am going wrong ?
Please forgive me if this is a dumb question.
Thanks,
Milan.
too slow...
I answer my own question, I got it to work with the Data: part in the 'layout' of the BSP like..
<%
DATA: t TYPE TIHTTPNVP, entry TYPE IHTTPNVP.
entry-name = 'key_red'. entry-value = 'Red'. APPEND entry TO t.
entry-name = 'key_green'. entry-value = 'Green'. APPEND entry TO t.
entry-name = 'key_blue'. entry-value = 'Blue'. APPEND entry TO t.
entry-name = 'key_black'. entry-value = 'Black'. APPEND entry TO t.
%>
but this isn't really what I want as I am trying conciously to separate the xml/htmlb and markup from the logic which is why I would like this data statement to be handled by one of the event handlers - just can't get it to work with this code in one of the event handlers.
Thanks,
Milan.
Hi Milan,
why don't you try it with the tabstrip item "Page attribute" which you can find in each page/view?
Regards,
Rainer
Hi Rainer,
thanks for your reply,
as I said in the first part of my question, "and I have tried creating a Table t in the page attributes but no success".
I keep looking, maybe I am doing something daft and it will be resolved, but the main question remains, I can get this <% ABAP %> to work in the layout but if I move it to one of the events the page will not compile.
Thanks,
Milan.
Hello All,
Can you please tell me how to implement drop-downlist box in an iterator of the TableView control? I am building the Drop-Downlist element inside iterator class. But don'nt know how to populate values in that.
Thanks in advance.
Thanks And Regards
Rajeev Patkie
Add a comment