01: // Copyright 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14:
15: package org.apache.tapestry;
16:
17: /**
18: * Interface for any kind of object (typically, a component) that can provide a
19: * {@link #getClientId() client-side id}, typically used in the generation of client-side
20: * (JavaScript) logic. For components, the client id will be null or innaccurate until after the
21: * component has rendered itself. Inside of any kind of loop, the clientId property is only accurate
22: * just after the component has rendered, and before it renders again.
23: * <p>
24: * Some components must be configured to provide a client id. In many cases, the client id matches
25: * the component's {@link ComponentResourcesCommon#getId() component id}, typically passed through
26: * {@link PageRenderSupport#allocateClientId(String)} to ensure uniqueness.
27: */
28: public interface ClientElement {
29: /**
30: * Returns a unique id for the element. This value will be unique for any given rendering of a
31: * page. This value is intended for use as the id attribute of the client-side element, and will
32: * be used with any DHTML/Ajax related JavaScript.
33: */
34: String getClientId();
35: }
|