#SAIL I'm looking for a way to hide and show certain fields in a

#SAIL

I'm looking for a way to hide and show certain fields in a section but keep getting an error when the if statements return a null because I don't want any of the fields to show up and can not have a blank item present.

"Interface Definition: Expression evaluation error at function a!sectionLayout [line 29]: The contents field on a column layout cannot be a list containing a null. Invalid value at index 1."

What is the best way to handle this?

I have tried doing the complete column into an expression and grab it using a load() but the expression is only returning the first item not any of the others

OriginalPostID-169245

OriginalPostID-169245

  Discussion posts and replies are publicly visible

Parents
  • @brandonc As said by others, the empty lists or null might not work in all the cases as far as my SAIL experience is considered(Atleast it didn't work for us..!). There are two ways to tackle this and this is how we did:

    Approach - 1:
    In place of null or empty list, we do provide a component which is not surfaced to end user. You may opt for this approach if you feel that this hidden component doesn't disturb the layout or alignment in the interface.
    if(
    \t,
    \t{show desired component},
    \t{a!textField(label:"",value:"",readOnly:true)}
    )

    Approach - 2:
    You may opt for this approach if you feel that the Approach - 1 disturbs the layout or alignment in the interface.
    if(
    \t,
    \ta!sectionLayout(
    \ tlabel:"Some Section",
    \ tfirstColumnContents:{
    \ t
    \ t}
    \t),
    \ta!sectionLayout(
    \ tlabel:"Some Section",
    \ tfirstColumnContents:{
    \ t
    \ t}
    \t)
    )
Reply
  • @brandonc As said by others, the empty lists or null might not work in all the cases as far as my SAIL experience is considered(Atleast it didn't work for us..!). There are two ways to tackle this and this is how we did:

    Approach - 1:
    In place of null or empty list, we do provide a component which is not surfaced to end user. You may opt for this approach if you feel that this hidden component doesn't disturb the layout or alignment in the interface.
    if(
    \t,
    \t{show desired component},
    \t{a!textField(label:"",value:"",readOnly:true)}
    )

    Approach - 2:
    You may opt for this approach if you feel that the Approach - 1 disturbs the layout or alignment in the interface.
    if(
    \t,
    \ta!sectionLayout(
    \ tlabel:"Some Section",
    \ tfirstColumnContents:{
    \ t
    \ t}
    \t),
    \ta!sectionLayout(
    \ tlabel:"Some Section",
    \ tfirstColumnContents:{
    \ t
    \ t}
    \t)
    )
Children
No Data