Go Back   SmartClient Forums > Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 12th Mar 2009, 15:15
kkumar kkumar is offline
Registered Developer
 
Join Date: Mar 2009
Posts: 5
Default Validations are not called when I use section in Dyanmic Form.

Hi Iso,

Below is the field declaration of section.

{
name:"bi",
defaultValue: "Basic Information",
type: "section",
showIf :"this.form != null",
sectionExpanded: false,
itemIds: [
"code","name"
]}

Both items included in this section are required fields and when I don't include them in section I can see validation errors/ required field errors but when section is collapsed and I click on save, the form is submitted without validation being checked for these fields and I get back end error for PK.

I need to perform validation even if section is closed/ collapsed and if there are errors then section should open on click of save with errors showing up and form not being submitted.

Is my requirement valid?

Thanks.
Reply With Quote
  #2  
Old 12th Mar 2009, 15:17
Isomorphic Isomorphic is online now
Administrator
 
Join Date: May 2006
Posts: 30,564
Default

You can force validation of hidden fields. See DynamicForm.validate().
Reply With Quote
  #3  
Old 12th Mar 2009, 15:18
kkumar kkumar is offline
Registered Developer
 
Join Date: Mar 2009
Posts: 5
Default

But are these fields set as hidden when section is collapsed. I didn't define them as hidden.

Thanks,
Karan.
Reply With Quote
  #4  
Old 12th Mar 2009, 15:20
Isomorphic Isomorphic is online now
Administrator
 
Join Date: May 2006
Posts: 30,564
Default

Yeah. Same solution.
Reply With Quote
  #5  
Old 12th Mar 2009, 15:24
kkumar kkumar is offline
Registered Developer
 
Join Date: Mar 2009
Posts: 5
Default

Thanks ISO,

You did a quick fix.
Reply With Quote
  #6  
Old 12th Mar 2009, 15:48
kkumar kkumar is offline
Registered Developer
 
Join Date: Mar 2009
Posts: 5
Default

I got into a problem.

I have databound fields which are not validated and in reference docs I found that handleHiddenValidationErrors(error) is the function to do that. But can anyone tell me how and where to use this function.

Thanks,
Karan.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved