Double Click Issue Fix:

In Design Studio we often make use of Cross Tab Component to analyze data and we have an “on select” event on this Cross Tab Component where we can write a script to control the user interaction.

Example: User opens an application and this is what he sees initially

DS1.png

Now if the user clicks on a selection i.e on “Preplacement Deferrals” he can jump to its details with the below script

DS_1.setFilter(“ZSERSTYP”, CROSSTAB_1.getSelectedMember(“ZSERSTYP”).internalKey);

  1. PAGEBOOK.setSelectedPageByName(“XYZ”);

This works fine… and below is the output

DS1.GIF

But what if the user clicks twice??

The same detail report shown above would open first and then a wheel would spin and get you unwanted data as shown in the below respective screen shots.

DS1.GIF

The reason for this sporadic behavior of the application is the script which we have written on the “on select” event of the cross tab and this needs to be optimized further!

Below is the script to fix the issue:

var servicetype=CROSSTAB_1.getSelectedMember(“ZSERSTYP”).text;

if ((servicetype==))    

       {}

       else

{

  1. DS.setFilter(“ZSERSTYP”, CROSSTAB_1.getSelectedMember(“ZSERSTYP”).internalKey);
  2. PAGEBOOK.setSelectedPageByName(“OPEN_SERVICE_DETAILS”);

HEADER_TITLE.setVisible(false);

}

Here, I added an additional condition using a variable in a “if else” statement so that application doesn’t react to the number of clicks and remain stable!

Kind Regards,

Ashwin

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Nithyanandam Venu

    Hi Ashwin,

    From my understanding, why don’t you declare a global variable and calculate  the number of clicks in the Onclick event. And try to process it only for the first click and not for the second click.

    Correct me, if i misunderstood something here.

    Thanks,
    Nithyanandam

    (0) 
    1. Mustafa Bensan

      Hi Nithyanandam,

      Counting the number of clicks won’t resolve the issue in this case because the user could perform the second click on another row, in which case you would want to perform the filtering.  I guess you could also check if the dimension member value has changed but I think the if then check Ashwin has proposed is a cleaner approach.

      Regards,

      Mustafa.

      (0) 
  2. Mustafa Bensan

    Hi Ashwin,

    Just to add further commentary for clarification: when a user double-clicks on a Crosstab row, what is actually happening is that the row is deselected.  In this situation, you will find that CROSSTAB_1.getSelectedMember(“ZSERSTYP”).internalKey returns a value of “(ALL_MEMBERS)”.  The reason for the “spinning wheel” is that in this case the filter DS_1.setFilter(“ZSERSTYP”, CROSSTAB_1.getSelectedMember(“ZSERSTYP”).internalKey) returns the entire data set because “(ALL_MEMBERS)” is not a valid filter value.

    You can also code the if condition as follows:

    var servicetype=CROSSTAB_1.getSelectedMember(“ZSERSTYP”).internalKey;

    if ((servicetype !=“(ALL_MEMBERS)”))   

    {

    1. DS.setFilter(“ZSERSTYP”, servicetype);
    2. PAGEBOOK.setSelectedPageByName(“OPEN_SERVICE_DETAILS”);

    HEADER_TITLE.setVisible(false);

    }

    Another example of this issue is described in the post Crosstab – Deselection of Selected row displaying the value in text box.

    Personally, I would like to see an “Always Selected” interactivity Selection Type enhancement for the Crosstab to cover scenarios such as this to prevent deselection.

    Regards,

    Mustafa.

    (0) 
    1. Ashwin S Post author

      Hi Mustafa,

      Thank you for your insight and detail explaination on the issue and what is causing it.

      I would definitely try the approach you have suggested here..



      Kind Regards,

      Ashwin

      (0) 

Leave a Reply