|
Hi, Has anyone dynamically rendered JSF components while using
myfaces’ JspTilesViewHandlerImpl view handler? I have a WebGalileoFaces tabbed panel component. Its
listener attaches sub-tabs to it dynamically. The rendering works without
using the view handler above. Yet, when I use the myfaces handler, I get
an NPE. My listener impl is below. The view handler appears to cut off access to the actual
UIViewRoot so the form cannot be found. I’ve tried a couple calls
directly to the handler using context.getApplication().getViewHandler() yet,
none of the methods gave me access to it (well, that I could figure out). Ideas anyone? Thanks Lorinda public void
processTabSelected(TabSelectedEvent event)
throws AbortProcessingException { context =
FacesContext.getCurrentInstance(); // who sent the
event? FacesTabbedPanel
eventSource = (FacesTabbedPanel) event.getSource(); UIComponent
tabbedPanel = event.getComponent(); String tabName =
tabbedPanel.getId(); String formId =
tabbedPanel.getParent().getId();
LOG.info("Tab selected:
" + tabName);
LOG.info("Parent form: " + formId); UIForm form =
(UIForm) context.getViewRoot().findComponent(formId);
à NPE UIPanel panel
= (UIPanel) form.findComponent("childTabsGrid"); if (panel ==
null) {
LOG.error("PanelGrid 'childTabsGrid' could not be
found. "); } else {
// clear the childTabsGrid to prevent stacking child
tabs ß ATTACHES sub-tabs
here
panel.getChildren().clear();
ListSelectionModel selectionModel = eventSource.getListSelectionModel();
UIComponent newTabbedPanel = createSubTabbedPanel(selectionModel);
panel.getChildren().add(newTabbedPanel); } |

