Permalink
Browse files

fixed #949. Closes #949. Record correctly uses uniqueFieldId and will…

… work with Screen
  • Loading branch information...
1 parent a87c944 commit 02754091c17e5be1fef4ac3e5df8f1aab9c5ad48 @dpp dpp committed Mar 25, 2011
@@ -82,7 +82,7 @@ class DateField[OwnerType <: MongoRecord[OwnerType]](rec: OwnerType)
def toForm =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id + "_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
@@ -75,7 +75,7 @@ class MongoPasswordField[OwnerType <: MongoRecord[OwnerType]](rec: OwnerType, mi
override def toForm: Box[NodeSeq] =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id+"_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
@@ -79,7 +79,7 @@ class ObjectIdField[OwnerType <: MongoRecord[OwnerType]](rec: OwnerType)
def toForm =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id + "_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
@@ -73,7 +73,7 @@ class UUIDField[OwnerType <: MongoRecord[OwnerType]](rec: OwnerType)
def toForm =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id + "_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
@@ -116,7 +116,7 @@ trait BaseField extends FieldIdentifier with util.BaseField {
override def uniqueFieldId: Box[String] = Full(name+"_id")
def label: NodeSeq = uniqueFieldId match {
- case Full(id) => <label for={id+"_field"}>{displayName}</label>
+ case Full(id) => <label for={id}>{displayName}</label>
case _ => NodeSeq.Empty
}
@@ -403,7 +403,7 @@ trait Field[ThisType, OwnerType <: Record[OwnerType]] extends OwnedField[OwnerTy
*
* E.g.
* <div id={ id + "_holder" }>
- * <div><label for={ id + "_field" }>{ displayName }</label></div>
+ * <div><label for={ id }>{ displayName }</label></div>
* { control }
* </div>
*/
@@ -412,7 +412,7 @@ trait DisplayWithLabel[OwnerType <: Record[OwnerType]] extends OwnedField[OwnerT
for (id <- uniqueFieldId; control <- super.toForm)
yield
<div id={ id + "_holder" }>
- <div><label for={ id + "_field" }>{ displayName }</label></div>
+ <div><label for={ id }>{ displayName }</label></div>
{ control }
<lift:msg id={id} errorClass="lift_error"/>
</div>
@@ -38,7 +38,7 @@ trait BooleanTypedField extends TypedField[Boolean] {
def toForm: Box[NodeSeq] =
// FIXME? no support for optional_?
uniqueFieldId match {
- case Full(id) => Full(elem("id" -> (id + "_field")))
+ case Full(id) => Full(elem("id" -> id))
case _ => Full(elem())
}
@@ -53,7 +53,7 @@ trait DateTimeTypedField extends TypedField[Calendar] {
def toForm: Box[NodeSeq] =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id + "_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
@@ -71,7 +71,7 @@ trait EnumTypedField[EnumType <: Enumeration] extends TypedField[EnumType#Value]
def toForm: Box[NodeSeq] =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id + "_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
@@ -59,7 +59,7 @@ trait EnumNameTypedField[EnumType <: Enumeration] extends TypedField[EnumType#Va
def toForm: Box[NodeSeq] =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id + "_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
@@ -44,7 +44,7 @@ trait LocaleTypedField extends TypedField[String] {
override def toForm: Box[NodeSeq] =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id + "_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
}
@@ -49,7 +49,7 @@ trait NumericTypedField[MyType] extends TypedField[MyType] {
*/
def toForm: Box[NodeSeq] =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id + "_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
@@ -77,7 +77,7 @@ trait PasswordTypedField extends TypedField[String] {
def toForm: Box[NodeSeq] =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id + "_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
@@ -55,7 +55,7 @@ trait StringTypedField extends TypedField[String] with StringValidators {
def toForm: Box[NodeSeq] =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id + "_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
@@ -35,7 +35,7 @@ trait TextareaTypedField extends StringTypedField {
override def toForm: Box[NodeSeq] =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id + "_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
@@ -47,7 +47,7 @@ trait TimeZoneTypedField extends StringTypedField {
override def toForm: Box[NodeSeq] =
uniqueFieldId match {
- case Full(id) => Full(elem % ("id" -> (id + "_field")))
+ case Full(id) => Full(elem % ("id" -> id))
case _ => Full(elem)
}
}
@@ -212,7 +212,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryBooleanField,
JsTrue,
JBool(bool),
- Full("<input checked=\"checked\" tabIndex=\"1\" value=\"true\" type=\"checkbox\" name=\".*\" id=\"mandatoryBooleanField_id_field\"></input><input value=\"false\" type=\"hidden\" name=\".*\"></input>")
+ Full("<input checked=\"checked\" tabIndex=\"1\" value=\"true\" type=\"checkbox\" name=\".*\" id=\"mandatoryBooleanField_id\"></input><input value=\"false\" type=\"hidden\" name=\".*\"></input>")
)
}
@@ -225,7 +225,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryCountryField,
Str(country.toString),
JInt(country.id),
- Full("<select tabindex=\"1\" name=\".*\" id=\"mandatoryCountryField_id_field\">.*<option value=\".*\" selected=\"selected\">"+country.toString+"</option>.*</select>")
+ Full("<select tabindex=\"1\" name=\".*\" id=\"mandatoryCountryField_id\">.*<option value=\".*\" selected=\"selected\">"+country.toString+"</option>.*</select>")
)
}
@@ -239,7 +239,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryDateTimeField,
Str(dtStr),
JString(dtStr),
- Full("<input name=\".*\" type=\"text\" tabindex=\"1\" value=\""+dtStr+"\" id=\"mandatoryDateTimeField_id_field\"></input>")
+ Full("<input name=\".*\" type=\"text\" tabindex=\"1\" value=\""+dtStr+"\" id=\"mandatoryDateTimeField_id\"></input>")
)
}
@@ -252,7 +252,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryDecimalField,
JsRaw(bd.toString),
JString(bd.toString),
- Full("<input name=\".*\" type=\"text\" tabindex=\"1\" value=\""+bd.toString+"\" id=\"mandatoryDecimalField_id_field\"></input>")
+ Full("<input name=\".*\" type=\"text\" tabindex=\"1\" value=\""+bd.toString+"\" id=\"mandatoryDecimalField_id\"></input>")
)
}
@@ -265,7 +265,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryDoubleField,
JsRaw(d.toString),
JDouble(d),
- Full("<input name=\".*\" type=\"text\" tabindex=\"1\" value=\""+d.toString+"\" id=\"mandatoryDoubleField_id_field\"></input>")
+ Full("<input name=\".*\" type=\"text\" tabindex=\"1\" value=\""+d.toString+"\" id=\"mandatoryDoubleField_id\"></input>")
)
}
@@ -278,7 +278,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryEmailField,
Str(email),
JString(email),
- Full("<input name=\".*\" type=\"text\" maxlength=\"100\" tabindex=\"1\" value=\""+email+"\" id=\"mandatoryEmailField_id_field\"></input>")
+ Full("<input name=\".*\" type=\"text\" maxlength=\"100\" tabindex=\"1\" value=\""+email+"\" id=\"mandatoryEmailField_id\"></input>")
)
}
@@ -291,7 +291,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryEnumField,
Str(ev.toString),
JInt(ev.id),
- Full("<select tabindex=\"1\" name=\".*\" id=\"mandatoryEnumField_id_field\">.*<option value=\".*\" selected=\"selected\">"+ev.toString+"</option>.*</select>")
+ Full("<select tabindex=\"1\" name=\".*\" id=\"mandatoryEnumField_id\">.*<option value=\".*\" selected=\"selected\">"+ev.toString+"</option>.*</select>")
)
}
@@ -304,7 +304,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryIntField,
JsRaw(num.toString),
JInt(num),
- Full("<input name=\".*\" type=\"text\" tabindex=\"1\" value=\""+num.toString+"\" id=\"mandatoryIntField_id_field\"></input>")
+ Full("<input name=\".*\" type=\"text\" tabindex=\"1\" value=\""+num.toString+"\" id=\"mandatoryIntField_id\"></input>")
)
}
@@ -326,7 +326,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryLongField,
JsRaw(lng.toString),
JInt(lng),
- Full("<input name=\".*\" type=\"text\" tabindex=\"1\" value=\""+lng.toString+"\" id=\"mandatoryLongField_id_field\"></input>")
+ Full("<input name=\".*\" type=\"text\" tabindex=\"1\" value=\""+lng.toString+"\" id=\"mandatoryLongField_id\"></input>")
)
}
@@ -360,7 +360,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryPostalCodeField,
Str(zip),
JString(zip),
- Full("<input name=\".*\" type=\"text\" maxlength=\"32\" tabindex=\"1\" value=\""+zip+"\" id=\"mandatoryPostalCodeField_id_field\"></input>")
+ Full("<input name=\".*\" type=\"text\" maxlength=\"32\" tabindex=\"1\" value=\""+zip+"\" id=\"mandatoryPostalCodeField_id\"></input>")
)
}
@@ -374,7 +374,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryStringField,
Str(str),
JString(str),
- Full("<input name=\".*\" type=\"text\" maxlength=\"100\" tabindex=\"1\" value=\""+str+"\" id=\"mandatoryStringField_id_field\"></input>")
+ Full("<input name=\".*\" type=\"text\" maxlength=\"100\" tabindex=\"1\" value=\""+str+"\" id=\"mandatoryStringField_id\"></input>")
)
}
@@ -460,7 +460,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryTextareaField,
Str(txt),
JString(txt),
- Full("<textarea name=\".*\" rows=\"8\" tabindex=\"1\" cols=\"20\" id=\"mandatoryTextareaField_id_field\">"+txt+"</textarea>")
+ Full("<textarea name=\".*\" rows=\"8\" tabindex=\"1\" cols=\"20\" id=\"mandatoryTextareaField_id\">"+txt+"</textarea>")
)
}
@@ -476,7 +476,7 @@ object FieldSpec extends Specification("Record Field Specification") {
rec.mandatoryTimeZoneField,
Str(example),
JString(example),
- Full("<select tabindex=\"1\" name=\".*\" id=\"mandatoryTimeZoneField_id_field\">.*<option value=\""+example+"\" selected=\"selected\">"+example+"</option>.*</select>")
+ Full("<select tabindex=\"1\" name=\".*\" id=\"mandatoryTimeZoneField_id\">.*<option value=\""+example+"\" selected=\"selected\">"+example+"</option>.*</select>")
)
}
}

0 comments on commit 0275409

Please sign in to comment.