0

I have a SelectList from which user selects x,y,z recordName from Object 'A' in a pageBlock 'A' for which the an another pageblock 'B' gets rendered showing fields to insert into 'B' object. Out of all the fields in pageBlock B , few are mandatory so I added attribute ,required = true for them. But the problem occurs when user by mistake selects a wrong record in selectList under PageBlock A , and try to select correct value.

While doing that , the method inside controller should get called which Required fields' empty value are restricting.

Now , I can remove that by taking of "REQUIRED = TRUE" attribute from fields and do the validation in controller. But I am looking for a solution at UI side only such that I do not write any validation code inside my controller.

Is there a solution in SFDC only to do this ?

  • have you tried sing javascript? – Nick Cook Sep 6 '16 at 8:02
  • I haven't. Before doing that , I would like to know if it can be done by SFDC , like restricting Required field's effect to some pageBlock or something else. Such that calling controller on SelectList Value Change should not get restricted because of 'Required = true' attribute in pageBlock B . – Rajeev Sep 6 '16 at 8:07
1

There is one attribute immediate="true" using that it will skip all required field on page.

Use this to skip validation no need to remove required.

Reference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.