cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic handling of Subforms

Former Member
0 Kudos

Hi Gurus,

I am working on a Interactive form using webdynro abap.

My scenario is , I have 4 radio buttons in a subform, whenever I select any radio button and click on save(which is a webdynpro action and not pdf save button), the selected radio button text will appear as the text in another field which is a read-only , which i have handled in webdynpro and the radio-button subform is hidden, which I have handled in the form using javascript.

My problem is when I click on 'EDIT' button(which is another webdynpro action), the radio-button subform should be displayed on screen with the last selected radiobutton. Please let me know how to handle this in the form.

Thanks,

Bharathi.

Accepted Solutions (1)

Accepted Solutions (1)

OttoGold
Active Contributor
0 Kudos

You need to create a hidden variable, where you will store the mode "EDIT" or "DISPLAY" and test this extra value in your scripting: both in JS in form scripting and in your backend, if necessary.

Regards Otto

Former Member
0 Kudos

Hi Otto,

I included a invisible field 'mode' in the main subform, handled that in webdynpro as well.

I am pretty new to JS, but this what I tried to do in the form to show the subform,

in the events initialise and Change, included the following:

if (this.mode.rawValue == 'EDIT') {

this.presence = "visible";

}

Doesnt seem to work , I know Im missing something or the syntax isnt entirely correct.

Please suggest.

Thanks a Ton,

Bharathi.

OttoGold
Active Contributor
0 Kudos

Hi,

double check the binding string of the mode field in your subform

double check, where is the script, it is placed on the parent subform of the mode field?

do you use event initialize?

do you have JavaScript set as the language? (sometimes formcalc is the default choice)

(this.mode.rawValue == 'EDIT' change to "EDIT"

Regards Otto

Former Member
0 Kudos

Hi Otto,

Thanks, it worked. Based on just the mode, I could hide/show the subform.

But, is there a way to fill the gap created by hiding the subform i.e, when I hide the radio button subform, the text below wrapped in a subform has to move up. I made the text subform "Flowed". That hasn't helped.

Is there any other setting I need to change or any JS to be included?

Thanks a lot!!

Bharathi.

Former Member
0 Kudos

Hello,

Make the subforms "hidden" and not "invisible".

I think this will solve your last problem.

Thanks,

Omkar.

OttoGold
Active Contributor
0 Kudos

make sure the parent subform (of the field you make hidden) has content: flowed. I hope you make our field hidden, becase invisible does not work they way you would like to (as Omkar said..).

regards Otto

Former Member
0 Kudos

Thanks guys!! it worked.

I included both the subforms in a parent subform and made the parent subform "flowed", it works even though the child subform is "positioned".

Answers (0)