Skip to Content
Author's profile photo Craig Cmehil

BSP / HowTo: Exploring BSP Development with MVC 2c

Building your views

image

This brings us to our Views. Views are basically HTML documents that display variables, nothing more nothing less, although you can include some ABAP code like in normal Pages with Flow Logic.

image As you recall in the DO_REQUEST of each controller we told it to create a view and we gave the htm file. We now will create those files.

So jump down into your application and choose “create”, “page”. You can go ahead create each of those pages, once in place we can go back through and add in our code and attributes.

Pages

  • faq.htm
  • info/intro.htm
  • obj/cat.htm
  • obj/index.htm
  • obj/sdn.htm
  • obj/sdnlinks.htm
  • obj/subject.htm

One major difference these pages have to those we created in the first series is that they have no type definitions or event handlers, that is all handled in the controllers. Here have our Attributes and our Page Layout.

Now the Attributes must correspond to those we defined in the controller, the ones that we gave to the “default_view” in our DO_REQUEST method.

faq.htm

lv_tab Type STRING

info/intro.htm

N/A

obj/cat.htm

Iterator Type Ref To IF_HTMLB_TABLEVIEW_ITERATOR
lv_data Type ZFAQCATTAB
lv_desc Type STRING
lv_edit Type CHAR1
lv_id Type STRING
lv_name Type STRING
lv_src Type STRING
sri Type I

obj/subject.htm

Iterator Type Ref To IF_HTMLB_TABLEVIEW_ITERATOR
lv_data Type ZFAQSUBJECTTAB
lv_desc Type STRING
lv_edit Type CHAR1
lv_id Type STRING
lv_name Type STRING
sri Type I

obj/sdnlinks.htm

Iterator Type Ref To IF_HTMLB_TABLEVIEW_ITERATOR
lv_data Type ZFAQSDNRSSLINKTAB
lv_link Type STRING
lv_edit Type CHAR1
lv_id Type STRING
lv_name Type STRING
sri Type I

obj/sdn.htm

Iterator Type Ref To IF_HTMLB_TABLEVIEW_ITERATOR
lv_data Type ZFAQSDNRSSTAB
sdnlinks Type ZFAQSDNRSSLINKTAB
selected Type STRING
sri Type I

obj/index.htm

Iterator Type Ref To IF_HTMLB_TABLEVIEW_ITERATOR
lv_author TYPE STRING
lv_cat TYPE STRING
lv_cat_id TYPE STRING
lv_data TYPE ZFAQFAQTAB
lv_edit TYPE CHAR1
lv_ID TYPE STRING
lv_long_desc TYPE STRING
lv_rating TYPE STRING
lv_rating_image TYPE STRING
lv_short_desc TYPE STRING
lv_subject TYPE STRING
lv_subject_id TYPE STRING
lv_table_cat TYPE ZFAQCATTAB
lv_table_subject TYPE ZFAQSUBJECTTAB
lv_title TYPE STRING
lv_url TYPE STRING
lv_visible TYPE STRING
sri TYPE I

Now that we have our Attributes in place we can freely put our page layouts in.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.