cancel
Showing results for 
Search instead for 
Did you mean: 

valueSelect and submit Events

Former Member
0 Kudos

Hello guys,

i use an interactive form in a webdynpro environment. I have a search help on the form which works well, but this seach help only fills one field in the form i.e. a personal number. I need more information on the form first name, last name and so on. So i tried to use the submit event directly after the valuehelp event but this is not working. With the submit event i want to read the field wich is filled by the valuehelp in the webdynpro action to read the other information and bring it via context to the form.

It is working with an addictional button with the submit in the click-event. But i dont want that the user must click 2 times (first value help second the addictional button). Is there any way to start

ContainerFoundation_JS.SendMessageToContainer(event.target,

                                                                  "valueSelect", .....

ContainerFoundation_JS.SendMessageToContainer(event.target, "submit", "", "", "", "");

after each other?

Or is it possible to raise a click-event in the field which is filled by the value help to start the submit?

Thank you for your help

André

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi André,

If you see the content in SendMessageToContainer, it is triggerring

doc.hostContainer.postMessage(strings);

when you trigger "valueSelect" parameter

and

clearValidateFailed(doc); &

doc.hostContainer.postMessage(strings);

when you trigger "submit" parameters

I would suggest you to customize your own SendMessageToContainer, if you want to execute them in single call. Hope this helps.

function

SendMessageToContainer(doc, type, payload1, payload2, payload3, payload4) {


// Send response to container


var strings = new Array();


strings[0]

= type;


strings[1]

= payload1;


strings[2]

= payload2;


strings[3]

= payload3;


strings[4]

= payload4;



// This is invoked to reset the highlighted fields to their original


// color. Reset only during "submit" and "check" operations.


   

if ((type == "submit") || (type == "check")) { 


         clearValidateFailed(doc);


    }



if(doc.hostContainer != undefined) {


try {


doc.hostContainer.postMessage(strings);


}

catch (ex) {


reportException(doc

, "Error while posting a message to the container: " + type +


                            " param1: "

+ payload1 + " param2: " + payload2 +


                            " param3: "

+ payload3 + " param4: " + payload4, ex);


}


}


}

Former Member
0 Kudos

Hello Xiangli,

thanks for your help, i tryed it, but unfortunately it doesn't work that way I made my own function, after that valueSelect Statement i put a app.Alert and after that i put the sumit Statement. The app.alert popup poped up before the valueSelect popup appeared. The submit function seems to be ignored .

regards

André

Former Member
0 Kudos

Hi Andre,

I assumed your preOpen event has already contains valueSelect script.

Can you try this?

Under the dropdown, exit event, code this Javascript and run at client

if

(this.rawValue != "" ) {


if (this.boundItem(this.rawValue) != "") {


this.rawValue

= this.boundItem(this.rawValue);


}


}

ContainerFoundation_JS.SendMessageToContainer(event.target

, "submit", "", "", "", "");

regards,

Xiang Li

Former Member
0 Kudos

Hello Xiang Li,

i forgot to say in my first post, that i dont use a dropdown-element on the form. I use a Value-Help-Element from the WebDynpro-Native Libary.

When i use it, then only the Click-Event is prefilled, i dont have the preOpen-Event in this case.

the prefilled code is the following:

var fieldName = "SWENR";

ContainerFoundation_JS.SendMessageToContainer(event.target, "valueSelect", xfa.resolveNode(theNodeName).dataNode.somExpression.replace(/(xfa.*?\.)(datasets.*?\.)(data.*?\.)/, ""), xfa.resolveNode(theNodeName).rawValue, event.target.mouseX, event.target.mouseY);

In the initial-event on the Field SWENR i check whether there is a value inserted by the Value-help, then i fire the click-event of my addictional button. In that click event i have the Submit statement and one app.alert, to see whether this statement will be reached.

Now my Test:

I click on my value-help Button -- Popup appears and i select my value -- then i press OK and the Value is transportted to my field SWENR -- then the app alerts popup cames up, but the Submit isnt working because the breakpoint in webdynpro isnt reached.

Nowi make a mouse click on the button, then the breakpoint is reached and the debugger is shown.

I dont know which went wrong there, but it seems that this is a problem with the message handler queue or something like that.

regards

André

Former Member
0 Kudos

Hi Andre,

Okay now i got you.

1. First click on button. Value Help window pop up and you select any of value.

2. This value populated to SWENR.

3. Click another button to trigger submit / roundtrip to populate some others fields.

And you want step 2 and 3 to be happened on the same time.

Have you ever try to return multiple value from your search help instead of SWENR only?

Otherwise, you would definitely need a button refresh button, as in step 3, to populate some others fields value.

I had the same issue as you before, if there are only 2-3 fields to be expected populated back to form after I have selected some value from search help windows; I will return those fields value from search help application.

If it required some rather complex logic to derived others field value; I do it using refresh button.

Hope this make sense to you too. Keep it simple.

regards,

Xiang Li

Former Member
0 Kudos

Hello Xiang Li,

thats bad 😕 so i do not have a chance to start a roundtrip without clicking on a button. For me it is the first time that i use adobe interactive forms with web dynpro .. i do not know how to get multiple values from a search help in the form, can you give me an example? Thank you.

regards

André

Former Member
0 Kudos

Hello Xiang Li,

thats bad 😕 so i do not have a chance to start a roundtrip without clicking on a button. For me it is the first time that i use adobe interactive forms with web dynpro .. i do not know how to get multiple values from a search help in the form, can you give me an example? Thank you.

regards

André

Former Member
0 Kudos

Hi Andre,

Okay, when you return the single value back to form, how you do that? Is that one of the returning parameter in your method?

Do you have something like Fieldname, Fieldindex, Fieldvalue?

Check this, not exactly same as your case, but this is one of the example how to return multiple value back to adobe form.

http://scn.sap.com/people/ian.stubbings/blog/2010/02/22/hcm-processes-forms-web-dynpro-abap-search-h...

regards,

Xiang Li

Former Member
0 Kudos

Yes, that was the hint i needed!! Thx alot Xiang Li.

When i press the "OK-Button" on my value Help in the Adobe Form, then i come into the WDDOMODIFYVIEW of the WebDynpro. There i can read the selected value and fill the corresponding Values to the Context.

Thx Alot.

André

Former Member
0 Kudos

Hi Andre,

You are most welcome.

I am glad you solve your issue now. Cheers.

regards,

Xiang Li

Answers (0)