Maximo

 View Only
  • 1.  yesnocancelexception not working as expected

    Posted 3 days ago
    Edited by Suhas Joshi 3 days ago

    Hi,

    We have written below piece of code in java to handle yesnocancelexception. However, even if I click on yes or no, the value of user input is always coming as -1 and the same yesnocancel pop up comes continuously and does not go away. It is not going in yes or no loop. Any pointers here pls? I have to write this code in java for some other reason and hence not writing any auto script. This code is written in a data bean class.

    int userInput = MXApplicationYesNoCancelException.getUserInput("ABC", MXServer.getMXServer(), mbo.getUserInfo());

    System.out.println("----userInput----:" +userInput);

    switch (userInput)

    {

    case -1:

    throw new MXApplicationYesNoCancelException("ABC", "testgrp", "testkey",params);

    case 16:

    System.out.println("----No Selected ----");

    break;

    case 8:

    System.out.println("----Yes Selected ----");

    break;

    }

    #IBMMaximo

    #IBMMaximoAssetManagement

    #AssetandFacilitiesManagement



    ------------------------------
    Suhas Joshi
    ------------------------------



  • 2.  RE: yesnocancelexception not working as expected

    Posted 2 days ago
    Edited by Sankar Ganesh 2 days ago

    Hi Sunil,

    The value -1 indicates the 'mxevent' value is 'NULL' when you click on the button.
    Could you please share the 'dialog bean xml' or the 'mxevent' linked to the 'Yes' , 'No' Buttons?
    It should be 'dialogok, dialogcancel or dialogclose'

    Here is the list of integer values of mxevents defined in 'MXApplicationYesNoCancelException' class.

    OK = 2;
    CANCEL = 4;
    YES = 8;
    NO = 16;
    NULL = -1;


    Thanks!
    Sankar



    ------------------------------
    Sankar Ganesh
    ------------------------------