Hallo all,
is it possible to return a list of table entries (search results) from the server and display them in a modal dialog/popup window so that the user can select one of the result rows in order to procede with his work? I assume that I need to invoke the creation of the popup/modal dialog after the search is done on the server side therefore I am wondering how this can be done.
Or is there another solution for my problem that I should consider?
Any input on this would be greatly appreciated!
Thanks in advance.
Best regards,
Helga
Hi Helga,
if you use the HTMLB extension <htmlb:tableview> you can
choose between different selection modes (for example
singleselect). Please have a look at BSP application SBSPEXT_TABLE. There are some nice examples.
Since the method onLayout comes after on InputProcessing
you don't have to worry about the table entries.
Regards,
rainer
Hi Helga,
if you you have problems displaying the result in a new window you can do it the folling way:
<% data m_script type string. m_script = 'window.open("Sample.do par1=123",null,"top=300,left=300,height=200,width=400,status=no,toolbar=no,menubar=no,location=no");'. %> <htmlb:button id = "b1" design = "STANDARD" onClientClick = "<%= m_script%>" text = "Button" />
The only way here is to use Javascript.
Hoping this helps.
Rainer
Hallo Rainer,
thank you vm for your quick reply!
I guess I have not explained my problem properly. I have tried the jscript version already without success, because I need to call a function module first. This module will write the search result values to the model (MVC). Now I need to display these values in a new window, but there is no possibility to do that because I don't know how I can invoke a modal browser/popup window from the server side.
Maybe I got it more to the point this time. Any help on this would be greatly appreciated.
BR Helga
Hallo Bernd,
this looks much like what I might need, but still I am wondering what types the variables (lv_page_url...) are so that I can declare and test the code that you have given.
Could you please help me out on this? Thanks in advance.
Best regards,
Helga
Here's my attempt on the F4 solution.
You can run the default.htm. This page has 2 input fields CARRID and CONNID. These field will be populated from the user selection on the next page (search.htm).
You click the Search - F4 button. This will open a new window. You can type in LH or any CARRID that is available on the system and click Look up button.
The matching entry will be displayed on the table. You click which entry you want and then the window is closed and the data is transferred to the first page.
The opened window is non modal window. This allow the user to enter a selection criteria (just like the regular F4).
I've tried to make the window to be a modal window, but when the user click look up, a third window is displayed instead of using the modal window. If the user do not need further selection criteria, we can use the modal window.
I forgot the JavaScript function to open a modal window, but i believe this is only supported by IE.
Also, you can resize the window, please look up the window.open function details from a JavaScript book.
I hope this will help you a bit.
The 'draft overview' by Brian is very nice solution, but as he said, it is a big implementation by itself.
My solution is a quick and dirty solution that i have to do to get my assignment done, so please be kind if I miss something or the solution is not 'Elegant' enough.
last thing, I also play around with showHelp and onValueHelp attribute from input field. This will give a nice small button for the search f4 button.
<htmlb:inputField id = "G_ERNAM" showHelp = "true" onValueHelp = "return htmlbSL(this,2,'helpERNAM:helpERNAMClick');" value = "//model/G_ERNAM" />
this code will trigger an event helpERNAMClick so you can process the next step on the onInputProcessing or HANDLE_EVENT.
default.htm layout
<%@page language="abap" %> <%@extension name="htmlb" prefix="htmlb" %> <htmlb:content design="design2002+design2003" > <htmlb:page title="multiselect " > <htmlb:form id="myTest" > <% if myF4 = 'X'. %> <script> var result = window.open("search.htm", "helpWindow", "status=no, menubar=no"); </script> <% endif. %> <htmlb:group> <htmlb:groupHeader> <htmlb:textView text="SFLIGHT Table" /> </htmlb:groupHeader> <htmlb:groupBody> <htmlb:textView text="CARRID:" />   <htmlb:inputField id="CARRID" /> <br> <htmlb:textView text="CONNID:" />   <htmlb:inputField id="CONNID" /> <htmlb:button text = "Search - F4" id = "searchF4" onClick = "searchF4" /> </htmlb:groupBody> </htmlb:group> </htmlb:form> </htmlb:page> </htmlb:content>
default.htm onInputProcessing
CLASS cl_htmlb_manager DEFINITION LOAD. DATA: event TYPE REF TO if_htmlb_data. event = cl_htmlb_manager=>get_event_ex( request ). IF event->event_server_name = 'searchF4'. myf4 = 'X'. ENDIF.
default.htm Page Attributes
myF4 TYPE STRING
search.htm layout
<%@page language="abap" %> <%@extension name="htmlb" prefix="htmlb" %> <htmlb:content design="design2002+design2003" > <htmlb:page title="HelpSearch" > <htmlb:form> <% if close_window = 'X'. clear close_window. %> <script> opener.document.forms["myTest"].CARRID.value = '<%= sel_flight-carrid %>'; opener.document.forms["myTest"].CONNID.value = '<%= sel_flight-connid %>'; window.close(); </script> <% endif. %> <htmlb:group> <htmlb:groupHeader> <htmlb:textView text="Search Criteria:" /> </htmlb:groupHeader> <htmlb:groupBody> <htmlb:textView text="CARRID:" />   <htmlb:inputField id = "CARRID" value = "<%= carrid %>" /> <htmlb:button id = "searchButton" text = "Look up" onClick = "searchButtonClick" /> </htmlb:groupBody> </htmlb:group> <hr> <htmlb:group> <htmlb:groupHeader> <htmlb:textView text="Search Result:" /> <htmlb:button text = "clear selectedRowIndexTable" id = "clear" onClick = "clear" /> <htmlb:button text = "go" id = "go" onClick = "go" /> </htmlb:groupHeader> <htmlb:groupBody> <htmlb:tableView id = "tvX" width = "100%" visibleRowCount = "8" fillUpEmptyRows = "X" onRowSelection = "MyEventRowSelection" selectedRowIndex = "<%= selectedRowIndex %>" selectionMode = "SINGLESELECT" table = "<%= sflight %>" /> </htmlb:groupBody> </htmlb:group> </htmlb:form> </htmlb:page> </htmlb:content>
search.htm onCreate
clear close_window
search.htm onInputProcessing
CLASS cl_htmlb_manager DEFINITION LOAD. DATA: tv TYPE REF TO cl_htmlb_tableview, table_event TYPE REF TO cl_htmlb_event_tableview, event TYPE REF TO if_htmlb_data. event = cl_htmlb_manager=>get_event_ex( request ). IF event IS NOT INITIAL AND event->event_name = 'button' AND event->event_server_name = 'clear'. CLEAR selectedrowindex. ELSEIF event IS NOT INITIAL AND event->event_name = 'button' AND event->event_server_name = 'searchButtonClick'. select * from sflight into table sflight where carrid = carrid. clear selectedrowindex. ELSE. tv ?= cl_htmlb_manager=>get_data( request = request name = 'tableView' id = 'tvX' ). IF tv IS NOT INITIAL. table_event = tv->data. CLEAR selectedrowindex. selectedrowindex = table_event->selectedrowindex. if event->event_server_name = 'MyEventRowSelection'. close_window = 'X'. read table sflight into sel_flight index selectedrowindex. endif. ENDIF. ENDIF.
search.htm page attribute
carrid AUTO TYPE STRING close_window TYPE STRING selectedRowIndex TYPE STRING seltext TYPE STRING sel_flight TYPE SFLIGHT sflight TYPE FLIGHTTAB
Add a comment