Need some rich:modalPanel + A4J Help
bsmithjj Sep 26, 2007 2:49 PMHello,
I am trying to use a single rich:modalPanel to display content for multiple rows using Ajax4JSF. I'm having trouble figuring out what the best way to do this is...
I have a dataTable of rows - for each row, there will be a link that, when clicked should display the rich:modalPanel with a detail form for the clicked row.
Here is the data table:
<rich:dataTable value="#{draftAccessRequestMaster.draftAccessRequestsList}" var="draft"> <f:facet name="header"> <rich:columnGroup> <rich:column colspan="2"> <h:outputText value="Choose Entitlements for Your Selected Applications" style="font-size:12pt;font-weight:bold;"/> </rich:column> </rich:columnGroup> </f:facet> <rich:column> <f:facet name="header"><b>Application</b></f:facet> <h:outputText value="#{draft.application.name}"/> </rich:column> <rich:column> <f:facet name="header"><b>Role</b></f:facet> <rich:panel id="#{draft.application.id}_roles"> <button title=" Choose roles. " class="buttonSearch" style="margin-left:5px;" onclick="return chooseRoles('#{draft.application.id}');"> <img src="img/add2-16x16.png" border="0" alt=" Add roles " align="top" style="padding-top:1px;padding-bottom:1px;"/> Choose Roles </button> </rich:panel> </rich:column> </rich:dataTable>
Here is the modal panel:
<rich:modalPanel id="chooseRoles"> <f:facet name="header"> <h:outputText value="Select Roles for Application" style="padding-left:5px;"/> </f:facet> <f:facet name="controls"> <h:graphicImage value="img/close.gif" alt="Close Search" style="cursor:pointer;padding-right:5px;" onclick="Richfaces.hideModalPanel('chooseRoles');"/> </f:facet> <a4j:form id="roleTreeForm"> <input type="hidden" name="draftRowId" value=""/> <input type="hidden" name="conversationId" value="#{conversation.id}"/> <a4j:jsFunction name="updateTree" reRender="rolesTree"/> <a4j:region id="rolesTree">Hello</a4j:region> <a4j:commandButton value="A" id="A" reRender="rolesTree" style="display:none;"/> </a4j:form> Role Choose goes here... </rich:modalPanel>
I'll need to use some type of Ajax-update call in order to make the modal panel show content specific to the selected row. I've seen the wizard examples but this isn't really the same as the wizard approach - does anyone know how to:
Show a modalpanel and on show, have an ajax request fire to obtain content for the modal panel?
Thanks,
Brad Smith