How to deal with the slow Appian grid selection validation?

Certified Senior Developer

Hi,

I have a grid based on a RecordType, and I have coded a multi-selection mecanism inside the selectionSaveInto portion code.

When I select a line, some tests are made, but Appian takes 2 seconds to accept the selection (even if I do nothing, just click on a row).

Then I can select or deselect another line.... etc...

All works fine as, I let Appian finishing the work (progression bar is displayed at the top of the screen).

The problem goes when I click quickly on many lines: this creates some bugs.

How may I rid of this issue?  is there any way to toggle enable/disable selection after having selected a row (while Appian is working)?

or is there any way to deactivate the mouse cursor during the Appian progression bar (as we could do with any other language like Java)?

Regards 

  Discussion posts and replies are publicly visible

Parents
  • Can you paste the SAIL code you have? There is an easy way in SAIL to only allow single row selection. Some reasons why the section might be slow:

    1. Your record type is referencing a database view or large table

    2. Your grid is querying extra columns from the database

  • 0
    Certified Senior Developer
    in reply to Danny Verb

    Thank you Danny but I do not need to allow single row selection.
    I have to deal with muli-selection, but each time I select row, I have to wait 2 seconds.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Thanks a lot Mike for your reply, but sorry, your code is great but does not reply to my question.
    I need to know why with my little (of course not optimized) example, I'm succeeding in tricking Appian?

    I've tested your code and the issue is exactly the same here:
    If I select successively (and slowly) these 3 rows : Ford, Volvo, Chevy, all works fine, as the last row can not be selected.

    But... If I select very quickly these 4 rows, the issue is still present (as my picture below).
    The code optimization aspect has nothing to do with that strange behavior.

    Is it an Appian bug?

  • 0
    Certified Senior Developer
    in reply to cedric01

    Hi cedric,
    I see no real reason why it should not work.
    i took your code and created a pretty similar code to test it myself. it is working perfectly in my environment.
    can you check if it is behaving the same way in your environment or do you see any difference which are perhaps important for your question? I didnt see anything major different. (our appian verison is 20.2 on premise

    a!localVariables(
      local!product:{"tape","brush","paint","bucket" },
      local!price: {10,20,20,40},
      local!datasubset: a!datasubset(
        startIndex: 1,
        batchsize: 1,
        data: {
          a!forEach(
            items: local!product,
            expression: {
              product:fv!Item,
              price:index(local!price,fv!Index,null)
            }
          )
        },
        identifiers: {1,2,3,4}
      ),
      local!maxPrice: 40,
      local!selection,
      local!selectedProduct,
      a!sectionLayout(
        contents: {
          a!columnsLayout(
            columns: {
              a!columnLayout(
                contents: {
                  a!cardLayout(
                    contents: {
                      a!gridField(
                        label: "Read-only Grid",
                        labelPosition: "ABOVE",
                        data: local!datasubset.data,
                        columns: {
                          a!gridColumn(
                            label: "product",
                            value: fv!row.product
                          ),
                          a!gridColumn(
                            label: "price",
                            value: fv!row.price
                          ),
                        },
                        selectable: true,
                        selectionStyle: "ROW_HIGHLIGHT",
                        selectionValue: local!selection,
                        selectionSaveInto: {
                          local!selection,
                          a!save(
                            target: local!selectedProduct,
                            value: append(
                              local!selectedProduct, 
                              fv!selectedRows
                            )
                          ),
                          a!save(
                            target:local!selectedProduct, 
                            value: difference(
                              local!selectedProduct, 
                              fv!deselectedRows
                            )
                          ),
    
                          a!localVariables(
                            local!maxValueAccepted: if(
                                not(isnull(local!selectedProduct)),
                                sum(
                                  a!forEach(
                                    items: local!selectedProduct,
                                    expression: fv!item.price
                                  )
                                ),
                                0
                            ),
    
                            if (local!maxValueAccepted > local!maxPrice,
                            {
                              a!save(local!selection, remove(local!selection, length(local!selection))), 
                              a!save(local!selectedProduct, remove(local!selectedProduct, length(local!selectedProduct))),
                            },
                            null
                            )
                          ),
    
                          /*a!save(ri!selectedVehicleIds, local!selection)*/
    
                        },
                        validations: {}
                      )
                    },
                    height: "AUTO",
                    style: "NONE",
                    marginBelow: "STANDARD"
                  ),
    
                }
              ),
              a!columnLayout(
                contents: {}
              )
            }
          ),
          a!paragraphField(
            label:"local!selectedProduct",
            value: local!selectedProduct
          )
        },
        showWhen: true
      )
    )

  • 0
    Certified Senior Developer
    in reply to Richard Michaelis

    Hi Richard,

    Thank you for your reply. Unfortunately, I can confirm that I can reproduce the same issue (please see the picture below).

    To reproduce it, you must select very very quickly the 4 lines 10,20,30,40 (then the fourth line is unselected at the end).

    Another way to reproduce it easier, is to select the 40 row line (so total max is reached), and then click quickly on 2 other lines.

    I can reproduce this issue on 2 different Appian environnments, so I don't think it is linked to my environment.


    Another way to reproduce it easily, is to plug the grid on a RecordType with a big table. 

  • 0
    Certified Senior Developer
    in reply to cedric01

    Hi cedric,
    even if i click super quick, starting by the bottom, it is not going to break in my case. absolutly like expected.
    so perhaps a performance issue in your evironment? Are the loading bar appearing? Can you show your performance stats? perhaps we can get a clue there?

  • Hi Cedric,

    which browser and version are you using?

    //Kai

  • 0
    Certified Senior Developer
    in reply to kais

    Hi Kais,

    I'm using  Chrome 85.0.4183.102 

    @Richard, with Chrome I don't see the loading bar with this little example, it is for this reason I have to click super quick to reproduce it.

    I've just tried with Mozilla, and it's worth... I can see the loading bar, so it is very easily to reproduce.

    Which performance screen do you want to see? (admin console\monitoring...)

    maybe could you try on Mozilla?

  • 0
    Certified Senior Developer
    in reply to cedric01

    okay, then it is really a performance issue and no appian bug. at least one conclusion here.
    at first, lets try the sail performance tab. Then we can check one by one other possible sources, to verify it. 

     in your case its written "performance"


    for comparison reasons: my chrome version is "version 86.0.4240.75 (Official Build) (32-Bit)"

  • 0
    Certified Lead Developer
    in reply to cedric01

    I can reproduce this behavior in Chrome on Appian Cloud.  I'm not sure it's a bug per se - variable evaluation is quick but not guaranteed to be instantaneous.  You might want to just set up validation on the grid to handle cases where someone "super-clicks" the rows.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    you all using cloud, right? I am on premise. 

  • 0
    Certified Senior Developer
    in reply to Richard Michaelis

    Sorry Richard, I should have told you that.

Reply Children
No Data