on 03-28-2015 5:35 PM
Hi
I would like create function (who return value) in Web DynPro Abap using JavaScript. I found option using HTML Island.
My step are by web site
site 20-21.
I create script MyHTMLIsland.js who contains
var MyHTMLIsland = {
addCallback: function (callback) {
callback.fireEvent('Event','Hello Web Dynpro'); } };
In WDDOMODIFYVIEW i have
DATA: lo_html_island TYPE REF TO cl_wd_html_island.
IF first_time EQ abap_true.
lo_html_island ?= view->get_element( 'HTML_ISLAND' ).
lo_html_island->add_script_call( cl_wd_html_script_call=>new_call( )->variable( 'MyHTMLIsland' )->function( 'addCallback' )->add_callback_api( ) ).
ENDIF.
I have HTML_ISLAND under this is HTMLEVENT and HTMLSCRIPT
HTMLEVENT have name EVENT and onAction HTML_ISLAND_EVENT
In ONACTIONHTML_ISLAND_EVENT
wd_comp_controller->wd_get_api( )->get_message_manager( )->report_success( data ).
HTMLSCRIPT have only source MyHTMLIsland.js
Why this not working? What I have wrong?
Thank you
Hi
I create copy from WDR_HTML_ISLAND_TUTORIAL.
When I change on MIME file "wdr_html_island_tutorial.js" and append some string e.g. "callback.fireEvent('Event','My test - hello');" and use save change.
When I use test this EVENT - event work, but still write "Hello Web Dynpro" instead "My test - hello".
Why change on js file are dismissed? (When I look to MIME file "wdr_html_island_tutorial.js" - I see change)
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Johannes Konings
Thank you very much for your answer.
I make all thing as you show, but change dismiss.
I use:
righ click - and select CHANGE
then I create change in js file
then I save file (CTRL + S)
then I close file (ALT + F4)
but still not working
I must remove js file. In notepad create new file - but different name. And then import file with different name as before and then working.
Maybe problem in system setting? or problem because I create program in other language (not in english)? or because I use TMP package?
And second but very important problem is with event because not return event.
When I create own web dynpro application (not copy from demo) and import only "wdr_html_island_tutorial.js", use all method and setting like in WDR_HTML_ISLAND_TUTORIAL, program working partly.
Function saySomething working, but function addCallback not working.
When I call function addCallbak then cursor still runing (turn blue ring) - but not want finish - not jump to event action "HTML_ISLAND_EVENT"
Than you
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.