Passing javascript paramters through a rich:modalPanel to a function
I have a rich:modalPanel that updates a rich:dataTable in another form.
When I hardcode the table id the dataTable is updated correctly after add:
<a4j:commandButton id="mdlAdd" value="ShouldUpdateParentView"
onclick="Richfaces.hideModalPanel('modal1')"
action="#{bean.doSomeServerSideStuff()}"
oncomplete="reRenderTble();" >
</a4j:commandButton>
The reRender happens here:
But I need to call this modalPanel from another modalPanel and have it
update THAT component. So I tried to make the component a parameter, I
tried several different things, but nothing seems to be working, if I do
this:
<a4j:commandLink value="Call a ModalPanel"
action="# {bean.doSomeServerSetup()}"
oncomplete="Richfaces.showModalPanel('modal1',{rerenderId:'compId'});" />
<rich:modalPanel id="modal1"
onshow="alert(document.getElementById('modal1').innerHTML=event.parameters.rerenderId)"
>
.....
<a4j:commandButton id="mdlAdd" value="ShouldUpdateParentView"
onclick="Richfaces.hideModalPanel('modal1')"
action="#{bean.doSomeServerSideStuff()}"
oncomplete="somebodyChangedMe(this);reRenderTble(document.getElementById('modal1').innerHTML=event.parameters.rerenderId);"
>
</a4j:commandButton>
</rich:modalPanel>
The alert window will show the passed value. But, I can't pass that value
to the jsFunction to select the component for rerendering:
<a4j:jsFunction name="reRenderTble" reRender="#{rerenderMe}" >
<a4j:actionparam name="rerenderMe" assignTo="#{rerenderMe}" />
</a4j:jsFunction>
When I look at the actual value of the contents of reRenderTble() in
mdlAdd with firebug, I see the literal string
document.getElementById('modal1').innerHTML=event.parameters.rerenderId
not the component value (compId).
I'm using RF3.3.3 JSF1.2
No comments:
Post a Comment