سؤال

I have a custom control where I loop thru an configuration object to build tabs for my interface.

I use a repat-control to loop thru the configuration and based on that value I wish to include different custom controls.

I thought of using an include-page-control but that doesn't seem possible since it can't use my repeat-control-variable.

I COULD list all my controls and hide/show them depending on the value of the repeat, but that's not a very elegant solution.

Am I missing something? Or isn't it possible to include a page/custom-control based on the value of a repeat?

هل كانت مفيدة؟

المحلول

Not "out of the box" - including a control in a page is a decision made on page load (think ${} timeframe) - If you have the desire you can inject the control using Java. Otherwise I would look at the Dynamic Content control from the ExtLib, which allows you to programmatically select a particular facet at runtime. Each facet is then dynamically added or removed from component tree as needed (Rather than the Switch Facet since that basically allows you to dynamically select between two different facets, one for "read-only" the other for "editing" for example).

نصائح أخرى

Have you tried the SwitchFacet Control of Ext Lib?.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top