Reputation: 2177
How can i show a rich:popupPanel in richfaces 4 m5? The next code doesn't work for me.
<a4j:commandLink value="#{bean.phone}" render="popDiv" execute="@this" >
<f:setPropertyActionListener target="#{personController.person}" value="#{bean}" />
<rich:componentControl target="personModalPanel" operation="show" event="onclick" />
</a4j:commandLink>
<rich:popupPanel id="personModalPanel" modal="true" width="200" height="200">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Edit Person" />
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="/resources/img/x.png" styleClass="hidelink" id="hidelink" >
<rich:componentControl target="personModalPanel" operation="hide" event="onclick" />
</h:graphicImage>
</h:panelGroup>
</f:facet>
</rich:popupPanel>
Upvotes: 2
Views: 6959
Reputation: 1134
In Richfaces 4, you need to write event name without 'on' word. So the given code should work for you.
<a4j:commandLink value="#{bean.phone}" render="popDiv" execute="@this" >
<f:setPropertyActionListener target="#{personController.person}" value="#{bean}" />
<rich:componentControl target="personModalPanel" operation="show" event="click" />
</a4j:commandLink>
<rich:popupPanel id="personModalPanel" modal="true" width="200" height="200">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Edit Person" />
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="/resources/img/x.png" styleClass="hidelink" id="hidelink" >
<rich:componentControl target="personModalPanel" operation="hide" event="onclick" />
</h:graphicImage>
</h:panelGroup>
</f:facet>
</rich:popupPanel>
Upvotes: 2
Reputation: 11
Here is the core of the popup panel.
<a4j:commandLink value="Register"
onclick="#{rich:component('regWizard')}.show()">
</a4j:commandLink>
<rich:popupPanel id="regWizard"
autosized="true"
modal="true"
onmaskclick="#{rich:component('regWizard')}.hide()">
<f:facet name="header">
<h:outputText value="Registration Wizard" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#"
onclick="#{rich:component('regWizard')}.hide(); return false;">
X
</h:outputLink>
</f:facet>
</rich:popupPanel>
Upvotes: 1