Quantcast
Channel: Ivanti User Community: Message List
Viewing all articles
Browse latest Browse all 12047

Re: Provide Input Validation when usign Generic Data Fields

$
0
0

I am working on my first form which itself is using dynamic windows.

The window has  approx. 13 sections each in its own groupbox. 4 sections will be common to all windows e.g. user and creation details.

Of the remaining 9 windows for this particular request one is the master section which is always displayed and contains a trigger attribute to determine which one of the remaining sections should be shown. These 8 mutually exclusive sections contain approx. 30 fields.

 

Problems I have with a single window is

  • keeping track of 1000's of attributes on one window
  • what performance impact is there of dynamically setting properties on 1000's of fields.
  • harping back to my original stance on database bloat having a single window will make it impossible to re-use objects for example NI number could be used on many different requests but if they are all on the one dynamic form each request would have to have its own NI number object because it will be impossible to keep the field position on the window in the same place for different requests

 

Early days yet but I  have a trigger on the always displayed section window to hide or display the relevant fields using a calculation with this construct

 

import System

static def GetAttributeValue(Request):

     Hide = false

     Mustfill = true

     Value = ""

     if Request._LGSSTCETypes._Type != null and Request._LGSSTCETypes._Type == "Change Working Hours or Weeks":

          Value += ":SetHidden(_LGSSNewSubmission, {0});"

          Value += ":SetHidden(_LGSSHoursPerWeek, {0});"

          Value += ":SetHidden(_LGSSMinutesPerWeek, {0});"

          Value += ":SetHidden(_LGSSWeeksPerYear, {0});"

          Value += ":SetHidden(_LGSSPercentage, {0});"

          Value += ":SetMandatory(_LGSSNewSubmission, {1});"

          Value += ":SetMandatory(_LGSSHoursPerWeek, {1});"

          Value += ":SetMandatory(_LGSSMinutesPerWeek, {1});"

          Value += ":SetMandatory(_LGSSWeeksPerYear, {1});"

          Value += ":SetMandatory(_LGSSPercentage, {1});"

          Value = String.Format(Value,Hide,Mustfill)

          return Value

     elif Request._LGSSTCETypes._Type != null and Request._LGSSTCETypes._Type == "Change Location":

          Value += ":SetHidden(_LGSSNewLocation, {0});"

          Value += ":SetHidden(_LGSSRelocateEndDate, {0});"

          Value += ":SetMandatory(_LGSSNewLocation, {1});"

          Value += ":SetMandatory(_LGSSRelocateEndDate, {1});"

          Value = String.Format(Value,Hide,Mustfill)

          return Value

     elif Request._LGSSTCETypes._Type != null and Request._LGSSTCETypes._Type == "section x selected":

          Value += ":SetHidden(_sectionxfieldy, {0});"

          Value += ":SetMandatory(_LGSSNewLocation, {1});"

repeat elif for all sections

     else:

          Hide = true

          Mustfill = false

          Value += ":SetHidden(_LGSSNewSubmission, {0});"

repeat for all fields

          Value += ":SetMandatory(_LGSSHoursPerWeek, {1});"

repeat for all fields

          Value = String.Format(Value,Hide,Mustfill)

          return Value


Viewing all articles
Browse latest Browse all 12047

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>