rich:modalPanel + f:attribute not loading values
meetoblivion Jun 8, 2009 9:25 PMI"ve got some markup defined like this
<rich:panel id="images">
<f:facet name="header">Images</f:facet>
<rich:dataGrid columns="2" elements="12" width="450px" value="#{imgSearch.searchResults}" var="image" style="width:360px;">
<rich:panel style=" width : 180px;">
<f:facet name="header"><h:outputText value="#{image.fileName}" /></f:facet>
<img src="/images/img/60/#{image.fileName}" />
<h:outputText value="#{image.fileName}" /><br />
<ui:repeat value="#{image.imageProperties}" var="imgProp">
<h:outputText value="#{imgProp.key}" /> : <h:outputText value="#{imgProp.value}" /><br />
</ui:repeat>
<a4j:commandLink actionListener="#{taskExecutor.addSwap}" value="Swap" reRender="pnl_tasks,pnl_results" action="#{taskExecutor.act}">
<f:attribute name="imageId" value="#{image.imageId}" /></a4j:commandLink> | <a4j:commandLink
actionListener="#{taskExecutor.delete}" value="Delete" reRender="pnl_tasks,pnl_results" action="#{taskExecutor.act}">
<f:attribute name="imageId" value="#{image.imageId}" /></a4j:commandLink> | <a4j:commandLink
actionListener="#{propertyEditor.populate}" value="Add Property" action="#{propertyEditor.blank}"
reRender="modal_pnl_propEditor" ajaxSingle="true"
oncomplete="Richfaces.showModalPanel('pnl_propEditor',{width:350,top:200})">
<f:attribute name="imageFileName" value="#{image.fileName}" />
</a4j:commandLink>
</rich:panel>
</rich:dataGrid>
<rich:modalPanel height="200" id="pnl_propEditor" moveable="true" width="150">
<f:facet name="header">Property Editor</f:facet>
<rich:panel id="modal_pnl_propEditor">
<h:panelGrid columns="2">
<h:outputText value="Image:"/>
<h:outputText value="#{propertyEditor.imageFileName}" />
<h:outputText value="Property:" />
<h:inputText value="#{propertyEditor.propertyName}" />
<h:outputText value="Value:" />
<h:inputText value="#{propertyEditor.propertyValue}" />
<a4j:commandButton action="#{propertyEditor.save}" oncomplete="Richfaces.hideModalPanel('pnl_propEditor');" value="Save"
reRender="pnl_tasks,pnl_results"/>
<a4j:commandButton action="#{propertyEditor.blank}" oncomplete="Richfaces.hideModalPanel('pnl_propEditor');" value="Cancel"/>
</h:panelGrid>
</rich:panel>
</rich:modalPanel>
</rich:panel>
My issue is that I need to get that #{image.fileName} into the modal panel. Based on what I did, I feel like it should work, given that my populate method pushes everything into the correct bean. However, my f:attribute is coming up null. I'm sure I could work w/ the imageId too, but it seems like this should be working.