Freely Programmed Value Help in the WebDynpro appl

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

WebDynproABAPFrameworkallowsyoutocreateyourowninputhelpcomponents.AcomponenttobeusedasvaluehelpmustimplementinterfaceIWD_VALUE_HELP(seeWorkingwithWebDynproComponentInterfaces).Oncethefreelyprogrammedvaluehelphasbeenlinkedtoacontextattribute,thevaluehelpisautomaticallyavailableforeveryInputFieldlinkedtothisattribute.ForDetails::CreateaWebdynproComponentwithname'ZWDC_HELP_1'.PressEnter.DeclaretheIWD_VALUE_HELPinImplementedInterfaceslistinyourWDcomponentasshownbelow.PressEnter.AfterpressingReimplementbutton,youwillseeasshownbelow.GotothepropertiestabofCOMPONENTCONTROLLERandpressCreateControllerUsage..AfterpressingtheCreateControllerUsagebutton,thecomponentwillbeshownasSelectthefirstcomponenti.e.WD_VALUE_HELPGotocontexttabtocreateanodeND_TEXTanditspropertiesareasshownbelowi.e.InterfacenodeasYES...Createanattribute...AttributenameINPUT_1anddeclaretypeasSTRING...GotoAttributestabandcreateanattributefortheinterfaceIF_WD_VALUE_HELP_LISTENERasVALUE_HELP_LISTENER(asshownbelow)GotoEventstab,youwillseetwoeventswhichareautomaticallycreatedassoonasyouaddthecontrollerWD_VALUE_HELPinthepropertiestabandtothataddanothereventVH_DATA_SELECTEDandcheckthatinterfacecheckbox..GotoMethodstabandthereyouwillseeamethodSET_VALUE_HELP_LISTENERwhichisautomaticallygenerated...Doubleclickonthatmethodandwritethefollowingcodeasshownbelow...WD_THIS-VALUE_HELP_LISTENER=LISTENER.ThengototheviewV_MAINandcreatethreeelementsLABEL,INPUTFIELDandBUTTON...GotocontexttabofthatviewanddraganddroptheinterfacenodeND_TEXTfromthecomponentcontroller...BindtheINPUTFIELDwiththeattributeINPUT_1...WriteOnActioneventforthebuttoncreatedasshownbelow...WritethefollowingcodeinthatOnActionbuttoneventhandlermethod...WD_COMP_CONTROLLER-FIRE_VH_DATA_SELECTED_EVT().WD_COMP_CONTROLLER-VALUE_HELP_LISTENER-CLOSE_WINDOW().GotothewindowcontrollerandtherewillbeawindownamedWD_VALUE_HELP...DraganddroptheViewV_MAINtothatwindow...NowtheabovecomponentwilldisplayassoonasF4buttonispressedinthefollowingcomponent.CreateanothercomponentZWDC_HELP_RESULTCreateviewV_MAINasshownbelowGotoUsedComponentstabandincludethecomponentcreatedpreviouslyZWDC_HELP_1andnameitasFREEasshownbellow...GotoCOMPONENTCONTROLLERandfurthertopropertiestab...IncludethatUsedComponentFREEasshownbelow...GototheContextoftheCOMPONENTCONTROLLERandthereyouwillseetheInterfacenodeND_TEXTwhichyouhavecreatedinthepreviouscomponent...Draganddropit...CreateanotherNodeND_RESULTandanAttributeRESTEXTwithTypeasSTRING,InputHelpModeasFreelyProgrammedandincludethecomponentnamewhichyouhavedefinedasshownbelow...GotoMethodstabandcreateanEventHandlerMethodTESTandincludetheeventVH_DATA_SELECTEDinthecomponentuseFREEasshown...DoubleclickthatEventHandlerMethodTESTandwritethefollowingcodingforgettingtheInputfieldvaluefromFREEcomponentandsettingthatvaluetotheAttributewhichyouhavecreatedinthiscomponent...(GetcodingfromtheReadContextinWizard)DATALO_ND_ND_TEXTTYPEREFTOIF_WD_CONTEXT_NODE.DATALO_EL_ND_TEXTTYPEREFTOIF_WD_CONTEXT_ELEMENT.DATALS_ND_TEXTTYPEWD_THIS-ELEMENT_ND_TEXT.DATALV_INPUT_1LIKELS_ND_TEXT-INPUT_1.DATALO_ND_ND_RESULTTYPEREFTOIF_WD_CONTEXT_NODE.DATALO_EL_ND_RESULTTYPEREFTOIF_WD_CONTEXT_ELEMENT.DATALS_ND_RESULTTYPEWD_THIS-ELEMENT_ND_RESULT.DATALV_RESTEXTLIKELS_ND_RESULT-RESTEXT.*navigatefromCONTEXTtoND_TEXTvialeadselectionLO_ND_ND_TEXT=WD_CONTEXT-GET_CHILD_NODE(NAME=WD_THIS-WDCTX_ND_TEXT).*getelementvialeadselectionLO_EL_ND_TEXT=LO_ND_ND_TEXT-GET_ELEMENT().*getsingleattributeLO_EL_ND_TEXT-GET_ATTRIBUTE(EXPORTINGNAME=`INPUT_1`IMPORTINGVALUE=LV_INPUT_1).*navigatefromCONTEXTtoND_RESULTvialeadselectionLO_ND_ND_RESULT=WD_CONTEXT-GET_CHILD_NODE(NAME=WD_THIS-WDCTX_ND_RESULT).*getelementvialeadselectionLO_EL_ND_RESULT=LO_ND_ND_RESULT-GET_ELEMENT().LV_RESTEXT=LV_INPUT_1.*SetsingleattributeLO_EL_ND_RESULT-SET_ATTRIBUTE(EXPORTINGNAME=`RESTEXT`VALUE=LV_RESTEXT).NowgototheviewV_MAINandfurthertotheContexttab..DraganddroptheCreatednodeND_RESULTfromthecontextofCOMPONENTCONTROLLERtothisviewcontext..GototheLayoutoftheViewandcreateaLabelandInputfieldBindthevaluefortheinputfieldtotheattributeRESTEXTasshownbelow...NowcreatetheApplicationforthiscomponent..RuntheApplication..TheresultwillbeAssoontheuserpresstheF4button,youwillseeasshownbelowPressApplyButtonandthevaluepassestotheInputfield...

1 / 16
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功