[
http://jira.jboss.com/jira/browse/RF-3033?page=comments#action_12408643 ]
Andreas Höhmann commented on RF-3033:
-------------------------------------
The extracted js-code is working fine ... perhaps there is a rerender-problem for the
"oncomplete-js"?
<script type="text/javascript">
function checkForDialog(value) {
if (value == -1) {
Richfaces.showModalPanel('orderQuantityDialog');
}
}
</script>
<!-- auswahl + dialog -->
<h:panelGroup rendered="#{quantity gt 1}">
<h:selectOneMenu id="quantity" value="#{bean.quantity}"
styleClass="addToBasketAmount"
onchange="checkForDialog(this.value)">
<c:forEach begin="1" end="3" var="i">
<f:selectItem itemValue="#{i * quantity}"/>
</c:forEach>
<f:selectItem itemValue="#{bean.userQuantity}"/>
<f:selectItem itemValue="-1" itemLabel="[enter]"/>
<a4j:support event="onchange" />
</h:selectOneMenu>
</h:panelGroup>
a4j:support - oncomplete handle js-code incorrect
-------------------------------------------------
Key: RF-3033
URL:
http://jira.jboss.com/jira/browse/RF-3033
Project: RichFaces
Issue Type: Bug
Affects Versions: 3.2.0
Environment: myfaces 1.2.2
jdk 1.5
tomcat 6.0.14
Reporter: Andreas Höhmann
I have a selectbox with 5 options: 1..4 numbers and -1 as a "special value" :)
If the user select the special value i want open a dialog ... here is my code:
<h:selectOneMenu id="quantity" value="#{bean.quantity}"
styleClass="addToBasketAmount">
<c:forEach begin="1" end="3" var="i">
<f:selectItem itemValue="#{i * quantity}"/>
</c:forEach>
<f:selectItem itemValue="#{bean.userQuantity}"/>
<f:selectItem itemValue="-1" itemLabel="[enter]" />
<a4j:support event="onchange"
oncomplete="if(this.value ==
-1){Richfaces.showModalPanel('orderQuantityDialog')}" />
</h:selectOneMenu>
The dialog will not open ... but ... if i change the code to this:
<h:selectOneMenu id="quantity" value="#{bean.quantity}"
styleClass="addToBasketAmount">
<c:forEach begin="1" end="3" var="i">
<f:selectItem itemValue="#{i * quantity}"/>
</c:forEach>
<f:selectItem itemValue="#{bean.userQuantity}"/>
<f:selectItem itemValue="-1" itemLabel="[enter]" />
<a4j:support event="onchange"
oncomplete="alert(this.value);if(this.value ==
-1){Richfaces.showModalPanel('orderQuantityDialog')}" />
</h:selectOneMenu>
a alertbox is shown (-1) and then the dialog is shown.
is this a bug?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira