legacy-knowledge-base
公開されました Jun. 30, 2025

フラグメントのテキストフィールドでバリデーションを使用するには?

written-by

Tamas Kovacs

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • フラグメントのテキストフィールドのバリデーションを作成したい。
  • Freemarkerを使用してフラグメントのテキストフィールドを検証しようとすると、公開された編集可能フィールドで実行されない
  • バリデーションはページ編集ビューのデフォルト値に対してのみ機能し、公開後の最終フィールドに対しては機能しません。

環境

  • Liferay DXP 7.4

解像度

注意:この解決法では、テキスト・フィールドはcustomObjectにリンクされている必要があります。

  • コントロールパネル > オブジェクト > customObject > バリデーション > "+" にアクセスする。
  • 名前を付け、タイプとして "Expression Builder "を選択する > Save
  • testValidation" > "Active Validation "をTrueに設定する。
  • Conditions "に進み、RegExバリデーションルールを入力する。
  • お好みのエラーメッセージを入力してください。
  • 保存
  • これで、Objectsフレームワークを通して送信されたときに、テキストフィールドの内容が検証されるようになります。
did-this-article-resolve-your-issue

legacy-knowledge-base