Hi guys,
I was wondering of a good strategy of making a panel that is changed via
ajax by a select field.
I was aiming at easy maintainability of the code, and thought of the
following.
+---------+-+ +---------------+
|typeOfPan|V| | |
+---------+-+ | Panel |
| |
+---------------+
I add an Ajax Behaviour to typeOfPan. The target of updating will
contain the second panel.
I have several versions of the Panel - for example one with text input
fields, several with selects and probably more in the future.
In the page I add a normal Panel. However I overload its onComponentTag,
onComponentTagBody, renderHead and delegate them to those of the real
panel that has the real components. I switch the real panel based on the
selection of typeOfPan. All of the panels are constructed with the same
id, however, just one of them is added to the page.
Will such a strategy actually work? I will be experimenting today,
however two things can be tricky - the id's in html of the real panels -
since they have never been added properly to the page and the second is
the real html that will be used to render the panel. Will that be the
one from the delegating panel or that of the real implementations?
I'd really like to separate the panels - each with its own code and html
and be able to switch between them, so if there is a better (or in fact
other working way) comments would be welcome.
Kind regards:
al_shopov
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]