Maximo

 View Only
  • 1.  Maximo Mobile 8.9 - YORN fields on Add/Edit Sliding Drawers

    Posted Thu May 11, 2023 08:38 PM

    Hello,

    I found you can use a smart-input for a YORN field and it allows you to toggle it but the value does not actually change when you save the record. Also, if your loading an existing record and it has a YORN field that is set to true or 1 then the toggle will always load as false even if you print an alert and can see that the value is really true. 

    It seems like YORN should be supported with the toggle UI component that is part of smart-input based on the Component documentation but I'm having a hard time getting it to work when it comes to actually using the toggle for a YORN field. Is there something special you have to do in the on-change of the smart-input when your dealing with YORN fields? Any advice is appreciated!



    ------------------------------
    Steve
    ------------------------------


  • 2.  RE: Maximo Mobile 8.9 - YORN fields on Add/Edit Sliding Drawers
    Best Answer

    IBM Champion
    Posted Mon May 15, 2023 02:18 AM

    Hi Steve,

    Are you passing the option toggle-type="TrueFalse"?

    You can also use the toggle component instead. Here is an example:

     <toggle toggle-label-off="No" toggle-label-on="Yes" toggled="{ds.item.yourfield}" type="TrueFalse"/>


    ------------------------------
    Maycon Belfort
    Consultant
    BPD Zenith
    Melbourne
    Australia
    ------------------------------



  • 3.  RE: Maximo Mobile 8.9 - YORN fields on Add/Edit Sliding Drawers

    Posted Tue May 16, 2023 09:15 AM

    Maycon,

    This was very helpful. Thank you for your response!

    I was able to get it working by using your suggestion along with the line of JavaScript when editing an existing record. I did have to add the "label" property to your line of code as well since it is a required property.

    <toggle toggle-label-off="No" toggle-label-on="Yes" toggled="{ds.item.yourfield}" type="TrueFalse" label="Shallow"/>

    JavaScript to set the value when editing an existing record:

    ds.item['shallow'] = evt.item.shallow;


    ------------------------------
    Steve
    ------------------------------