版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、solutionunit: adobe integration into web dynpro for javatopic: dynamically generated forms 1 add interactive form ui element 1-1 in the project structure, double-click the node for the dynamicformview (web dynpro - web dynpro components - dynamicformcomp - views - dynamicformview) and choose the lay
2、out tab.1-2 in the outline pane, insert a child of type interactiveform and id interactiveform1 in the group1.1-3 select the interactiveform1 element in the outline pane, switch to the corresponding properties page and change the properties as shown below. reference the correspon-ding datasource and
3、 pdfsource from the context and set the width and height:the datasource property is used to specify the data source. the data source encapsulates the data you can display in the form at runtime. for the datasource property, you need to specify the path to the context node providing the data. in this
4、 step we reference the datasource context node, which is already defined in the context structure of the used template (see context tab of the dynamicformview).the structure of the context node, which is referenced by the datasource property, will also be displayed in the data view tab of adobe desi
5、gner. the corresponding context attributes of this node can be bound to the designer layout elements defined in the form (see step 6). the updatedatainpdf value of the mode property is used to update a pdf document with the data provided by the data source or to create a new pdf document from the da
6、ta source and the form template if no pdf document exists. the pdfsource property specifies the path of the context element that contains the pdf document. you must bind this property to a context attribute of the type binary. in this tutorial, the context attribute has already been defined in the c
7、ontext structure (see graphic above).note: although not used in this tutorial, this property allows an application developer to access the binary file and download it to the local hard disk or read and send the data to a backend.the templatesource property specifies the unique name of the form templ
8、ate. the name is automatically generated when you insert the interactiveform ui element into the view.1-4 save the new metadata by choosing the (save all metadata) icon from the toolbar.2 define form layout with adobe designeryou use the adobe designer to set up the layout of your pdf form. start th
9、is tool by choosing edit in the context menu of the interactiveform ui element in the outline pane. you can enlarge the designer window by double-clicking on the interactiveform1 tab.note: before you begin to layout your form, click on the show grid and snap to grid buttons in the toolbar of adobe d
10、esigner to facilitate your work. also ensure that object boundaries in the view menu is checked, in order to show the boundary that appears around objects on the page during design time.the following graphic shows the layout you will develop in this section:2-1 drag and drop the salutationtext from
11、the data view tab to the body pages pane of the adobe designer. a text field representation of the salutationtext appears on the body pages pane. select this text field and edit the following properties: click on the layout tab and choose none for the caption position. click on the object and then o
12、n the field tab and choose none for appearance. click on the value tab and choose read only for the type field.2-2 repeat these steps for the preambletext and closingtext. enlarge the text field for the preambletext and choose allow multiple lines on the field tab. to ensure that the data of the sal
13、utationtext and closingtext will be displayed completely, specify the width of these elements generously.2-3 go through the same steps for the date. unlike the text fields used above, a date field represents the date. on the paragraph tab select align right for the date field.2-4 save the new metada
14、ta by choosing the (save all metadata) icon from the toolbar.2-5 switch to the dynamicformview and select the implementation page. the following coding lines initialize the context elements, which are bound to the corresponding text fields and visible in the form. add the source code to the wddoinit
15、 method:wdcontext.currentdatasourceelement().setdate(new date(system.currenttimemillis();wdcontext.currentorderdataelement().setfirstname(john);wdcontext.currentorderdataelement().setlastname(smith);string salutationtext = dear +wdcontext.currentorderdataelement().getfirstname() + + wdcontext.curren
16、torderdataelement().getlastname() + ,;string preambletext = thank you very much for your order. please find + below the confirmation for your order, which includes your order + data and the items you ordered. we hope that you were satisfied +with our services. for any additional feedback or comment,
17、 +please contact us at your convenience.;string closingtext = best regards, sap online shop;wdcontext.currentdatasourceelement().setsalutationtext(salutationtext);wdcontext.currentdatasourceelement().setpreambletext(preambletext);wdcontext.currentdatasourceelement().setclosingtext(closingtext);2-6 o
18、n the implementation page of the dynamicformview, choose source - organize imports from the context menu, select java.sql.date and press finish.2-7 in the web dynpro explorer view, trigger deploy new archive and run for the dynamicformapp. the result should look like the screenshot below:3 enhance f
19、orm layout for order datain this section we will layout the order data of the confirmation. the following graphic shows how we want the layout of the order data to appear:3-1 in order to enhance the form layout with the order data, switch back to the adobe designer view of the interactiveform1 eleme
20、nt. drag and drop the static text element from the standard library tab to the body pages pane, select this element and change the text to order data. mark the whole text and set the style on the font tab to bold.3-2 drag and drop the line element from the standard library tab to the body pages pane
21、 and enlarge the line so that it covers the width of the page.3-3 drag and drop the firstname node from the data view tab to the body pages pane of adobe designer. a text field representation of firstname appears on the body pages pane. select this text field, add a colon at the end of the caption t
22、ext and edit the following properties: click on the object tab, then the field tab and choose none for appearance. click on the value tab and choose read only for the type field. click on the paragraph tab, choose edit value under currently editing value properties. and select align right.3-4 repeat
23、 these steps for the lastname, customerid, orderid, orderdiscount, and orderprice nodes.3-5 save the new metadata by choosing the (save all metadata) icon from the toolbar.3-6 switch to the dynamicformview and select the implementation page. add the following source code at the end of the wddoinit m
24、ethod:wdcontext.currentorderdataelement().setcustomerid(1212);wdcontext.currentorderdataelement().setorderid(5245);wdcontext.currentorderdataelement().setorderdiscount(10%);wdcontext.currentorderdataelement().setorderprice(2345.67 usd);these coding lines initialize the order data context elements, w
25、hich are bound to the corresponding text fields and visible in the form.3-7 in the web dynpro explorer view, trigger deploy new archive and run for the dynamicformapp. the result should look like the following screenshot:4 integrate tables into pdf formsin this section, we will layout the order item
26、s of the confirmation using a table. the following graphic shows the intended layout of the order data:4-1 in order to enhance the form layout with the order items, switch back to the adobe designer view of the interactiveform1 element. drag and drop the static text element from the standard library
27、 tab to the body pages pane, select this element and change the text to order items. mark the whole text and set the style on the font tab to bold.4-2 drag and drop the line element from the standard library tab to the body pages pane and enlarge the line so that it covers the width of the page. alt
28、ernatively, you can copy and paste within the adobe designer the line used before for the oder data, and use the new instance for the order items.4-3 drag and drop the static text element from the standard library tab to the body pages pane, select this element and change the text to product id. mar
29、k the whole text and set the style on the font tab to underline.4-4 repeat the last step for static text fields named product name and product quantity.4-5 drag and drop a subform element from the standard library tab to the body pages pane. enlarge this subform over the whole width. drag and drop a
30、 second subform element from the standard library tab to the body pages pane within the first one. make the 2 subforms the same size.drag and drop the element productid from the data view tab to the body pages pane of the adobe designer within the second subform. a numeric field representation of th
31、e productid appears on the body pages pane within the second subform. select this numeric field and edit following properties: click on the layout tab and choose none for the caption position. click on the object tab, then on the field tab and choose none for appearance. click on the value tab and c
32、hoose read only for the type field.4-6 proceed in the same way for productname and productquantity. 4-7 select the numeric field for productquantity and click on the paragraph tab, choose edit value under currently editing value propertiesand select align right.4-8 click on the hierarchy tab, select
33、 the subform1 and enter in the subform tab of the object tab flow content for the type and table for the flow direction. 4-9 select the inner subform2 in the hierarchy tab and enter in the subform tab of the object tab flow content for the type and table row for the flow direction. in the binding ta
34、b of the object tab activate repeat subform for each data item.4-10 enlarge the numeric field for productid, so that it will use the whole space under the static text labeled productid. do the same for productname and productquantity.4-11 save the new metadata by choosing the (save all metadata) ico
35、n from the toolbar.4-12 switch to the dynamicformview and select the implementation page. add the following source code at the end of the wddoinit method:iprivatedynamicformview.iorderitemselement orderitemselement =wdcontext.createorderitemselement();orderitemselement.setproductid(1002);orderitemse
36、lement.setproductname(trekking bike);orderitemselement.setproductquantity(1);wdcontext.nodeorderitems().addelement(orderitemselement);orderitemselement = wdcontext.createorderitemselement();orderitemselement.setproductid(1023);orderitemselement.setproductname(mountain bike);orderitemselement.setprod
37、uctquantity(2);wdcontext.nodeorderitems().addelement(orderitemselement);orderitemselement = wdcontext.createorderitemselement();orderitemselement.setproductid(1046);orderitemselement.setproductname(bmx bike);orderitemselement.setproductquantity(1);wdcontext.nodeorderitems().addelement(orderitemselem
38、ent);these coding lines initialize the order items context elements, which are bound to the corresponding fields and visible in the form.4-13 in the implementation page of the dynamicformview, choose source - organize imports.4-14 in the web dynpro explorer view, trigger deploy new archive and run f
39、or the dynamicformapp. the result should look like the following screenshot:5 integrate images into pdf formsin this section, we will integrate images into the confirmation. the following graphic shows how the images will be integrated:the left graphic represents an application-specific image that w
40、ill be integrated dynamically, and the right one represents the company logo, which is a static image. 5-1 in order to integrate images in the form layout, switch back to the adobe designer view of the interactiveform1 element. drag and drop the static image element from the standard library tab to
41、the body pages pane.5-2 select the static image element on the body pages pane, click on the object tab and select the sap_corporate.gif for the url entry under the component folder in the corresponding mimes folder of the project wd03_advanced_adobeforms ( wd03_advanced_adobeformssrcmimescomponentscom.sap.training.wd.adobe.dynamicformcomp). in addition, activate embed image data and select use image size for the sizing field.5-3 for the left image, drag and drop an image field element from the standard library tab to the body pages pane. select this image field and edit t
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026国家公务员金融监督管理总局招考(面试)历年参考题库含答案详解
- 2026四川省机关事业单位工人技术等级考试(造林更新工)历年参考题库含答案详解
- 2026四川省机关事业单位工人技术等级考试(地震观测工)历年参考题库含答案详解
- 2026四川建筑施工特种作业人员考试(物料提升机安装拆卸工)历年参考题库含答案详解
- 2026吉林省机关事业单位工人技术等级考试(畜禽育种工·初级)历年参考题库含答案详解
- 2026吉林机关事业单位工人技术等级考试(食品检验工·初级)历年参考题库含答案详解
- 2026卫生高级职称面审答辩(健康教育与健康促进)历年参考题库含答案详解
- 2026卫生高级职称考试(健康教育与健康促进)历年参考题库含答案详解
- 2026卫生专业技术资格考试(骨外科学-相关专业知识与专业知识·主治医师)历年参考题库含答案详解
- 2026卫生专业技术资格考试(病案信息技术-专业知识·初级士)历年参考题库含答案详解
- 河南华师联盟2027届高三上学期10月质量检测语文+答案
- 2026年高级会计师考试题+参考答案
- 湖南省自然科学基金学科分类目录及代码(新申报版)
- 2026年人教版新教材数学五年级上册第二单元《小数乘法》检测题(含答案)
- 2026年秋季四年级数学人教版第二单元单元检测卷(含答案)
- 2026年智慧助老行动培训课件
- 2026年鞍山市台安县事业单位面向应届毕业生公开招聘高层次急需紧缺人才15人笔试模拟试题及答案详解
- 《对比之魅》教学课件-2026-2027学年人美版(新教材)小学美术四年级上册
- 2026年静疗专科护士考核考试题库(含答案)
- 给孩子加入少先队的一封信【3篇】
- 实施培训财务共享中心
评论
0/150
提交评论