public void processListener(FacesListener listener) { ForEach owner = (ForEach) this.getComponent(); Integer currentIndex = owner.getIndex(); owner.setIndex(index); originalEvent.processListener(listener); owner.setIndex(currentIndex); }
@Override public void broadcast(FacesEvent event) throws AbortProcessingException { if (event instanceof IndexedEvent) { IndexedEvent indexedEvent = (IndexedEvent) event; Integer eventIndex = indexedEvent.getIndex(); Integer currentIndex = getIndex(); try { setIndex(eventIndex); FacesEvent originalEvent = indexedEvent.getOriginalEvent(); originalEvent.getComponent().broadcast(originalEvent); } finally { this.setIndex(currentIndex); } } else { super.broadcast(event); } }
public void setObjectId(String objectId) { if (objectId != null) setIndex(Integer.valueOf(objectId)); else setIndex(null); }
/** * Perform one step of iteration. * * @return current item of value-bound collection as an <code>java.lang.Object</code> or <code> * null</code> if no value-bound data collection is specified. */ public Object next() { if (!hasNext()) throw new FacesException("Further iteration not allowed"); setIndex(getNextIndex()); return status.getCurrent(); }