public void saveCurrentState() { currentRowIndex = data.getRowIndex(); }
private int getCurrentRowIndex(UIComponent component) { UIData uidata = findUIData(component); if (uidata == null) return -1; else return uidata.getRowIndex(); }
public UniqueColumnValueChecker(UIData table, UIInput input) { this.table = table; rowIndex = table.getRowIndex(); this.input = input; value = input.getLocalValue(); }
private int getCurrentRowIndex(UIComponent component) { UIData uidata = findUIData(component); if (uidata == null) return -1; else return uidata.getRowIndex(); }
protected void setupPerspective() { if(enableSetupPerspective) { oldRowIndex = uiData.getRowIndex(); uiData.setRowIndex(rowIndex); } }
public UniqueColumnValueChecker(UIData table, UIInput input) { this.table = table; rowIndex = table.getRowIndex(); this.input = input; value = input.getLocalValue(); }
@Override public VisitResult visit(VisitContext context, UIComponent target) { // Yes, this check does look a bit strange, but really physically the very same single UIInput component is // been reused in all rows of the UIData component. It's only its internal state which changes on a per-row // basis, as would happen during the tree visit. Those changes are reflected in the "input" reference. if (target == input && rowIndex != table.getRowIndex() && input.isValid() && value.equals(input.getLocalValue())) { duplicate = true; duplicateIndex = table.getRowIndex(); return VisitResult.COMPLETE; } return VisitResult.ACCEPT; }
@Override public String getClientId(FacesContext context) { String clientId = super.getClientId(context); int rowIndex = getRowIndex(); if (rowIndex == -1) { return clientId; } return clientId + NamingContainer.SEPARATOR_CHAR + rowIndex; }
@Override public VisitResult visit(VisitContext context, UIComponent target) { // Yes, this check does look a bit strange, but really physically the very same single UIInput component is // been reused in all rows of the UIData component. It's only its internal state which changes on a per-row // basis, as would happen during the tree visit. Those changes are reflected in the "input" reference. if (target == input && rowIndex != table.getRowIndex() && input.isValid() && value.equals(input.getLocalValue())) { duplicate = true; duplicateIndex = table.getRowIndex(); return VisitResult.COMPLETE; } return VisitResult.ACCEPT; }
@Override public String getContainerClientId(FacesContext context) { //MYFACES-2744 UIData.getClientId() should not append rowIndex, instead use UIData.getContainerClientId() String clientId = super.getContainerClientId(context); int rowIndex = getRowIndex(); if (rowIndex == -1) { return clientId; } StringBuilder bld = _getSharedStringBuilder(context); return bld.append(clientId).append(context.getNamingContainerSeparatorChar()).append(rowIndex).toString(); }
private static boolean idsAreEqual(String id, UIComponent cmp) { if(id.equals(cmp.getId())) return true; if(cmp instanceof UIData) { UIData uiData = ((UIData) cmp); if(uiData.getRowIndex()==-1) { return dynamicIdIsEqual(id,cmp.getId()); } return id.equals(cmp.getId()+NamingContainer.SEPARATOR_CHAR+uiData.getRowIndex()); } return false; }
/** * <p>Override the default {@link UIComponentBase#queueEvent} processing to * wrap any queued events in a wrapper so that we can reset the current row * index in <code>broadcast()</code>.</p> * * @param event {@link FacesEvent} to be queued * * @throws IllegalStateException if this component is not a descendant of a * {@link UIViewRoot} * @throws NullPointerException if <code>event</code> is <code>null</code> */ public void queueEvent(FacesEvent event) { super.queueEvent(new WrapperEvent(this, event, getRowIndex())); }
/** * <p>Override the default {@link UIComponentBase#queueEvent} processing to * wrap any queued events in a wrapper so that we can reset the current row * index in <code>broadcast()</code>.</p> * * @param event {@link FacesEvent} to be queued * * @throws IllegalStateException if this component is not a descendant of a * {@link UIViewRoot} * @throws NullPointerException if <code>event</code> is <code>null</code> */ public void queueEvent(FacesEvent event) { super.queueEvent(new WrapperEvent(this, event, getRowIndex())); }
/** * <p>Override the default {@link UIComponentBase#queueEvent} processing to * wrap any queued events in a wrapper so that we can reset the current row * index in <code>broadcast()</code>.</p> * * @param event {@link FacesEvent} to be queued * * @throws IllegalStateException if this component is not a descendant of a * {@link UIViewRoot} * @throws NullPointerException if <code>event</code> is <code>null</code> */ @Override public void queueEvent(FacesEvent event) { super.queueEvent(new WrapperEvent(this, event, getRowIndex())); }
/** * <p>Override the default {@link UIComponentBase#queueEvent} processing to * wrap any queued events in a wrapper so that we can reset the current row * index in <code>broadcast()</code>.</p> * * @param event {@link FacesEvent} to be queued * * @throws IllegalStateException if this component is not a descendant of a * {@link UIViewRoot} * @throws NullPointerException if <code>event</code> is <code>null</code> */ @Override public void queueEvent(FacesEvent event) { super.queueEvent(new WrapperEvent(this, event, getRowIndex())); }
/** * <p>Override the default {@link UIComponentBase#queueEvent} processing to * wrap any queued events in a wrapper so that we can reset the current row * index in <code>broadcast()</code>.</p> * * @param event {@link FacesEvent} to be queued * * @throws IllegalStateException if this component is not a descendant of a * {@link UIViewRoot} * @throws NullPointerException if <code>event</code> is <code>null</code> */ public void queueEvent(FacesEvent event) { super.queueEvent(new WrapperEvent(this, event, getRowIndex())); }
/** * <p>Override the default {@link UIComponentBase#queueEvent} processing to * wrap any queued events in a wrapper so that we can reset the current row * index in <code>broadcast()</code>.</p> * * @param event {@link FacesEvent} to be queued * * @throws IllegalStateException if this component is not a descendant of a * {@link UIViewRoot} * @throws NullPointerException if <code>event</code> is <code>null</code> */ @Override public void queueEvent(FacesEvent event) { super.queueEvent(new WrapperEvent(this, event, getRowIndex())); }
public void myListener(ValueChangeEvent e){ UIData data = (UIData) e.getComponent().findComponent("myDatatableId"); int rowIndex = data.getRowIndex(); Object myNewValue = e.getNewValue(); Object myOldValue = e.getOldValue(); }
public void queueEvent(FacesEvent event) { AssertionUtil.assertNotNull("event", event); super.queueEvent(new FacesEventWrapper(event, getRowIndex(), this)); }
public void broadcast(FacesEvent event) throws AbortProcessingException { AssertionUtil.assertNotNull("event", event); if (!(event instanceof FacesEventWrapper)) { super.broadcast(event); return; } FacesEventWrapper e = (FacesEventWrapper) event; int rowIndex = getRowIndex(); setRowIndex(e.getRowIndex()); FacesEvent orgEvent = e.getFacesEvent(); orgEvent.getComponent().broadcast(orgEvent); setRowIndex(rowIndex); }