0

Me thinks there is something I'm not quite understanding with regards to the Registry.

I have an app. with 3 different tabs. In order to add a row to the grid on tab #3 you need to "select" a row in the grids on tabs #1 and #2. When you select a row in tabs #1 and #2 I save the row's "ID" get a "sessionInfo" object in the Registry (just an Object with a bunch of java.Strings in it).

If I 1st go to tab #3 (without selecting a grid row from #1 and #2) I get an error when attempting to add a row (which would be correct since nothing on #1 and #2 is selected). I then go back to tabs #1 and #2, select a grid row from each (which updates the "sessionInfo" Object in the Registry). I then go back to #3 and attempt to add a row but the "sessionInfo" appears to be not updated?!? (i.e. the selected Strings are still empty)

Checking the session variable is done in a private method (outside the onRender() method) called from the Add Button's SelectionListener.componentSelected() method.

~r

PS: I suspect it has to do with the Registry being an instance variable within the Tab #3 class?!?

PPS: I also update a gxt.ui.client.widget.Status widget. When I get that (also from the Registry) it is updated?!?!

PPPS: Please don't point me to the thread titled "Registry Pros and Cons". It's nice to say don't use the Registry and then provide no alternative other than "something is wrong with your app." ( clear however, not very useful.

Travis Webb
  • 14,688
  • 7
  • 55
  • 109
rfh
  • 47
  • 9

1 Answers1

0

You can still make some sort of Registry by using your own class based on a hashMap to store common data you could need in different place. I don't use Gxt but SmartGwt and you can have a look here perhaps it could help.

Alain BUFERNE
  • 2,016
  • 3
  • 26
  • 37