Skip to Content
author's profile photo Former Member
Former Member

Reloading a view

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 12:59 PM

    Hi,

    have a look at this thread:

    Reload of a view

    Reward points for helpful answers.

    Best regards,

    Gianluca Barile

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 01:06 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 01:39 PM

    Hi Salomo,

    Invalidate the table datasource node for the expected results.

    Regards

    Amit

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 03:31 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 08:50 AM

    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?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 11:53 AM

    HI Salomo,

    In properties tab of ur View, Make LifeSpan as When_Visible

    Regards

    Fahad Hamsa

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 30, 2007 at 12:49 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.