Method from javax.faces.component.UIForm Detail: |
public String createUniqueId(FacesContext context,
String seed) {
Integer i = (Integer) getStateHelper().get(PropertyKeys.lastId);
int lastId = ((i != null) ? i : 0);
getStateHelper().put(PropertyKeys.lastId, ++lastId);
return UIViewRoot.UNIQUE_ID_PREFIX + (seed == null ? lastId : seed);
}
|
public String getContainerClientId(FacesContext context) {
if (this.isPrependId()) {
return super.getContainerClientId(context);
} else {
UIComponent parent = this.getParent();
while (parent != null) {
if (parent instanceof NamingContainer) {
return parent.getContainerClientId(context);
}
parent = parent.getParent();
}
}
return null;
}
|
public String getFamily() {
return (COMPONENT_FAMILY);
}
|
public boolean isPrependId() {
return (Boolean) getStateHelper().eval(PropertyKeys.prependId, true);
}
|
public boolean isSubmitted() {
return (this.submitted);
}
Returns the current value of the submitted
property. The default value is false . See #setSubmitted for details.
|
public void processDecodes(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
// Process this component itself
decode(context);
// if we're not the submitted form, don't process children.
if (!isSubmitted()) {
return;
}
// Process all facets and children of this component
Iterator kids = getFacetsAndChildren();
while (kids.hasNext()) {
UIComponent kid = (UIComponent) kids.next();
kid.processDecodes(context);
}
}
Override UIComponent#processDecodes to ensure that the
form is decoded before its children. This is
necessary to allow the submitted property to be
correctly set.
|
public void processUpdates(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
if (!isSubmitted()) {
return;
}
// Process all facets and children of this component
Iterator kids = getFacetsAndChildren();
while (kids.hasNext()) {
UIComponent kid = (UIComponent) kids.next();
kid.processUpdates(context);
}
}
|
public void processValidators(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
if (!isSubmitted()) {
return;
}
Application app = context.getApplication();
app.publishEvent(context, PreValidateEvent.class, this);
// Process all the facets and children of this component
Iterator kids = getFacetsAndChildren();
while (kids.hasNext()) {
UIComponent kid = (UIComponent) kids.next();
kid.processValidators(context);
}
app.publishEvent(context, PostValidateEvent.class, this);
}
|
public void setPrependId(boolean prependId) {
getStateHelper().put(PropertyKeys.prependId, prependId);
}
|
public void setSubmitted(boolean submitted) {
this.submitted = submitted;
}
If this UIForm instance (as
opposed to other forms in the page) is experiencing a submit
during this request processing lifecycle, this method must be
called, with true as the argument, during the UIComponent#decode for this UIForm instance. If
this UIForm instance is
not experiencing a submit, this method must be
called, with false as the argument, during the
UIComponent#decode for this UIForm
instance.
The value of a UIForm 's submitted property must
not be saved as part of its state.
|
public boolean visitTree(VisitContext context,
VisitCallback callback) {
// NamingContainers can optimize partial tree visits by taking advantage
// of the fact that it is possible to detect whether any ids to visit
// exist underneath the NamingContainer. If no such ids exist, there
// is no need to visit the subtree under the NamingContainer.
// UIForm is a bit different from other NamingContainers. It only acts
// as a NamingContainer when prependId is true. Note that if it
// weren't for this, we could push this implementation up in to
// UIComponent and share it across all NamingContainers. Instead,
// we currently duplicate this implementation in UIForm and
// UINamingContainer, so that we can check isPrependId() here.
if (!this.isPrependId()) {
return super.visitTree(context, callback);
}
Collection< String > idsToVisit = context.getSubtreeIdsToVisit(this);
assert (idsToVisit != null);
// If we have ids to visit, let the superclass implementation
// handle the visit
if (!idsToVisit.isEmpty()) {
return super.visitTree(context, callback);
}
// If we have no child ids to visit, just visit ourselves, if
// we are visitable.
if (isVisitable(context)) {
FacesContext facesContext = context.getFacesContext();
pushComponentToEL(facesContext, null);
try {
VisitResult result = context.invokeVisitCallback(this, callback);
return (result == VisitResult.COMPLETE);
}
finally {
popComponentFromEL(facesContext);
}
}
// Done visiting this subtree. Return false to allow
// visit to continue.
return false;
}
|