cancel
Showing results for 
Search instead for 
Did you mean: 

Reloading a view

Former Member
0 Kudos

I'm developing an application where there is a thread running in the webdynpro application that updates the context. But this way the view is not updated automatically. Does anybody know how you can reload your view programmatically?

Accepted Solutions (0)

Answers (7)

Answers (7)

ChrisPaine
Active Contributor
0 Kudos

Hi Salomo,

I fear I may also be misunderstanding your requirement.

I understand - you have a thread which is populating the context with new values, but because it is doing it without any user interaction, the screen is not updating...

If this is the case, then one simple way to ensure the screen updates is to raise an event in the component with the thread doing the context updating, catch the event in the view you want to refresh, fire a plug to another view, in that new view's inbound plug event handler fire a plug back to the original view that you want to refresh.

It's a bit convoluted, and there might be better ways to do it. But it works!

Cheers,

Chris

Former Member
0 Kudos

HI Salomo,

In properties tab of ur View, Make LifeSpan as When_Visible

Regards

Fahad Hamsa

Former Member
0 Kudos

I'm getting the idea that people don't really know what I mean.

The problem is not that the data isn't available in the context. The problem is that if you run a thread in webdynpro that updates the context the UI control isn't updated automatically.

Now I have to refresh the view myself in the browser so it will display the data available in the context. It's all about data being updated when the view is already visible. With AJAX this would be no problem at all. Isn't there a way to do just that what AJAX does?

Former Member
0 Kudos

Salomo,

Yes, all replies you get here just don't make sense.

However, your question has no solutions due to nature of WD application: it renders content only during HTTP request/response cycle at final phase (when output is rendered). The only way to initiate HTTP request is user interactions from browser. I.e., WD works similar to "regular" Web applications but not to desktop applications (like ones created using Swing).

I'd also would not recommend you to use TimedTrigger to initiate HTTP request from client side. First, any user input will be lost. Second, WD API-s was designed for single-thread access, multi thread access will lead to errors/unpredictable behavior.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hi,

I have tried, wdContext.currentContextElement.invalidate(), view.resetview(), both does not work at all,

Use code:

Create a method in custom controller

example:

public void NewElement()

{

__Arch_Arm_Project_Create_Input create = new

__Arch_Arm_Project_Create_Input();

wdContext.node__Arch_Arm_Project_Create_Input().bind(create);

}

Call this method in either in boundplug or action in View. it clears all data and creates new element for you.

This will work!

thanks

Ravi Golla

Former Member
0 Kudos

Have you tried managing lifecycle of the view in a programmatic manner rather than letting webdynpro manage it automatically?

This works very well when you create context nodes or bind them at run time.

Former Member
0 Kudos

Hi Salomo,

Invalidate the table datasource node for the expected results.

Regards

Amit

Former Member
0 Kudos

If I do this in the main component no data is available anymore. If I do this in the view controller nothing happens.

I have 2 views one view with the search criteria and one view to display the results in a table. I display them with a view set. So the second view (Search result view) needs to be reloaded/refreshed so the data will be displayed. The data is available in the context because when I type in a row number in the table to be displayed and press enter the data is displayed.

Former Member
0 Kudos

Hi Salomo,

You can simply call

 wdContext.getContext().reset();

.

This will invalidate the context and also delete all the dynamically created nodes

and attributes.

Regards

Amit

    • reward points if found useful

Former Member
0 Kudos

I already tried doin this but that only removes the elements. That's not what I want. I need the newly created elements by the thread that is running to be shown in a table. This table needs to be refreshed so it can display the results. Does anybody know how you can do that?

Thnx in advance.

Former Member
0 Kudos

Hi,

try to use:

wdContext.getContext().reset(false);

to preserve existing data

Best regards,

Gianluca Barile

Former Member
0 Kudos

I tried this also but that doesn't give me the desired result. The context is updated but the view still doesn't display the result. Only if i resubmit my query by pressing on a button the table is displayed with the results from the previous search. So what I need is to refresh this table somehow.

Former Member
0 Kudos

Hi,

have a look at this thread:

Reward points for helpful answers.

Best regards,

Gianluca Barile