Best Practice on Reusing forms

Hi,

I would like to ask whats the best practice in using Reusable SAIL forms?

 

For example there are 3 forms. 

Form1 - Contains Details (editable)

Form2 - Contains another details (editable)

Form3 - Holds both Form1 and Form2 (sort of a container)

 

Form1 and Form2 have Load() part and Form3 as well.

Is it okay to have Load() in each form?

I notice that the data in Form1 and 2 does not refresh until I reload browser the entire UI (Form3).

 

Is it a good practice to have Load on the Reusable UIs (Form1 and 2) ?

 

Thanks!

  Discussion posts and replies are publicly visible

Parents
  • I haven't come across an explicit best practice that talks about how load() should be used for reusable UIs/nested interfaces but I've been a fan of keeping all my local variables on the main form (if possible). Within Form 1 and 2, they would be referenced as ri! inputs. This approach helps me keep track of code when I'm either developing or reviewing. Here's an example:

    ----Main Form-----
    load(
    local!variable1:123,
    local!variable2:456,
    local!variable3:789,
    local!variable4:012,

    a!formLayout(
    firstColumnContents:{
    rule!form1(
    variable1:local!variable1,
    variable2:local!variable2
    ),

    rule!form2(
    variable3:local!variable3,
    variable4:local!variable4
    )
    }
    )
    )

    ----End of Main Form-----


    ---- Within Form 1----- inputs: ri!variable1, ri!variable2
    a!sectionLayout(
    firstColumnContents:{
    a!textField(
    value:ri!variable1
    ),
    a!paragraphField(
    value:ri!variable2
    )
    }
    )
    ---End of Form 1 (The same would be for Form 2) -----

    If the local variables aren't doing anything heavy (such as nested queries that retrieve several rows), then this approach is fine, otherwise, for performance, I would at least parse out "when" these local variables are declared/initialized within the main form & don't forget to use with() wherever needed (for refreshing data purposes).
Reply
  • I haven't come across an explicit best practice that talks about how load() should be used for reusable UIs/nested interfaces but I've been a fan of keeping all my local variables on the main form (if possible). Within Form 1 and 2, they would be referenced as ri! inputs. This approach helps me keep track of code when I'm either developing or reviewing. Here's an example:

    ----Main Form-----
    load(
    local!variable1:123,
    local!variable2:456,
    local!variable3:789,
    local!variable4:012,

    a!formLayout(
    firstColumnContents:{
    rule!form1(
    variable1:local!variable1,
    variable2:local!variable2
    ),

    rule!form2(
    variable3:local!variable3,
    variable4:local!variable4
    )
    }
    )
    )

    ----End of Main Form-----


    ---- Within Form 1----- inputs: ri!variable1, ri!variable2
    a!sectionLayout(
    firstColumnContents:{
    a!textField(
    value:ri!variable1
    ),
    a!paragraphField(
    value:ri!variable2
    )
    }
    )
    ---End of Form 1 (The same would be for Form 2) -----

    If the local variables aren't doing anything heavy (such as nested queries that retrieve several rows), then this approach is fine, otherwise, for performance, I would at least parse out "when" these local variables are declared/initialized within the main form & don't forget to use with() wherever needed (for refreshing data purposes).
Children
No Data