Issues when trying to pop up a modal Panel from a rich:datat
rajeshiv Jun 12, 2009 2:11 PMHi,
Iam trying to pop up a modal panel when I click a link , which is a column in my datatable. On clicking my a4j:commandLink, which is a column in my rich:datatable a modal panle should beopened . Code for my data table which has the commanLink
<rich:dataTable style="border:0px"value="#{SEARCH_RESULTS}" var="hit" id="searchresults" rendered="#{SEARCH_RESULTS != null && not empty SEARCH_RESULTS_SIZE}" headerClass="center" width="100%" binding="#{searchResultsBean.data}" rows="20" cellpadding="0" cellspacing="0" ajaxKeys="#{searchResultsBean.rowsToUpdate}"> <h:column> <h:panelGrid columns="3" border="0" id="searchResultsTable" width="100%" columnClasses="panel" style="border-bottom-style:solid;border-bottom-color:black;border-bottom-width:thin"> <rich:panel style="border:0px;margin:0px"> <h:selectBooleanCheckbox value="#{hit.selected}" id="selectBox" style="align:center" /> </rich:panel> <rich:panel style="border:0px;margin:0px"> <h:outputText style="font-weight:bold" value="This is a No-Hit File" rendered="#{hit.noHit}" /> <h:panelGrid columns="1"> <h:commandLink action="#{searchResultsBean.displayDetails}"> <h:outputText value="#{hit.lastName}," style="margin-right:1px;font-size:xx-small" /> <h:outputText value="#{hit.firstName}" style="font-size:xx-small" /> </h:commandLink> </h:panelGrid> </rich:panel> <rich:panel style="border:0px;margin:0px;align:right"> <h:commandLink action="#{searchResultsBean.displayDetails}" style="margin-right:2px;"> <h:graphicImage id="displayDetailsImage" alt="More Details" url="/images/more-details.JPG" style="border:0"/> </h:commandLink> <a4j:commandLink action="#{scenarioRecordBean.saveSingleStepScenario}" immediate="true" reRender="searchResultsTable" style="margin-right:2px;" onclick="#{rich:component('modalPanel')}.show()"> <h:graphicImage id="oneStepScenarioImage" alt="One Step Scenario" url="/images/oneStepScenario.JPG" style="border:0"/> </a4j:commandLink> <h:commandLink action="#{searchResultsBean.exportRawResponseForASingleRecord}" style="margin-right:2px;"> <h:graphicImage id="downLoadOrExport" alt="Export" url="/images/export.JPG" style="border:0"/> </h:commandLink> <h:commandLink action="#{searchResultsBean.editFile}" style="margin-right:2px;" rendered="#{not hit.noHit || (oneLineSearchBean.selectedDataSource=='transunion' && oneLineSearchBean.searchText != 'hit:N' && oneLineSearchBean.searchText != 'hit:n')}"> <h:graphicImage id="editImage" alt="Edit" url="/images/copy-edit.JPG" style="border:0"/> </h:commandLink> <h:commandLink action="#{scenarioRecordBean.addToScenario}"> <h:graphicImage id="addToScenarioImage" alt="Add To Scenario" url="/images/addToScenario.JPG" style="border:0"/> </h:commandLink> </rich:panel> <rich:panel style="border:0px;margin:0px"> <h:outputText value=" "/> </rich:panel> <rich:panel style="border:0px"> <h:panelGrid columns="1" border="0"> <h:outputText value="#{hit.ssn}" style="font-size:xx-small"/> <h:panelGroup> <h:outputText value="#{hit.strtNum}" style="margin-right:1px;font-size:xx-small"/> <h:outputText value="#{hit.strtName}" style="margin-right:1px;font-size:xx-small"/> <h:outputText value="#{hit.strtType}," style="margin-right:1px;font-size:xx-small"/> <h:outputText value="#{hit.city}," style="margin-right:1px;font-size:xx-small"/> <h:outputText value="#{hit.state}," rendered="#{not hit.canadianAddress}" style="margin-right:1px;font-size:xx-small"/> <h:outputText value="#{hit.province}," rendered="#{hit.canadianAddress}" style="margin-right:1px;font-size:xx-small"/> <h:outputText value="#{hit.zip}" rendered="#{not hit.canadianAddress}" style="font-size:xx-small"/> <h:outputText value="#{hit.postalCode}" rendered="#{hit.canadianAddress}" style="font-size:xx-small"/> </h:panelGroup> </h:panelGrid> </rich:panel> <rich:panel style="border:0px;margin:0px"> <h:outputText value=" "/> </rich:panel> <rich:panel style="border:0px;margin:0px"> <h:outputText value=" "/> </rich:panel> <rich:panel style="margin:0px; align:top;width:50%"> <h:panelGrid columns="1" border="0" style="height:4px;margin:0px" bgcolor="#70A0FF" cellspacing="0" cellpadding="0" width="#{hit.scoreAsString} %" > <h:outputText id="hitBaer" value=""> </h:outputText> </h:panelGrid> </rich:panel> </h:panelGrid> </h:column> </rich:dataTable>
Te jsp code for my modal panel , which is on the same page but a different form is as below :
<rich:modalPanel id="modalPanel"> <f:facet name="header">Tag Scenario</f:facet> <a4j:keepAlive beanName="searchResultsBean" /> <a4j:keepAlive beanName="scenarioRecordBean" /> <h:form> <h:panelGrid id="tagScenario" columns="2"> <h:outputText value="The Scenario is saved with a contextual id :" /> <h:outputText value="The Scenario is saved with a contextual id :" /> <h:outputText value="Name:" /> <h:inputText value="#{scenarioRecordBean.name}" /> <h:outputText value="Tag" /> <h:inputText value="#{scenarioRecordBean.email}" /> </h:panelGrid> <h:panelGrid> <a4j:commandLink value="Close" onclick="#{rich:component('modalPanel')}.hide()" /> </h:panelGrid> </h:form> </rich:modalPanel>
When I invoke the jsp from my application I get the following error :
Caused by: javax.faces.el.EvaluationException: com.sun.faces.el.impl.ElException: No function is mapped to the name "rich:component" at com.sun.faces.el.MixedELValueBinding.getValue(MixedELValueBinding.java:97) at org.ajax4jsf.ajax.html.HtmlAjaxCommandLink.getOnclick(HtmlAjaxCommandLink.java:1000) at sun.reflect.GeneratedMethodAccessor313.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:1397) ... 80 more Caused by: com.sun.faces.el.impl.ElException: No function is mapped to the name "rich:component" at com.sun.faces.el.impl.FunctionInvocation.evaluate(FunctionInvocation.java:157) at com.sun.faces.el.MixedELValueBinding.getValue(MixedELValueBinding.java:84)
Iam using richfaces 3.0 version in my jsf 1.1 Sun RI application. What is that Iam missing. please guide me through this issue. Thanks in advance