Field value getting blank

Hi ,

Below code is displaying value in case of flag is true but in case of false it is keeping that field blank.

I don't want to keep that field blank , it should not change on click of any button.

a!paragraphField( label: "Test",
value: if(rule!APN_isBlank(local!tempFlag),"","Hello to all"),
disabled: if(rule!APN_isBlank(local!tempChangeFlag),false,true)
)

Regards

Saurav

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I'm not sure what your use case is or what you're asking.  What is the data type of local!tempFlag - boolean?  Something else?  Are you saying the field is displaying different things after some button is clicked?  If that's what you meant, then what is the configuration of your button?  In general I think you need to provide more detail before we can give a useful answer.

  • load(
      local!pagingInfo:a!pagingInfo(startIndex: 1,batchSize: 12),
      local!gridSelection: a!gridSelection(pagingInfo: local!pagingInfo),
      local!tempFlag,
      local!hello,
     
    
     
      with(    
        a!formLayout(
          label: "",
          contents: {
            
              a!sectionLayout(
                label:"Hello",
    			    contents: {
                  a!columnsLayout(
                    columns: {
                      a!columnLayout(
                        contents: {
                       
                          a!paragraphField(
                            label: "Test",
                            value: if(rule!APN_isBlank(local!tempFlag),"","Hello to all"),
                            disabled: if(rule!APN_isBlank(local!tempFlag),false,true),
                            saveInto: local!hello
    						            
                          ),
                            
                           a!checkboxField(
                              label: "Hello to all",  
                              choiceLabels: "Yes",
                              choiceValues: 1,                           
                              value: local!tempFlag,
                              saveInto: 
                              {
                                local!tempFlag, if(not(rule!APN_isBlank(local!tempFlag)),a!save(
                                  "Hello to all"),{}) 
                                }
                             
                        )})})})})
    ))

    Plz find code snippet. I know its always easy to answer on full code snippet but sometime we do have limitation to share the code. So we tried always to share minimal code. Anyways i have cut down my code n attached here. Issue is whenever i click on any filed or even anywhere on screen value in the parahraph is getting null. I know this is becaue of value field condition. But i need that requirement also. On click of checkbox that text should be display.Kindly provide any solution on this.

  • +1
    Certified Lead Developer
    in reply to sauravk

    load(
    local!pagingInfo:a!pagingInfo(startIndex: 1,batchSize: 12),
    local!gridSelection: a!gridSelection(pagingInfo: local!pagingInfo),
    local!tempFlag,
    local!hello,

    with(
    a!formLayout(
    label: "",
    contents: {

    a!sectionLayout(
    label:"Hello",
    contents: {
    a!columnsLayout(
    columns: {
    a!columnLayout(
    contents: {

    a!paragraphField(
    label: "Test",
    value: local!hello,
    disabled: if(rule!APN_isBlank(local!tempFlag),false,true),
    saveInto: local!hello

    ),

    a!checkboxField(
    label: "Hello to all",
    choiceLabels: "Yes",
    choiceValues: 1,
    value: local!tempFlag,
    saveInto:
    {
    local!tempFlag, if(not(rule!APN_isBlank(local!tempFlag)),a!save(local!hello,
    "Hello to all"),{})
    }

    )})})})})
    ))

  • Thanks a lot men.

    Please if possible share what was the issue. How save event is displaying field value ?

  • 0
    Certified Lead Developer
    in reply to sauravk

    The issue appears to be that you're not using a!checkboxField correctly. 

    In your code snippet, you're basing the value of your checkboxField on local!tempFlag while your choiceValues value was just 1, while at the same time the saveInto of the checkbox field was attempting to save a string value into the same field.  The checkboxField is supposed to only store the value(s) seen in the choiceValues array, and will only appear as checked when the value of the value parameter matches what's seen in choiceValues.

Reply Children
No Data