This discussion is archived
4 Replies Latest reply: Aug 29, 2012 5:22 PM by DenisT RSS

Reset Feature state or its Beans

924371 Newbie
Currently Being Moderated
Hello.
I have 3 features, one for ordering meals, one that shows the user the meals he ordered for the next few days and one that shows the past orders and the overall costs.

Now if I order one new meal, how can I have the other flow "reset", so that the REST service is accessed again and shows the now newly added orders in the "future orders" flow?

A use case would be:
"what have i ordered for tomorrow" checks what he as ordered in flow 1
"no meat , i want meat!" goes to flow 2 and orders a nice steak
"lets see if that was successful" goes back to flow 1
now here is the problem. the state of flow 1 is saved from before, and it still shows the old data. Sure i could just create a method that deletes the old list of meals and then refills it again with another REST call, but it would be nicer to just have the flow restart from anew, then I don't need to code any code that is already there.

Greetings and a nice weekend to everybody.
Pascal
  • 1. Re: Reset Feature state or its Beans
    DenisT Explorer
    Currently Being Moderated
    Pascal, without seeing where/how you are actually calling your web services it will be hard to exactly help, but what I would suggest is the very first page of flow1 you always requery the meal summary from the WS instead of using cached data. You should be able to set the "refresh" attribute to "always" in the iterator or invokeAction in the binding. Again, I need to see how your pages work and how you are invoking the web service but something along these lines is what you need to do.
  • 2. Re: Reset Feature state or its Beans
    924371 Newbie
    Currently Being Moderated
    Hey. I ran into the same problem again, however now it seems to be more general.
    On page 21 of the participant guide it says "way to refresh a feature" : and then tells me to implement the activate() method in the featureLifeCycleListener class.
    Then when I call AdfmfContainerUtilities.resetFeature("feature1"); nothing happens. If you double click the iphones bottom button, something happens, however it navigates back to the custom springboard page. I put together a simple example app to show what i am talking about.

    Where to send it? its a 450kb zip file. I don't want to throw it up on rapidshare or anything.

    Have a good weekend everybody!
    Pascal
  • 3. Re: Reset Feature state or its Beans
    DenisT Explorer
    Currently Being Moderated
    Pascal, email me the application and I'll take a look.
  • 4. Re: Reset Feature state or its Beans
    DenisT Explorer
    Currently Being Moderated
    I just tried this and the resetFeature doesn't do anything if you try to reset the current feature. This is a defect and I've logged it.

    In the meantime, I suggest you go back to the first page in your taskflow and clear any data in your beans and let the data-change events kick in and reset the UI.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points