= @ParameterLayout
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Collects together all layout hints for action parameters in a single annotation.

== API

[source,java]
.ParameterLayout.java
----
@interface ParameterLayout {
  String cssClass() default "";     // <.>
  String describedAs() default "";     // <.>
  LabelPosition labelPosition() default LabelPosition.NOT_SPECIFIED;     // <.>
  String named() default "";     // <.>
  int multiLine() default -1;     // <.>
  int typicalLength() default -1;     // <.>
}
----

<.> xref:#cssClass[cssClass]
+
--
Indicates the css class that a parameter should have, to allow more targeted styling in `application.css` .
--
<.> xref:#describedAs[describedAs]
+
--
Description of this property, eg to be rendered in a tooltip.
--
<.> xref:#labelPosition[labelPosition]
+
--
In forms, positioning of the label (left, top or none) relative to the parameter value.
--
<.> xref:#named[named]
+
--
Name of this action parameter.
--
<.> xref:#multiLine[multiLine]
+
--
For string parameters (and properties), whether to render as a text area over multiple lines.
--
<.> xref:#typicalLength[typicalLength]
+
--
The typical entry length of a field, use to determine the optimum width for display
--

== Members

[#cssClass]
=== cssClass

Indicates the css class that a parameter should have, to allow more targeted styling in `application.css` .

[#describedAs]
=== describedAs

Description of this property, eg to be rendered in a tooltip.

[#labelPosition]
=== labelPosition

In forms, positioning of the label (left, top or none) relative to the parameter value.

If not specified, the default depends upon the parameter value's datatype (including whether the field is _#multiLine()_ .

[#named]
=== named

Name of this action parameter.

The name of an action parameters is available to the framework provided that the code is compiled using `-parameters` (for `javac` .

The only reason then to name the parameter is if the desired name is a reserved Java keyword, such as `default` or `package`.

[#multiLine]
=== multiLine

For string parameters (and properties), whether to render as a text area over multiple lines.

If set to > 1, then _#labelPosition()_ defaults to _LabelPosition#TOP top_ .

[#typicalLength]
=== typicalLength

The typical entry length of a field, use to determine the optimum width for display

Note: the Wicket viewer does not use this information.

include::hooks/ParameterLayout_010-examples-and-usage.adoc[]

include::hooks/ParameterLayout_021-labelPosition.adoc[]

include::hooks/ParameterLayout_022-multiLine.adoc[]

include::hooks/ParameterLayout_023-describedAs.adoc[]

include::hooks/ParameterLayout_024-cssClass.adoc[]

include::hooks/ParameterLayout_025-renderDay.adoc[]

include::hooks/ParameterLayout_026-named.adoc[]

include::hooks/ParameterLayout_027-typicalLength.adoc[]
