Java Code Examples for javax.faces.component.UIComponent#isCompositeComponent()

The following examples show how to use javax.faces.component.UIComponent#isCompositeComponent() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: BootsFaces-OSP   File: TabRepeat.java    License: Apache License 2.0 4 votes vote down vote up
public void broadcast(FacesEvent event) throws AbortProcessingException {
	if (event instanceof IndexedEvent) {
		IndexedEvent idxEvent = (IndexedEvent) event;
		this.resetDataModel();
		int prevIndex = this.index;
		FacesContext ctx = FacesContext.getCurrentInstance();
		FacesEvent target = idxEvent.getTarget();
		UIComponent source = target.getComponent();
		UIComponent compositeParent = null;
		try {
			int rowCount = getDataModel().getRowCount();
			int idx = idxEvent.getIndex();
			this.setIndex(ctx, idx);
			Integer begin = this.getBegin();
			Integer end = this.getEnd();
			Integer step = this.getStep();
			int b = ((begin != null) ? begin : 0);
			int e = ((end != null) ? end : rowCount);
			int s = ((step != null) ? step : 1);
			this.updateIterationStatus(ctx,
					new IterationStatus(idx == b, (idx + s >= e || rowCount == 1), idx, begin, end, step));
			if (this.isIndexAvailable()) {
				if (!UIComponent.isCompositeComponent(source)) {
					compositeParent = UIComponent.getCompositeComponentParent(source);
				}
				if (compositeParent != null) {
					compositeParent.pushComponentToEL(ctx, null);
				}
				source.pushComponentToEL(ctx, null);
				source.broadcast(target);

			}
		} finally {
			source.popComponentFromEL(ctx);
			if (compositeParent != null) {
				compositeParent.popComponentFromEL(ctx);
			}
			this.updateIterationStatus(ctx, null);
			this.setIndex(ctx, prevIndex);
		}
	} else {
		super.broadcast(event);
	}
}