cancel
Showing results for 
Search instead for 
Did you mean: 

Adding fields on click of button

Former Member
0 Kudos

Hi All

The requirement is -

There is a form for user to put in his educational detail.

On click of a button, the same form appears below the existing form for user to put in more educational qualification.

I have created a view in a webdynpro project which contains a form having a transparent container say tcEducationDetails having some textviews and inputfields.

It contains a button "Save and Add".

Now i want that on click of this button a new container with exactly same elements i.e i need a duplicate copy of the container tcEducationDetails gets generated and added to RootUIElementContainer.

Instead of making all the containers and the UI elements dynamically and adding to RootUIElementContainer can we just create a copy of tcEducationDetails and add to RootUIElementContainer

OR

Can we create a table having fields not placed as columns but placed as in a form(one below the other) and on click of a button a new row (Containing fields in a form layout) gets added.

Hope i am clear with the requiremnt.

Please help. Points will be rewarded.

Thanks and Regards

Sonal Mangla

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can Create all this at design time and set the visibility to false in the beginning and based on your condition you can make them visible.

"Can we create a table having fields not placed as columns but placed as in a form(one below the other) and on click of a button a new row (Containing fields in a form layout) gets added."

You can give a try with row repeater UI Element.

Regards

Ayyapparaj

Answers (1)

Answers (1)

amolgupta
Active Contributor
0 Kudos

hi,

if you know the exact UI elements you will be needing during design time...

you can keep them on the form and make them invisble.

ELSE

you can use Dynamic programming...

through which you can create UI elements as well as the context at runtime.

regards,

-Ag.

Former Member
0 Kudos

Thanks Ayyapparaj and Amol

I dont know how many times user will click on save and add

button. He can 1 or 2 or 3 or n no. of qualifications.

On every click of a button i need that form to get regenerated.

So the problem persists

amolgupta
Active Contributor
0 Kudos

hi,

as you are talking about qualifications....

u can may be fix that at max there can be 6 qualifications....

just put the UI on the layout and make it invisible/visible on requirement.

like when the user choses 1 just make visible one set of UI,

when he chooses 2 make 2 sets of the UI visible, as and when required.

ELSE

you'll have to Dynamically create UI and respective context.

and Dynamic wont be as easy as the former.

regards,

-Ag.

Former Member
0 Kudos

Thanks all for your support. At lest i got to know that i have no other option other than dynamic programming.

Rewarded points to both of you.

Regards

Sonal