[richfaces-issues] [JBoss JIRA] Resolved: (RF-1289) Getting A4J Undefined though My renderer is properly adding support as child to the component.

Nick Belaevski (JIRA) jira-events at lists.jboss.org
Sun Nov 11 20:09:44 EST 2007


     [ http://jira.jboss.com/jira/browse/RF-1289?page=all ]

Nick Belaevski resolved RF-1289.
--------------------------------

    Resolution: Cannot Reproduce Bug

That works fine for me:

	public static final class UIEventsOutput extends UIOutput {
		final class Event extends FacesEvent {

			/**
			 * 
			 */
			private static final long serialVersionUID = -1390611902280951049L;

			private Object value;

			private String clientId;
			
			public Event(UIComponent component, Object value, String clientId, PhaseId phaseId) {
				super(component);
				
				this.value = value;
				this.clientId = clientId;
				
				setPhaseId(phaseId);
			}
			
			public boolean isAppropriateListener(FacesListener listener) {
				return false;
			}

			public void processListener(FacesListener listener) {
				throw new UnsupportedOperationException();
			}
			
			public Object getValue() {
				return value;
			}
			
			public String getClientId() {
				return clientId;
			}
		}

		private UIOrderingList getList() {
			UIComponent component = getParent();
			while (component != null && !(component instanceof UIOrderingList)) {
				component = component.getParent();
			}
			
			return (UIOrderingList) component;
		}

		private void queueEvent(PhaseId phaseId) {
			new Event(this, getList().getRowData(), 
					getList().getClientId(FacesContext.getCurrentInstance()), phaseId).queue();
		}

		public void processDecodes(FacesContext context) {
			super.processDecodes(context);

			queueEvent(PhaseId.PROCESS_VALIDATIONS);
			queueEvent(PhaseId.UPDATE_MODEL_VALUES);
			queueEvent(PhaseId.INVOKE_APPLICATION);
		}

		public void processUpdates(FacesContext context) {
			super.processUpdates(context);

			queueEvent(PhaseId.INVOKE_APPLICATION);
		}

		public void processValidators(FacesContext context) {
			super.processValidators(context);
			
			queueEvent(PhaseId.UPDATE_MODEL_VALUES);
			queueEvent(PhaseId.INVOKE_APPLICATION);
		}

		public void broadcast(FacesEvent event)
				throws AbortProcessingException {
			if (event instanceof Event) {
				String cid = getList().getClientId(FacesContext.getCurrentInstance());
				if (!cid.equals(((Event) event).getClientId())) {
					System.out.println(cid + " !!! " + ((Event) event).getClientId());
				}

				Object rd = getList().getRowData();
				if (!rd.equals(((Event) event).getValue())) {
					System.out.println(rd + " !!! " + ((Event) event).getValue());
				}
			} else {
				super.broadcast(event);
			}
		}
		
		@Override
		public void encodeEnd(FacesContext context) throws IOException {
			if (getChildCount() == 0) {
				UIAjaxSupport support = (org.ajax4jsf.component.UIAjaxSupport) context
				.getApplication().createComponent(
						UIAjaxSupport.COMPONENT_TYPE);
			
				support.setEvent("click");
				
				getChildren().add(support);
			}
			
			super.encodeEnd(context);
		}
	}

Tried on 3.2.0. Please try upgrading.

If that doesn't help, please reopen the issue and attach web.xml


> Getting A4J Undefined though My renderer is properly adding support as child to the component.
> ----------------------------------------------------------------------------------------------
>
>                 Key: RF-1289
>                 URL: http://jira.jboss.com/jira/browse/RF-1289
>             Project: RichFaces
>          Issue Type: Bug
>    Affects Versions: 3.2.0
>         Environment: Windows , Tomcat , Java 1.5, ajax4jsf1.1.0 , oscacche2.3.2
>            Reporter: Karthik M
>         Assigned To: Nick Belaevski
>             Fix For: 3.2.0
>
>         Attachments: ajax4jsf Help.zip
>
>   Original Estimate: 4 days
>  Remaining Estimate: 4 days
>
> To replicate this behaviour follow these steps:
> 1) create a custom component and its rendrerer.
> 2) In this parent renderere code try to create 2 child components to this parent component programatically (say 2 input texts..).
> 3) Each of this individual child components has to be ajax aware. So we add support objects to it with neccessary metadata.
> 4) in the xhtml try to verfy whether all the components are rendrered correctly and whether their defined events fire AJAX call.
> There is a thread on this forum where i have staed ths problem...URL is attached..
> I have already set code to sergeysmirnov at dev.java.net with subject Query on ajax4jsf.
> I have noted that till the last line of my renderer code all flow is correct..only whne HTML is generated it has no AJAX script declaration or support objects...but the A4J submit function exists...
> I have tried with several beta as well as stable versions but it did not work.
> Please help with this issue..kindly suggest any ideas to make this work..

-- 
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

        



More information about the richfaces-issues mailing list