Validation error messages disappear when Trinidad component panelAccordion is minimized or maximized

StackOverflow https://stackoverflow.com/questions/17579018

  •  02-06-2022
  •  | 
  •  

سؤال

I have a form that is very long but is submitted and validated all together. I need to break it up into sections.

I have tried using the Trinidad component panelAccordion to break the form into sections.

However if I then submit and validate the form, clicking one of the panels open or closed causes the validation messages to disappear.

Is there any way to avoid this?

Or is there a better way to achieve the same result of breaking up the form?

I am using Trinidad 1.2.6 and MyFaces 2.0. Due to corporate standards I cannot use anything else.

هل كانت مفيدة؟

المحلول

One way you can achieve the desired effect is by submitting the form when a user clicks on each <tr:accordionPanel>. It supports many other client side events so pick one that best suits your needs.If you submit the entire form, this will force validation to kick in for all components however, whether the user entered a value or not. This might be the quickest and simplest way but some people might be picky and not like this solution.

You can also make use of partial updates and partial triggers and submit only the components that are part of the current accordion panel based on the event you choose.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top