cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger TextEdit Event

Former Member
0 Kudos

Hi all,

I am working on an app that incorporates a rich text editor. The goal is to submit the rich formatted text to a database. I have been able to incorporate the editor into the application through the use of a WDIFrame. I then use a JavaScript function to load the formatted text from the rich text editor into a WDTextEdit bound to a string. The WDTextEdit displays the text. The problem is the text does not get stored in the bound variable unless some user interaction is preformed on the WDTextEdit. Does anyone know of a way to have the WDTextEdit trigger the script that stores its value into the bound variable without user interaction? Or is this even possible?

Any help would be greatly appreciated.

Thanks,

Jonathan

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Johnathan,

Well this is possible in "hacker" manner :-). If you will check HTML code generated by WD you will see that there is


<form id="_SSR_UploadForm" ... >
...
<input type="hidden" name="sap-wd-cltwndid" value="f0d3fb4018f511db931c000ae42efb11">
<input type="hidden" name="sap-wd-appwndid" value="Idf0d3fb4018f511db931c000ae42efb112">
<input type="HIDDEN" name="sap-wd-norefresh" value="X"/>
<input type="HIDDEN" name="eventQueue" value=""/>
</form>

This can vary for different SP levels but my SP14 looks so.

So, you need to set "eventQueue" to correct value and send the "_SSR_UploadForm" form to server. I would suggest you to insert button to the view, install HttpWatcher and check what is the format of eventQueue parameter when you change content of textedit and press the button. The you need to remove the part which is responsible for button.

I don`t have text edit but have inout field by the approach is the same:

<i>eventQueue = INPUTFIELDCHANGE event event ControlId MHOG.GenericFilterView.InputField1 Value zzz cxvxcv BUTTONCLICK event event ControlId MHOG.GenericFilterView.Button2 CurrentFocusId MHOG.GenericFilterView.Button2 time_parse 50 time_applyInnerHTML 40 time_scriptBeforeHTML 0 time_scriptAfterHTML 10</i>

we need

<i>eventQueue = INPUTFIELDCHANGE event event ControlId MHOG.GenericFilterView.InputField1 Value zzz cxvxcv

</i>

in this case.

So, it is really "hacker-approach" which I really suggest to avoid!!! Be ready to fix for installation on every new SP!

Best regards, Maksim Rashchynski.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you Maksim and Thomas for your replies,

I have been able to successfully trigger the text edit event to store a string to the bound context element. By manipulating and uploading the SSRTransform form generated by the WD framework I am able to trick the framework into registering an event. I hope that Web Dynpro will eventually incorporate a rich text editor similar to the HTMLB element or allow easier access to the some of the WD framework functions.

Thanks,

Jonathan

thomas_szcs
Active Contributor
0 Kudos

Hi Jonathan,

There is no officially supported way to achieve what you are planning. Please do not use internals of the web dynpro framework. There will be no support if it does not work beyond a given support package - and it is quite likely that we are going to make enhancements to the internals of the Web Dynpro framework over time. So: Don't do it.

Best regards,

Thomas