Although it is about a popup window, I think my
question is JSF specific.
I have successfully popped up a window. I am trying to
pass a value that is enterend in a popup window text
field and the popup window has a button for all text
fields.
The browser I use is the Netscape. I also use the
Mozilla.
I have seen an example code to pass a value from a
popup window back to the parent window. In that
example, the value to be passed back is set by
clicking on a <h:outputLink>. See below
code:
-----------------------------------------------------
<h:dataTable value="#{ListHolderBean.items}"
var="place">
<h:column>
<h:outputLink title="#{place}"
onmousedown="update(this.title);" value="#{place}"
on_click="return false">
<h:outputText value="#{place}" />
</h:outputLink>
</h:column>
</h:dataTable>
-----------------------------------------------------
and the JavaScript in that page is like:
code:
-----------------------------------------------------
<script type="text/javascript">
function update(place)
{
window.opener.updatePlace(place);
}
</script>
-----------------------------------------------------
My popup window is somewhat different. I have to
provide a text field for users to fill out a value.
And there is a button in the popup window to submit
the value. The <h:inputText> tag does not accept the
"var" attribute. How do I modify the code to do what I
am trying to achieve?
code:
-----------------------------------------------------
<h:inputText value="#{accessExternalFileBean.ip} ???
/>
<h:commandButton value="OK"
on_click="provideIpAddress( ?????? );" />
-----------------------------------------------------
and I think my JavaScript in the popup window should
be:
code:
-----------------------------------------------------
function provideIpAddress( ip )
{
window.opener.updateIpAddress( ip );
}
-----------------------------------------------------
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com