cancel
Showing results for 
Search instead for 
Did you mean: 

updating / refreshing view

Former Member
0 Kudos

Hi.

Can someone please point me in the right direction. I am having troubles refreshing a view and updating view elements with new data.

There are two groups within a single view. first contains a table, second some input fields. I have a copy button in the table toolbar and I want to copy fields from the selected row into the inputfields below.

I am doing this with something like this in the onActionCopyLine():

wdContext.currentContextElement().setField(wdContext.currentXxxElement().getField());

...but the input fields are not refreshed with the new values.

I reckon I need to refresh the view (with wdDoModifyView?), but am not sure how to do so.

Many thanks in advance! ( <b>Points promised for helpful answers!</b> )

faB

PS. Would it be better pratice to put the 2nd group in a new view and call the navigation plug in the onActionCopyLine()?

Message was edited by: faB

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use data binding instead of copying.

Bind the "value"-property of the InputField to the same context attribute as the table column editor and it automatically gets the value in the selected row.

Armin

Former Member
0 Kudos

Hi Armin,

Good idea, but I don't think your suggestion is possible in my case, because some of the input fields have extended input help and it's not possible bind the inputfields to a model context attribute. I have to have a separate field and do a copy at runtime.

(or so was determinded in this thread: )

faB

Former Member
0 Kudos

Hi faB

I tried this out and worked perfectly fine for me. I used code similar to what you have tried out. I can only assume that you have some code in your wdDoModifyView that is prohibhting this from happening. Comment everything else out and try only this.

wdContext.currentContextElement().setField(wdContext.currentXxxElement().getField());

Regards

Pran

Former Member
0 Kudos

Pran,

I think I am calling the wdDoModifyView incorrectly from the eventhandler.

How are you calling it?

faB

Former Member
0 Kudos

Dont call it all. It is automatically called

Former Member
0 Kudos

ok, half way there.

upon initial loading the the view, the values are copied (from the (default) 1st line of the table)

but I have implemented a "Copy Line" button that should copy the selected line to the input fields. the view is not being refreshed with the new values for the input field. any ideas?

faB

Former Member
0 Kudos

Hi faB

Strange....Have you attached the "Copy Line" button to action . The action should contain the line of code shown above. Inspite of this even if you face problems I suspect there is some code somewhere that is inhibhting it .. probably in wdDoModifyView

Regards

Pran

Former Member
0 Kudos

Hey there!

This is working now. The fields are being copyied during the wdDoModifyView.

Thanks,

faB

Former Member
0 Kudos

...which probably is the wrong place for modifying the context.

Armin

Answers (0)