Web Dynpro Java for Newbies a Quick Guide to Develop Your

Web Dynpro Java For Newbies A Quick Guide To Develop Your-Free PDF

  • Date:31 Jul 2020
  • Views:4
  • Downloads:0
  • Pages:18
  • Size:398.47 KB

Share Pdf : Web Dynpro Java For Newbies A Quick Guide To Develop Your

Download and Preview : Web Dynpro Java For Newbies A Quick Guide To Develop Your


Report CopyRight/DMCA Form For : Web Dynpro Java For Newbies A Quick Guide To Develop Your


Transcription:

Web Dynpro Java for Newbies a Quick Guide to Develop Your First Application. Table of Content,Creating Your First Web Dynpro Application 3. Creating a Web Dynpro Development Component DC 3,Creating a Web Dynpro Application 5. Creating the Second View 6,Specifying the Navigation 7. Creating the Controller Context 9,Creating a context for the component controller 9. Mapping View Contexts to the Component Controller Context 10. Creating Actions and Implementing Navigation 11,Designing a View Layout 13.
Designing a layout for the WelcomeCompView 13,Designing a layout for the ResultView 15. Deploying and Running Your Application 16,Related Content 17. Copyright 18, SAP DEVELOPER NETWORK sdn sap com BUSINESS PROCESS EXPERT COMMUNITY bpx sap com. 2008 SAP AG 2, Web Dynpro Java for Newbies a Quick Guide to Develop Your First Application. Creating Your First Web Dynpro Application, In the following tutorial you are introduced step by step to the basic concepts involved in implementing a.
basic Web Dynpro application The user interface for this application consists of only two views and allows. the user to navigate from one view to the other In the first view the user is able to enter his or her name in. an input field and navigate to the next view using a button This name is then added to a text field and. displayed in the welcoming text in the second view. The user interface for this tutorial looks as following. Prerequisites, A local instance of SAP NetWeaver Developer Studio is installed on your desktop. You have access to SAP Application Server Java,Creating a Web Dynpro Development Component DC. To manage local development objects you need a specific DC project in the Developer Studio A Web. Dynpro DC serves as a container for Web Dynpro specific resources and development objects such as Web. Dynpro components models component interfaces views local dictionary data types mimes For this. reason you will use the appropriate wizard to generate a suitable project structure for the new Web Dynpro. application, 1 To open the Web Dynpro perspective in your Developer Studio choose Window Open. Perspective Web Dynpro, 2 Choose File New Web Dynpro Development Component The New Development Component. wizard appears, 3 Choose a Software Component for your Development Component for example MyComponents and.
confirm with Next, 4 In the window that appears give your DC the name welcome leave the default settings unchanged. and choose Finish, SAP DEVELOPER NETWORK sdn sap com BUSINESS PROCESS EXPERT COMMUNITY bpx sap com. 2008 SAP AG 3, Web Dynpro Java for Newbies a Quick Guide to Develop Your First Application. The wizard generates an initial structure for your new Web Dynpro DC as shown below The Web Dynpro. Explorer provides a logical view of the structure of a Web Dynpro DC as opposed to a pure file and folder. based one With this project view you can access all Web Dynpro units In addition each Web Dynpro DC. provides access to local dictionaries with the help of which you can create user defined dictionary types. Additionally required projects resources such as MIMEs or even separate Java help classes can be added. to the Web Dynpro DC through the resources node, SAP DEVELOPER NETWORK sdn sap com BUSINESS PROCESS EXPERT COMMUNITY bpx sap com. 2008 SAP AG 4, Web Dynpro Java for Newbies a Quick Guide to Develop Your First Application.
Creating a Web Dynpro Application, The project structure you have created does not yet include all the elements that enable you to define the. specific functions of an application These additional elements are encapsulated in a Web Dynpro. component that can contain any number of windows and views for visual representation and their. corresponding controllers, Moreover you also need an object that can be used to address and display the Web Dynpro component in. the Web browser This is why you create a Web Dynpro application as an additional object As an. independent program unit it connects to an URL that can be accessed by the user with a window in the Web. Dynpro component, 1 In the Web Dynpro Explorer expand the Web Dynpro node in the structure of the welcome DC. 2 To start the relevant wizard open the context menu of the Applications node and choose Create. Application, 3 Enter a name for your Web Dynpro application such as WelcomeApp and specify the package name. such as com sap demo welcome welcomeapp for the Java classes that will be generated Then. choose Next, 4 In the window that appears you must assign a Web Dynpro component to which the application is.
linked Since a Web Dynpro component has not yet been created the wizard creates a component at. this point, 5 Accept the selection Create a new component and choose Next again. In the next screen you must specify some general values for the component. 6 Enter the name WelcomeComp for your Web Dynpro component and specify the package name such. as mycom demo welcome app comp for the Java classes to be generated. SAP DEVELOPER NETWORK sdn sap com BUSINESS PROCESS EXPERT COMMUNITY bpx sap com. 2008 SAP AG 5, Web Dynpro Java for Newbies a Quick Guide to Develop Your First Application. 7 Accept the other suggested settings and choose Next. 8 Accept the predefined settings for the window the interface view the startup plug and the default view. and choose Finish, The application wizard performs several generation routines Once it has finished it adds the new application. object to the structure automatically opens the Properties view in the right pane Additionally it inserts a. substructure for the new Web Dynpro component WelcomeComp including the view WelcomeCompView. You can now access all parts of the project,using the graphical editor called Component. Modeler and use it for convenient top down,navigation through all of the layers and.
development objects,Creating the Second View, Users need elements within the user interface to interact with the application The Web Dynpro concept. allows you to split the user interface into an arrangement of views You can think of each of these views as. an entity encompassing the elements of a UI that belong together. Now you create a second view to provide an application that provides two different view layouts providing. different information You define the logical user interface unit with graphical support of the Window editor. tool Later on you will design the layout itself, 1 To open the Window editor tool double click on the window name WelcomeWindow within Web. Dynpro Explorer, 2 Click once on New View in the palette tool then once into the graphical editor Enter name. ResultView for the new view and,confirm with Finish. When you double click WelcomeWindow,in the DC structure you will find two views.
SAP DEVELOPER NETWORK sdn sap com BUSINESS PROCESS EXPERT COMMUNITY bpx sap com. 2008 SAP AG 6, Web Dynpro Java for Newbies a Quick Guide to Develop Your First Application. defined for the application The WelcomeCompView is displayed with a bold line since it is the default view. to be displayed when the application is started,Specifying the Navigation. A view can only be displayed by the browser if it has been embedded in a window A window always. contains one or more views which are connected by navigation links One of these views is specified as the. default view and is displayed the first time when the window is called for the first time. To define the navigation between the views you must create exit and entry points for each view using. outbound and inbound plugs You can then specify the navigation flow using navigation links The navigation. then can be triggered with a special method that is generated for this purpose. 1 To navigate to the window double click the component WelcomeWindow in the Web Dynpro explorer. The graphical tool displays two rectangles representing the views. SAP DEVELOPER NETWORK sdn sap com BUSINESS PROCESS EXPERT COMMUNITY bpx sap com. 2008 SAP AG 7, Web Dynpro Java for Newbies a Quick Guide to Develop Your First Application. 2 Choose Link from the Palette and draw a line from the WelcomeCompView to the ResultView. On the WelcomeCompView an Outbound plug called,Out is created. On the ResultView an Inbound plug called In is,An event handler with the name onPlugIn has.
been automatically created for the ResultView, SAP DEVELOPER NETWORK sdn sap com BUSINESS PROCESS EXPERT COMMUNITY bpx sap com. 2008 SAP AG 8, Web Dynpro Java for Newbies a Quick Guide to Develop Your First Application. Creating the Controller Context, Each Web Dynpro component is supplied with a corresponding component controller It serves as a global. controller that is visible within the Web Dynpro component for all other controllers especially for the view. controllers The data used in the Web Dynpro component or in the view is stored in the context Read write. access to this data is available using the controllers as a starting point. Creating a context for the component controller, 1 To navigate to the component controller editor from within the graphical tool double click the. component WelcomeComp in the component modeler and then ComponentContoller. Alternatively you can use the project structure and expand the node Web Dynpro Components. WelcomeComp and then double click the Component Controller node. 2 In the editor that appears choose the Context tab. 3 Open the context menu for the root node Context and choose the option New Node and in the next. screen Manually since you need to create the context from scratch In the real world you would make. use of a model to retrieve your data, 4 Enter a name for the Node for example userNode and confirm with Finish.
5 In the Properties view set the Collection Cardinality to 1 n This is necessary that at runtime at least. one node element is created and the InputField is enabled to accept the user s input. 6 Select the userNode open the context menu and choose New Attribute. 7 Select the option Manually enter the name username and select string as the type of the attribute. Then choose Finish The value attribute is added to the context node userNode. SAP DEVELOPER NETWORK sdn sap com BUSINESS PROCESS EXPERT COMMUNITY bpx sap com. 2008 SAP AG 9, Web Dynpro Java for Newbies a Quick Guide to Develop Your First Application. Mapping View Contexts to the Component Controller Context. To ensure data consistency inside a Web Dynpro DC the data is stored in the Component Controller or in a. Custom controller and the different view controller contexts reference to this data To realize this you have. to map the relevant contexts, 1 Go back to the component view using the graphical tool or alternatively expand the node Web Dynpro. Components WelcomeComp, 2 Choose Data Link from the Palette and draw a line from the WelcomeCompView to the Component. Controller In the wizard that appears you can map the view context to the component context. 3 Drag the userNode in the context of the component controller to the root node of the view controller. context and drop it, 4 Select the checkbox for the username attribute and confirm with Finish. You have now created a new node and attribute for the view context and mapped it to the. corresponding component context element,5 Repeat the last three steps to map the.
ResultView s context to the Component,Controller context. The contexts of both views are now mapped to,the Component Controller context The data is. stored in the component controller context and,the view contexts reference to it This ensures. that the data is consistent inside a Web Dynpro, SAP DEVELOPER NETWORK sdn sap com BUSINESS PROCESS EXPERT COMMUNITY bpx sap com. 2008 SAP AG 10, Web Dynpro Java for Newbies a Quick Guide to Develop Your First Application.
Creating Actions and Implementing Navigation, To navigate from one view to the next you need an appropriate action which you bind to a UI element event. such as a button s event onAction You then need to implement the event handler which reacts to this. action and triggers a view change by calling an outbound plug. 1 To navigate to the view editor for the first view double click the WelcomeCompView in the graphical. tool or the corresponding node in project structure. 2 Choose the Actions tab,3 Choose the New pushbutton. You can create a new action in the wizard that appears. 4 Enter the name Go for this new action In the field Text enter Go for the text to be displayed on all UI. elements with events bound to this action Leave the Event Handler option unchanged Assign the. plug Out as a Fire Plug and choose Finish, The new action Go and its associated event handler onActionGo are displayed in the list of actions. SAP DEVELOPER NETWORK sdn sap com BUSINESS PROCESS EXPERT COMMUNITY bpx sap com. 2008 SAP AG 11, Web Dynpro Java for Newbies a Quick Guide to Develop Your First Application. You now have created the Go action The implementation of the navigation is automatically inserted into the. associated event handler, To check the generated source code for event handler onActionGo open the Java Editor for the.
WelcomeCompView java class, public void onActionGo com sap tc webdynpro progmodel api IWDCustomEvent. begin onActionGo ServerEvent,wdThis wdFirePlugOut, To trigger navigation from the WelcomeCompView to the ResultView using the outbound plug Out the. application calls the outbound plug method wdFirePlugOut The predefined private variable wdThis is. a Quick Guide to Develop Your First Application Applies to Web Dynpro for Java Enhancement package 1 of SAP NetWeaver CE 7 1 For more information visit the UUser Interface Technology homepage Summary If you are new to Web Dynpro Java and want to get familiar with the Web Dynpro perspective in the SAP NetWeaver Developer Studio this is the right tutorial for you You will learn how

Related Books