on ‎2004 Aug 23 12:29 PM
Hello all,
I have just started my exploration in the MVC design pattern of BSP applications.(Beginner)
First let me tell, what my need is : When I run an application, an initial page should be shown with an input field and a button. On clicking the button the <u>value typed in the input field of the first page must be displayed in a new page</u>.
I am trying to do this with MVC design pattern. I know how to do the same if both were to be diplayed on the same page ( A single page with two views ). But I don't know how to do it, <u>if the second view is to be shown on a new page.</u>
Could any of you give me a hint on this.
Thanks and regards.
Loveline.
Request clarification before answering.
Hi Max,
Thanks for the hint. I used the attribute action of the htmlb form. I was able to satisfy my need. I have included the code.
Lay out of first view
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="bsp" prefix="bsp" %>
<htmlb:content>
<htmlb:page title="First Page " >
<htmlb:form action = "Second.do">
<htmlb:gridLayout columnSize = "2"
rowSize = "1"
cellSpacing = "10"
cellPadding = "10"
style = "TRANSPARENT" >
<htmlb:gridLayoutCell columnIndex = "1"
rowIndex = "1" >
<htmlb:inputField id = "IF1"
size = "10" />
</htmlb:gridLayoutCell>
<htmlb:gridLayoutCell columnIndex = "2"
rowIndex = "1" >
<htmlb:button id = "B1"
text = "Click Me"
onClick = "click" />
</htmlb:gridLayoutCell>
</htmlb:gridLayout>
</htmlb:form>
</htmlb:page>
</htmlb:content>
controller 1
DO_REQUEST Method
METHOD do_request .
DATA : view TYPE REF TO if_bsp_page.
DATA : value(10) TYPE c.
dispatch_input( ).
IF is_navigation_requested( ) IS NOT INITIAL.
RETURN.
ENDIF.
view = create_view( view_name = 'First.htm' ).
call_view( view ).
ENDMETHOD.
Lay out of second view with page attribute value
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content>
<htmlb:page title="Second Page " >
<htmlb:form>
<htmlb:textView text = "This is the text entered in the initial page <b><%= value. %></b>"
tooltip = "Simple quick info"
encode = "true" />
</htmlb:form>
</htmlb:page>
</htmlb:content>
Controller 2 with attribute value
DO_REQUEST
METHOD do_request .
data : view type ref to if_bsp_page.
value = request->get_form_field( name = 'if1' ).
view = create_view( view_name = 'Second.htm' ).
view->set_attribute( name = 'value' value = value ).
call_view( view ).
ENDMETHOD.
Thanks once again.
Best Regards,
Loveline.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
if you yourself watch the topic, you will see a yellow star in the header lines of each single post made by others.
Just look for the post that you want to reward with some points, and then click on the according yellow star - there you can choose how many points this post should be awarded (10 for solved problem, 6 for very helpful, and 2 for helpful answer).
I guess the status star for the topic in the forum view will take the highest awarded points color (so far I only have seen grey or blue stars).
Edit: Have a look at these two blogs, they make for some nice reading and contain useful information!
<a href="/people/mark.finnern/blog/2004/08/10/spread-the-love">Spread the Love!</a>
<a href="/people/sap.user72/blog/2005/08/16/have-you-checked-your-stars-lately">Have you checked your stars lately?</a>
Take care,
Max
Message was edited by: Maximilian Moder
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 5 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.