cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic UIElements

nikhil_bose
Active Contributor
0 Kudos

hi,

How can I refresh dynamically generated UIElements ?

suppose I have a container and few labels which corresponds to number of elements of a node // node.size(); Those are get populated if we give values for the first time. But when I go back and add/delete one element in the node, that is not reflected. (reason: if(firstTime) ).

I tried

container.removeAllChildren(); and

container.removeChild("label"); too.

But still it shows duplicate id error

please tell me how can the UIElements be refreshed ?

nikhiL

Accepted Solutions (1)

Accepted Solutions (1)

snehal_kendre
Active Contributor
0 Kudos

HI Nikhil,

Use

wdContext.wdGetAPI().reset(true);

it`ll refresh each and every UI element.

nikhil_bose
Active Contributor
0 Kudos

I don't want to refresh elements which are already displayed.

let me be more specific:

1)

I have a node with 5 elements

: in the second view, 5 containers and 5 labels are added

2)

now, I go back to first view and add one more element

: in second view only 5 elements are displayed since it is coded inside if(firstTime) block.

If I do removeAllChildren() without checking for firstTime, it shows duplicate ID error // while dynamic creation for step 2.

nikhiL

snehal_kendre
Active Contributor
0 Kudos

HI Nikhil,

Exactly what you want to do?

give a try. set property of youe second view as WHEN VISIBLE rather than framework controlled

Former Member
0 Kudos

Hi Nikhil,

By changing the second view's property from framework controlled to " when visible ", will help you in destroying the UI elements in the second view as soon as you navigate away from that... Now once you are back in your first view and make the desired changes in there, ensure that your coding in the if (firsttime) of second view is done appropriately to accomodate the changes that you make in your first view...This will resolve your issues with getting duplicate ids...

Regards,

Pinac

Answers (1)

Answers (1)

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Nikhil,

For resetting dynamic UI elements : view.resetView();

This will reset view to the state befoe UI modifications. Then create UI elements again, now with new parameter(s)

Regards, Suresh KB