[JBoss JIRA] (RF-13098) Regression: mediaOutput broken for CDI MediaData beans
by Brian Leathem (JIRA)
[ https://issues.jboss.org/browse/RF-13098?page=com.atlassian.jira.plugin.s... ]
Brian Leathem updated RF-13098:
-------------------------------
Labels: regression (was: regression waiting_on_user)
> Regression: mediaOutput broken for CDI MediaData beans
> ------------------------------------------------------
>
> Key: RF-13098
> URL: https://issues.jboss.org/browse/RF-13098
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component-a4j-core
> Affects Versions: 4.3.3
> Reporter: Marek Schmidt
> Assignee: Pavol Pitonak
> Labels: regression
>
> https://issues.jboss.org/browse/RF-13089 introduced a regression for a4j:mediaOutput component
> Having a
> {code}
> <a4j:mediaOutput element="img" cacheable="true" session="true" createContent="#{mediaBean.paint}" value="#{mediaData}" mimeType="image/jpeg"/>
> {code}
> with mediaData being a CDI bean, e.g.
> {code}
> @javax.inject.Named("mediaData")
> @javax.enterprise.context.RequestScoped
> public class MediaData implements Serializable
> {code}
> the following exception occurs:
> {code}10:39:27,997 SEVERE [org.richfaces.log.Resource] (http-/127.0.0.1:8080-1) Input error for deserialize data : java.io.InvalidClassException: Unauthorized deserialization attempt; org.jboss.weld.bean.proxy.util.SerializableClientProxy
> at org.richfaces.util.LookAheadObjectInputStream.resolveClass(LookAheadObjectInputStream.java:93) [richfaces-core-impl-4.3.3.Final.jar:4.3.3.Final]
> at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1610) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1704) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) [rt.jar:1.7.0_25]
> at org.richfaces.util.Util.decodeObjectData(Util.java:237) [richfaces-core-impl-4.3.3.Final.jar:4.3.3.Final]
> at org.richfaces.resource.DefaultCodecResourceRequestData.getData(DefaultCodecResourceRequestData.java:97) [richfaces-core-impl-4.3.3.Final.jar:4.3.3.Final]
> at org.richfaces.resource.ResourceFactoryImpl.createResource(ResourceFactoryImpl.java:337) [richfaces-core-impl-4.3.3.Final.jar:4.3.3.Final]
> at org.richfaces.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:156) [richfaces-core-impl-4.3.3.Final.jar:4.3.3.Final]
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:591) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (RF-13098) Regression: mediaOutput broken for CDI MediaData beans
by Brian Leathem (JIRA)
[ https://issues.jboss.org/browse/RF-13098?page=com.atlassian.jira.plugin.s... ]
Brian Leathem reassigned RF-13098:
----------------------------------
Assignee: Pavol Pitonak
QE, please verify this issue.
> Regression: mediaOutput broken for CDI MediaData beans
> ------------------------------------------------------
>
> Key: RF-13098
> URL: https://issues.jboss.org/browse/RF-13098
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component-a4j-core
> Affects Versions: 4.3.3
> Reporter: Marek Schmidt
> Assignee: Pavol Pitonak
> Labels: regression, waiting_on_user
>
> https://issues.jboss.org/browse/RF-13089 introduced a regression for a4j:mediaOutput component
> Having a
> {code}
> <a4j:mediaOutput element="img" cacheable="true" session="true" createContent="#{mediaBean.paint}" value="#{mediaData}" mimeType="image/jpeg"/>
> {code}
> with mediaData being a CDI bean, e.g.
> {code}
> @javax.inject.Named("mediaData")
> @javax.enterprise.context.RequestScoped
> public class MediaData implements Serializable
> {code}
> the following exception occurs:
> {code}10:39:27,997 SEVERE [org.richfaces.log.Resource] (http-/127.0.0.1:8080-1) Input error for deserialize data : java.io.InvalidClassException: Unauthorized deserialization attempt; org.jboss.weld.bean.proxy.util.SerializableClientProxy
> at org.richfaces.util.LookAheadObjectInputStream.resolveClass(LookAheadObjectInputStream.java:93) [richfaces-core-impl-4.3.3.Final.jar:4.3.3.Final]
> at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1610) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1704) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342) [rt.jar:1.7.0_25]
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) [rt.jar:1.7.0_25]
> at org.richfaces.util.Util.decodeObjectData(Util.java:237) [richfaces-core-impl-4.3.3.Final.jar:4.3.3.Final]
> at org.richfaces.resource.DefaultCodecResourceRequestData.getData(DefaultCodecResourceRequestData.java:97) [richfaces-core-impl-4.3.3.Final.jar:4.3.3.Final]
> at org.richfaces.resource.ResourceFactoryImpl.createResource(ResourceFactoryImpl.java:337) [richfaces-core-impl-4.3.3.Final.jar:4.3.3.Final]
> at org.richfaces.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:156) [richfaces-core-impl-4.3.3.Final.jar:4.3.3.Final]
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:591) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
> at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (RF-13115) a4j:jsFunction is not firing ajax request when the generated js function is called at window.unload event
by Vaibhav Kapoor (JIRA)
[ https://issues.jboss.org/browse/RF-13115?page=com.atlassian.jira.plugin.s... ]
Vaibhav Kapoor commented on RF-13115:
-------------------------------------
Thanks Brian for the quick response.
It will be great if i can call my backing bean over a rest call. Please point me to the related documentation.
> a4j:jsFunction is not firing ajax request when the generated js function is called at window.unload event
> ---------------------------------------------------------------------------------------------------------
>
> Key: RF-13115
> URL: https://issues.jboss.org/browse/RF-13115
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 4.3.1
> Environment: tomcat 6, windows 7 , IE 10 / chrome 28.0.1500.95
> Reporter: Vaibhav Kapoor
>
> Requirement : I need to call a method on backing bean on event of page unload. Approach : So i have created a a4j:jsFunction and am trying to call it on window.unload event.
> Issue Description : When the page refreshes, js function attached to window.unload event is called and executes correctly. All statements in console.log() are called correctly. But, the method in the backing bean is never called.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (RF-13108) rich:calendar nested a4j:ajax event not firing
by nathan dennis (JIRA)
[ https://issues.jboss.org/browse/RF-13108?page=com.atlassian.jira.plugin.s... ]
nathan dennis commented on RF-13108:
------------------------------------
updated.. i was having trouble figuring out what was actually wrong with this one too. at one point the event wasnt firing.. then it was firing.. end result of all this digging around was the value just doesnt make it back to the bean eventhough it is contained in the ajax request. left me scratching my head. works with f ajax though.
> rich:calendar nested a4j:ajax event not firing
> ----------------------------------------------
>
> Key: RF-13108
> URL: https://issues.jboss.org/browse/RF-13108
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component-a4j-core, component-validators
> Affects Versions: 4.3.2
> Environment: jboss 7.1.3 richfaces 4.3.2.final, chrome
> Reporter: nathan dennis
> Labels: a4j:ajax, rich:calendar, rich:message, waiting_on_user
>
> nested a4j:ajax change event isn't functioning as expected. On "change" event, the expect result is that the value is moved into the target Date field of the backing bean. When using a4j:ajax, this does not happen.
> After speaking with ppitonak he believe that the order of the ajax with relation to the validators was import. however after closer inspection, the value wasn't making back to the bean even when the event was fired even with the order reversed.
> Logically the first date should be submitted to the backing bean on change even and made available for validation in the second dates validator. works with f:ajax.. doesnt work with a4j:ajax.
> {code}
> Request URL:http://oasis.monarchnc.org:10001/oasis/screening/edit.xhtml?cid=2
> Request Method:POST
> Status Code:200 OK
> Request Headersview source
> Accept:*/*
> Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
> Accept-Encoding:gzip,deflate,sdch
> Accept-Language:en-US,en;q=0.8
> Connection:keep-alive
> Content-Length:870
> Content-type:application/x-www-form-urlencoded;charset=UTF-8
> Cookie:JSESSIONID="gOuCLop-DL7U6D3fbNhptHmw.slave:server-three"; csfcfc=11Xfn_12Xfn; __utma=69432588.533798156.1374674467.1374674467.1374674467.1; __utmz=69432588.1374674467.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); org.monarchnc.commandcenter.location=1; org.monarchnc.commandcenter.security=NDNlZGQ3ZDU3NjIxYzI4YjM4YzZlOTM0YzQ3ZjAxYWQ_
> Faces-Request:partial/ajax
> Host:oasis.monarchnc.org:10001
> Origin:http://oasis.monarchnc.org:10001
> Referer:http://oasis.monarchnc.org:10001/oasis/screening/edit.xhtml?cid=2&id=143&dsRid=197&windowId=-9720
> User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22
> Query String Parametersview sourceview URL encoded
> cid:2
> Form Dataview sourceview URL encoded
> create:create
> create:medrecordnumber:
> create:patientName:Ritchard Trickle
> create:patientPhone:
> create:patientEmail:
> create:startTimeOverrideInputDate:30/7/13 04:24 PM
> create:startTimeOverrideInputCurrentDate:07/2013
> create:endTimeOverrideInputDate:01/8/13 05:58 PM
> create:endTimeOverrideInputCurrentDate:08/2013
> create:screeningBeanScreeningProviderValue:
> create:screeningBeanScreeningProviderInput:dennis, nathan
> javax.faces.ViewState:-4869776129569305131:8783263118910249789
> javax.faces.source:create:startTimeOverride
> javax.faces.partial.event:change
> javax.faces.partial.execute:create:startTimeOverride @component
> javax.faces.partial.render:@component
> javax.faces.behavior.event:change
> org.richfaces.ajax.component:create:startTimeOverride
> rfExt:null
> AJAX:EVENTS_COUNT:1
> javax.faces.partial.ajax:true
> Response Headersview source
> Cache-Control:no-cache
> Connection:close
> Content-Type:text/xml;charset=UTF-8
> Date:Thu, 01 Aug 2013 15:59:07 GMT
> Server:Apache-Coyote/1.1
> Transfer-Encoding:chunked
> X-Powered-By:JSF/2.0
> {code}
> {code:xml}
> <?xml version='1.0' encoding='UTF-8' ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <ui:composition xmlns="http://www.w3.org/1999/xhtml"
> xmlns:h="http://java.sun.com/jsf/html"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:ui="http://java.sun.com/jsf/facelets"
> xmlns:c="http://java.sun.com/jsp/jstl/core"
> xmlns:a4j="http://richfaces.org/a4j"
> xmlns:rich="http://richfaces.org/rich"
> template="/resources/scaffold/pageTemplate.xhtml">
> <f:metadata>
> <f:viewParam name="id" value="#{screeningBean.id}"/>
> </f:metadata>
> <ui:define name="main">
> <h:form id="create">
>
> <h:panelGrid columnClasses="label,component,required" columns="3">
> <h:outputLabel for="startTimeOverride" value="Start Time Override:"/>
> <rich:calendar value="#{screeningBean.screening.beginTime}" id="startTimeOverride"
> popup="true" datePattern="dd/M/yy hh:mm a" required="true"
> showApplyButton="true" >
> <f:validateRequired />
> <a4j:ajax event="change" bypassUpdates="#{true}"/>
> </rich:calendar>
> <rich:message for="startTimeOverride" ajaxRendered="true" />
> <h:outputLabel for="endTimeOverride" value="End Time Override:" />
> <rich:calendar value="#{screeningBean.screening.endTime}" id="endTimeOverride"
> popup="true" datePattern="dd/M/yy hh:mm a"
> showApplyButton="true" >
> <f:validateRequired />
> <f:validator validatorId="dateRangeValidator" />
> <rich:validator />
> <a4j:ajax event="change" bypassUpdates="#{true}"/>
> </rich:calendar>
> <rich:message for="endTimeOverride" ajaxRendered="true" />
> </h:panelGrid>
> <div class="buttons">
> <a4j:commandButton value="Complete"
> action="#{screeningBean.updateScreening(2)}"
> execute="@form"
> onclick="this.disabled=true; var that = this; setTimeout(function() that.disabled=false;},500);"
> styleClass="btn btn-primary btn-primary-a4j" />
> </div>
> </h:form>
> </ui:define>
> </ui:composition>
> {code}
> {code:title=DateRangeValidator.java}
> /**************************************************************
> * Copyright (c) 2012 - 2013, Monarch, All rights reserved.
> *
> * @author Nathan Dennis
> *
> */
> package org.monarchnc.view.validators;
> import java.text.DateFormat;
> import java.text.SimpleDateFormat;
> import java.util.Date;
> import javax.faces.application.FacesMessage;
> import javax.faces.component.UIComponent;
> import javax.faces.component.UIInput;
> import javax.faces.context.FacesContext;
> import javax.faces.validator.FacesValidator;
> import javax.faces.validator.Validator;
> import javax.faces.validator.ValidatorException;
> import javax.persistence.EntityManager;
> import org.apache.deltaspike.core.api.provider.BeanProvider;
> import org.monarchnc.view.ScreeningBean;
> // TODO: Auto-generated Javadoc
> /**
> * The Class DateRangeValidator.
> */
> @FacesValidator("dateRangeValidator")
> public class DateRangeValidator implements Validator {
>
>
> /* (non-Javadoc)
> * @see javax.faces.validator.Validator#validate(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)f
> */
> public void validate(final FacesContext ctx, final UIComponent component, final Object value) throws ValidatorException {
>
> ScreeningBean screeningBean = BeanProvider.getContextualReference(screeningBean.class, false);
>
> Date date =(Date) value;
> if(screeningBean.getScreening().getBeginTime() != null && date != null)
> if(!date.after(screeningBean.getScreening().getBeginTime())){
> throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,"End Date must be after Start Date!!.\n","End Date must be after Start Date!!\n"));
>
> }
>
>
> }
> }
> {code}
> {code:title=ScreeningBean.java}
> @Named
> @Transactional
> @ConversationScoped
> public class ScreeningBean implements Serializable{
> Screening screening = new Screening();
> public Class<? extends ViewConfig> claim(){
> if (this.conversation.isTransient())
> {
> this.conversation.begin();
> }...
> }
> public Screening getScreening() {
> return screening;
> }
> public void setScreening(Screening screening) {
> this.screening = screening;
> }
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (RF-13108) rich:calendar nested a4j:ajax event not firing
by nathan dennis (JIRA)
[ https://issues.jboss.org/browse/RF-13108?page=com.atlassian.jira.plugin.s... ]
nathan dennis updated RF-13108:
-------------------------------
Description:
nested a4j:ajax change event isn't functioning as expected. On "change" event, the expect result is that the value is moved into the target Date field of the backing bean. When using a4j:ajax, this does not happen.
After speaking with ppitonak he believe that the order of the ajax with relation to the validators was import. however after closer inspection, the value wasn't making back to the bean even when the event was fired even with the order reversed.
Logically the first date should be submitted to the backing bean on change even and made available for validation in the second dates validator. works with f:ajax.. doesnt work with a4j:ajax.
{code}
Request URL:http://oasis.monarchnc.org:10001/oasis/screening/edit.xhtml?cid=2
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:870
Content-type:application/x-www-form-urlencoded;charset=UTF-8
Cookie:JSESSIONID="gOuCLop-DL7U6D3fbNhptHmw.slave:server-three"; csfcfc=11Xfn_12Xfn; __utma=69432588.533798156.1374674467.1374674467.1374674467.1; __utmz=69432588.1374674467.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); org.monarchnc.commandcenter.location=1; org.monarchnc.commandcenter.security=NDNlZGQ3ZDU3NjIxYzI4YjM4YzZlOTM0YzQ3ZjAxYWQ_
Faces-Request:partial/ajax
Host:oasis.monarchnc.org:10001
Origin:http://oasis.monarchnc.org:10001
Referer:http://oasis.monarchnc.org:10001/oasis/screening/edit.xhtml?cid=2&id=143&dsRid=197&windowId=-9720
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22
Query String Parametersview sourceview URL encoded
cid:2
Form Dataview sourceview URL encoded
create:create
create:medrecordnumber:
create:patientName:Ritchard Trickle
create:patientPhone:
create:patientEmail:
create:startTimeOverrideInputDate:30/7/13 04:24 PM
create:startTimeOverrideInputCurrentDate:07/2013
create:endTimeOverrideInputDate:01/8/13 05:58 PM
create:endTimeOverrideInputCurrentDate:08/2013
create:screeningBeanScreeningProviderValue:
create:screeningBeanScreeningProviderInput:dennis, nathan
javax.faces.ViewState:-4869776129569305131:8783263118910249789
javax.faces.source:create:startTimeOverride
javax.faces.partial.event:change
javax.faces.partial.execute:create:startTimeOverride @component
javax.faces.partial.render:@component
javax.faces.behavior.event:change
org.richfaces.ajax.component:create:startTimeOverride
rfExt:null
AJAX:EVENTS_COUNT:1
javax.faces.partial.ajax:true
Response Headersview source
Cache-Control:no-cache
Connection:close
Content-Type:text/xml;charset=UTF-8
Date:Thu, 01 Aug 2013 15:59:07 GMT
Server:Apache-Coyote/1.1
Transfer-Encoding:chunked
X-Powered-By:JSF/2.0
{code}
{code:xml}
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
template="/resources/scaffold/pageTemplate.xhtml">
<f:metadata>
<f:viewParam name="id" value="#{screeningBean.id}"/>
</f:metadata>
<ui:define name="main">
<h:form id="create">
<h:panelGrid columnClasses="label,component,required" columns="3">
<h:outputLabel for="startTimeOverride" value="Start Time Override:"/>
<rich:calendar value="#{screeningBean.screening.beginTime}" id="startTimeOverride"
popup="true" datePattern="dd/M/yy hh:mm a" required="true"
showApplyButton="true" >
<f:validateRequired />
<a4j:ajax event="change" bypassUpdates="#{true}"/>
</rich:calendar>
<rich:message for="startTimeOverride" ajaxRendered="true" />
<h:outputLabel for="endTimeOverride" value="End Time Override:" />
<rich:calendar value="#{screeningBean.screening.endTime}" id="endTimeOverride"
popup="true" datePattern="dd/M/yy hh:mm a"
showApplyButton="true" >
<f:validateRequired />
<f:validator validatorId="dateRangeValidator" />
<rich:validator />
<a4j:ajax event="change" bypassUpdates="#{true}"/>
</rich:calendar>
<rich:message for="endTimeOverride" ajaxRendered="true" />
</h:panelGrid>
<div class="buttons">
<a4j:commandButton value="Complete"
action="#{screeningBean.updateScreening(2)}"
execute="@form"
onclick="this.disabled=true; var that = this; setTimeout(function() that.disabled=false;},500);"
styleClass="btn btn-primary btn-primary-a4j" />
</div>
</h:form>
</ui:define>
</ui:composition>
{code}
{code:title=DateRangeValidator.java}
/**************************************************************
* Copyright (c) 2012 - 2013, Monarch, All rights reserved.
*
* @author Nathan Dennis
*
*/
package org.monarchnc.view.validators;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.validator.FacesValidator;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import javax.persistence.EntityManager;
import org.apache.deltaspike.core.api.provider.BeanProvider;
import org.monarchnc.view.ScreeningBean;
// TODO: Auto-generated Javadoc
/**
* The Class DateRangeValidator.
*/
@FacesValidator("dateRangeValidator")
public class DateRangeValidator implements Validator {
/* (non-Javadoc)
* @see javax.faces.validator.Validator#validate(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)f
*/
public void validate(final FacesContext ctx, final UIComponent component, final Object value) throws ValidatorException {
ScreeningBean screeningBean = BeanProvider.getContextualReference(screeningBean.class, false);
Date date =(Date) value;
if(screeningBean.getScreening().getBeginTime() != null && date != null)
if(!date.after(screeningBean.getScreening().getBeginTime())){
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,"End Date must be after Start Date!!.\n","End Date must be after Start Date!!\n"));
}
}
}
{code}
{code:title=ScreeningBean.java}
@Named
@Transactional
@ConversationScoped
public class ScreeningBean implements Serializable{
Screening screening = new Screening();
public Class<? extends ViewConfig> claim(){
if (this.conversation.isTransient())
{
this.conversation.begin();
}...
}
public Screening getScreening() {
return screening;
}
public void setScreening(Screening screening) {
this.screening = screening;
}
}
{code}
was:
nested a4j:ajax change event isn't functioning as expected.
ajax event isn't always fired. after speaking with ppitonak it seemed as if the order of the ajax with relation to the validators was import. however after closer inspection (and may be a different problem), the value wasnt making back to the bean even when the event was fired.
{code:xml}
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
template="/resources/scaffold/pageTemplate.xhtml">
<f:metadata>
<f:viewParam name="id" value="#{screeningBean.id}"/>
</f:metadata>
<ui:define name="main">
<h:form id="create">
<h:panelGrid columnClasses="label,component,required" columns="3">
<h:outputLabel for="startTimeOverride" value="Start Time Override:"/>
<rich:calendar value="#{screeningBean.screening.beginTime}" id="startTimeOverride"
popup="true" datePattern="dd/M/yy hh:mm a" required="true"
showApplyButton="true" >
<f:validateRequired />
<a4j:ajax event="change" bypassUpdates="#{true}"/>
</rich:calendar>
<rich:message for="startTimeOverride" ajaxRendered="true" />
<h:outputLabel for="endTimeOverride" value="End Time Override:" />
<rich:calendar value="#{screeningBean.screening.endTime}" id="endTimeOverride"
popup="true" datePattern="dd/M/yy hh:mm a"
showApplyButton="true" >
<f:validateRequired />
<f:validator validatorId="dateRangeValidator" />
<rich:validator />
<a4j:ajax event="change" bypassUpdates="#{true}"/>
</rich:calendar>
<rich:message for="endTimeOverride" ajaxRendered="true" />
</h:panelGrid>
<div class="buttons">
<a4j:commandButton value="Complete"
action="#{screeningBean.updateScreening(2)}"
execute="@form"
onclick="this.disabled=true; var that = this; setTimeout(function() that.disabled=false;},500);"
styleClass="btn btn-primary btn-primary-a4j" />
</div>
</h:form>
</ui:define>
</ui:composition>
{code}
{code:title=DateRangeValidator.java}
/**************************************************************
* Copyright (c) 2012 - 2013, Monarch, All rights reserved.
*
* @author Nathan Dennis
*
*/
package org.monarchnc.view.validators;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.validator.FacesValidator;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import javax.persistence.EntityManager;
import org.apache.deltaspike.core.api.provider.BeanProvider;
import org.monarchnc.view.ScreeningBean;
// TODO: Auto-generated Javadoc
/**
* The Class DateRangeValidator.
*/
@FacesValidator("dateRangeValidator")
public class DateRangeValidator implements Validator {
/* (non-Javadoc)
* @see javax.faces.validator.Validator#validate(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)f
*/
public void validate(final FacesContext ctx, final UIComponent component, final Object value) throws ValidatorException {
ScreeningBean screeningBean = BeanProvider.getContextualReference(screeningBean.class, false);
Date date =(Date) value;
if(screeningBean.getScreening().getBeginTime() != null && date != null)
if(!date.after(screeningBean.getScreening().getBeginTime())){
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,"End Date must be after Start Date!!.\n","End Date must be after Start Date!!\n"));
}
}
}
{code}
{code:title=ScreeningBean.java}
@Named
@Transactional
@ConversationScoped
public class ScreeningBean implements Serializable{
Screening screening = new Screening();
public Class<? extends ViewConfig> claim(){
if (this.conversation.isTransient())
{
this.conversation.begin();
}...
}
public Screening getScreening() {
return screening;
}
public void setScreening(Screening screening) {
this.screening = screening;
}
}
{code}
> rich:calendar nested a4j:ajax event not firing
> ----------------------------------------------
>
> Key: RF-13108
> URL: https://issues.jboss.org/browse/RF-13108
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component-a4j-core, component-validators
> Affects Versions: 4.3.2
> Environment: jboss 7.1.3 richfaces 4.3.2.final, chrome
> Reporter: nathan dennis
> Labels: a4j:ajax, rich:calendar, rich:message, waiting_on_user
>
> nested a4j:ajax change event isn't functioning as expected. On "change" event, the expect result is that the value is moved into the target Date field of the backing bean. When using a4j:ajax, this does not happen.
> After speaking with ppitonak he believe that the order of the ajax with relation to the validators was import. however after closer inspection, the value wasn't making back to the bean even when the event was fired even with the order reversed.
> Logically the first date should be submitted to the backing bean on change even and made available for validation in the second dates validator. works with f:ajax.. doesnt work with a4j:ajax.
> {code}
> Request URL:http://oasis.monarchnc.org:10001/oasis/screening/edit.xhtml?cid=2
> Request Method:POST
> Status Code:200 OK
> Request Headersview source
> Accept:*/*
> Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
> Accept-Encoding:gzip,deflate,sdch
> Accept-Language:en-US,en;q=0.8
> Connection:keep-alive
> Content-Length:870
> Content-type:application/x-www-form-urlencoded;charset=UTF-8
> Cookie:JSESSIONID="gOuCLop-DL7U6D3fbNhptHmw.slave:server-three"; csfcfc=11Xfn_12Xfn; __utma=69432588.533798156.1374674467.1374674467.1374674467.1; __utmz=69432588.1374674467.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); org.monarchnc.commandcenter.location=1; org.monarchnc.commandcenter.security=NDNlZGQ3ZDU3NjIxYzI4YjM4YzZlOTM0YzQ3ZjAxYWQ_
> Faces-Request:partial/ajax
> Host:oasis.monarchnc.org:10001
> Origin:http://oasis.monarchnc.org:10001
> Referer:http://oasis.monarchnc.org:10001/oasis/screening/edit.xhtml?cid=2&id=143&dsRid=197&windowId=-9720
> User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22
> Query String Parametersview sourceview URL encoded
> cid:2
> Form Dataview sourceview URL encoded
> create:create
> create:medrecordnumber:
> create:patientName:Ritchard Trickle
> create:patientPhone:
> create:patientEmail:
> create:startTimeOverrideInputDate:30/7/13 04:24 PM
> create:startTimeOverrideInputCurrentDate:07/2013
> create:endTimeOverrideInputDate:01/8/13 05:58 PM
> create:endTimeOverrideInputCurrentDate:08/2013
> create:screeningBeanScreeningProviderValue:
> create:screeningBeanScreeningProviderInput:dennis, nathan
> javax.faces.ViewState:-4869776129569305131:8783263118910249789
> javax.faces.source:create:startTimeOverride
> javax.faces.partial.event:change
> javax.faces.partial.execute:create:startTimeOverride @component
> javax.faces.partial.render:@component
> javax.faces.behavior.event:change
> org.richfaces.ajax.component:create:startTimeOverride
> rfExt:null
> AJAX:EVENTS_COUNT:1
> javax.faces.partial.ajax:true
> Response Headersview source
> Cache-Control:no-cache
> Connection:close
> Content-Type:text/xml;charset=UTF-8
> Date:Thu, 01 Aug 2013 15:59:07 GMT
> Server:Apache-Coyote/1.1
> Transfer-Encoding:chunked
> X-Powered-By:JSF/2.0
> {code}
> {code:xml}
> <?xml version='1.0' encoding='UTF-8' ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <ui:composition xmlns="http://www.w3.org/1999/xhtml"
> xmlns:h="http://java.sun.com/jsf/html"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:ui="http://java.sun.com/jsf/facelets"
> xmlns:c="http://java.sun.com/jsp/jstl/core"
> xmlns:a4j="http://richfaces.org/a4j"
> xmlns:rich="http://richfaces.org/rich"
> template="/resources/scaffold/pageTemplate.xhtml">
> <f:metadata>
> <f:viewParam name="id" value="#{screeningBean.id}"/>
> </f:metadata>
> <ui:define name="main">
> <h:form id="create">
>
> <h:panelGrid columnClasses="label,component,required" columns="3">
> <h:outputLabel for="startTimeOverride" value="Start Time Override:"/>
> <rich:calendar value="#{screeningBean.screening.beginTime}" id="startTimeOverride"
> popup="true" datePattern="dd/M/yy hh:mm a" required="true"
> showApplyButton="true" >
> <f:validateRequired />
> <a4j:ajax event="change" bypassUpdates="#{true}"/>
> </rich:calendar>
> <rich:message for="startTimeOverride" ajaxRendered="true" />
> <h:outputLabel for="endTimeOverride" value="End Time Override:" />
> <rich:calendar value="#{screeningBean.screening.endTime}" id="endTimeOverride"
> popup="true" datePattern="dd/M/yy hh:mm a"
> showApplyButton="true" >
> <f:validateRequired />
> <f:validator validatorId="dateRangeValidator" />
> <rich:validator />
> <a4j:ajax event="change" bypassUpdates="#{true}"/>
> </rich:calendar>
> <rich:message for="endTimeOverride" ajaxRendered="true" />
> </h:panelGrid>
> <div class="buttons">
> <a4j:commandButton value="Complete"
> action="#{screeningBean.updateScreening(2)}"
> execute="@form"
> onclick="this.disabled=true; var that = this; setTimeout(function() that.disabled=false;},500);"
> styleClass="btn btn-primary btn-primary-a4j" />
> </div>
> </h:form>
> </ui:define>
> </ui:composition>
> {code}
> {code:title=DateRangeValidator.java}
> /**************************************************************
> * Copyright (c) 2012 - 2013, Monarch, All rights reserved.
> *
> * @author Nathan Dennis
> *
> */
> package org.monarchnc.view.validators;
> import java.text.DateFormat;
> import java.text.SimpleDateFormat;
> import java.util.Date;
> import javax.faces.application.FacesMessage;
> import javax.faces.component.UIComponent;
> import javax.faces.component.UIInput;
> import javax.faces.context.FacesContext;
> import javax.faces.validator.FacesValidator;
> import javax.faces.validator.Validator;
> import javax.faces.validator.ValidatorException;
> import javax.persistence.EntityManager;
> import org.apache.deltaspike.core.api.provider.BeanProvider;
> import org.monarchnc.view.ScreeningBean;
> // TODO: Auto-generated Javadoc
> /**
> * The Class DateRangeValidator.
> */
> @FacesValidator("dateRangeValidator")
> public class DateRangeValidator implements Validator {
>
>
> /* (non-Javadoc)
> * @see javax.faces.validator.Validator#validate(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)f
> */
> public void validate(final FacesContext ctx, final UIComponent component, final Object value) throws ValidatorException {
>
> ScreeningBean screeningBean = BeanProvider.getContextualReference(screeningBean.class, false);
>
> Date date =(Date) value;
> if(screeningBean.getScreening().getBeginTime() != null && date != null)
> if(!date.after(screeningBean.getScreening().getBeginTime())){
> throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,"End Date must be after Start Date!!.\n","End Date must be after Start Date!!\n"));
>
> }
>
>
> }
> }
> {code}
> {code:title=ScreeningBean.java}
> @Named
> @Transactional
> @ConversationScoped
> public class ScreeningBean implements Serializable{
> Screening screening = new Screening();
> public Class<? extends ViewConfig> claim(){
> if (this.conversation.isTransient())
> {
> this.conversation.begin();
> }...
> }
> public Screening getScreening() {
> return screening;
> }
> public void setScreening(Screening screening) {
> this.screening = screening;
> }
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (RF-13115) a4j:jsFunction is not firing ajax request when the generated js function is called at window.unload event
by Brian Leathem (JIRA)
[ https://issues.jboss.org/browse/RF-13115?page=com.atlassian.jira.plugin.s... ]
Brian Leathem commented on RF-13115:
------------------------------------
window.unload is pretty late in the browser life-cycle to try and invoke a form submission (the JSF mechanism for executing AJAX calls). Have you considered exposing your backing bean as a restful web service, and invoking it that way?
> a4j:jsFunction is not firing ajax request when the generated js function is called at window.unload event
> ---------------------------------------------------------------------------------------------------------
>
> Key: RF-13115
> URL: https://issues.jboss.org/browse/RF-13115
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 4.3.1
> Environment: tomcat 6, windows 7 , IE 10 / chrome 28.0.1500.95
> Reporter: Vaibhav Kapoor
>
> Requirement : I need to call a method on backing bean on event of page unload. Approach : So i have created a a4j:jsFunction and am trying to call it on window.unload event.
> Issue Description : When the page refreshes, js function attached to window.unload event is called and executes correctly. All statements in console.log() are called correctly. But, the method in the backing bean is never called.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (RF-13115) a4j:jsFunction is not firing ajax request when the generated js function is called at window.unload event
by Vaibhav Kapoor (JIRA)
Vaibhav Kapoor created RF-13115:
-----------------------------------
Summary: a4j:jsFunction is not firing ajax request when the generated js function is called at window.unload event
Key: RF-13115
URL: https://issues.jboss.org/browse/RF-13115
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.3.1
Environment: tomcat 6, windows 7 , IE 10 / chrome 28.0.1500.95
Reporter: Vaibhav Kapoor
Requirement : I need to call a method on backing bean on event of page unload. Approach : So i have created a a4j:jsFunction and am trying to call it on window.unload event.
Issue Description : When the page refreshes, js function attached to window.unload event is called and executes correctly. All statements in console.log() are called correctly. But, the method in the backing bean is never called.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months