Tuesday, July 29, 2003

I'm currently finding it difficult to model complex interfaces and have them maintain state without being tightly coupled. For example, I've got a tabbed panel interface that decides which tab to show you based on a request param (it's stolen straight out of the Struts examples). That works great in that the contents of the tabs don't have to know they are being displayed inside a tab. However, one of these tabs contains a form. The problem is, when the form is submitted, the response doesn't return to that tab because the form doesn't include that "tab select" parameter. I could work around this by storing the selected tab in the session, but then the page wouldn't work if the user had more than one browser open. For the moment, I've bitten the bullet and added "selectedTab" as a parameter submitted by the form. And I guess it's not that bad a solution, since it doesn't affect the behavior of the form (I.e. the page would work fine outside a tabbed layout). Still, it feels wrong. I'll keep looking for a better solution.

No comments: