Skip to Content

What is the most elegant way to do a partial invalidate?

Design question:

I recently discovered that using a context's INVALIDATE method actually clears the entire node before the supply function is called. So far it's never been an issue.

The problem comes in when you actually want to just perform an update of some context elements/attributes. I was under the impression I can still access the current element values in the supply method and just change what needs changing. Not so, supply means I need to supply everything from scratch.

OK, so this makes it inefficient to use supply methods for larger datasets, and we must supply/update the context in the WD* methods. I get that. The invalidate-and-supply technique however is at it's most useful when there is a lot of interaction between elements & components. So what is the best approach when invalidate is the best strategy, but we don't want to do a complete refresh?

FWIW, the scenario that prompted this was a table with a tree element. The underlying node contains both the data and the tree state (EXPANDED attribute). So clicking anything that prompts an update (via INVALIDATE) would collapse the tree, which can annoy a user.

So far my best approach is a "state management" node with "x needs updating" flags in the context and evaluating them in the WDDO* methods. But that just seems a bit clumsy compared to what the framework already provides, so I'm wondering if there are any other approaches I might have missed?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers