Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Dialog with it's own datasrc has save button disabled when list tab is empty

    Posted Thu February 05, 2026 09:05 AM

    Dialog with it's own datasrc has save button disabled when list tab is empty

    Maximo 7.6.1.3

    I created a dialog on the ASSET application with it's own datasrc. The dialog has three buttons:

    mxevent="save" - Save contents of dialog without closing dialog

    mxevent="dialogok" - Save contents of dialog and close dialog

    mxevent="dialogcancel" - Do not save and close dialog

    All three buttons work fine when there is data on the list tab of the ASSET application. However, the Save button is disabled when there is no data on the list tab. The other two buttons work just fine with an empty list tab.

    How do I enable the Save button when the list tab is empty?

    Can the Save button can be conditionally enabled as soon as data is modified on the dialog?

    <datasrc id="casddatasrc" mboname="ASSET" whereclause="trkmnhst = 'Y' and siteid = (select defsite from maxuser where userid = :user)"/>


    <dialog datasrc="casddatasrc" id="casd" label="CAS" savemode="ONUNLOAD" width="1200">
    <section id="tas_s1">
    <table id="tas_s1_table1" inputmode="readonly" label="Tracked Assets" ondatachange="refreshtable" orderby="isrunning" relationship="CASASSETS">
    <tablebody displayrowsperpage="20" filterable="true" filterexpanded="true" id="tas_s1_table1_tb1">
    <tablecol dataattribute="ASSETNUM" id="tas_s1_table1_tb1_tc1" sigoption="ASSETFLD"/>
    <tablecol dataattribute="ISRUNNING" id="tas_s1_table1_tb1_tc2" label="Up"/>
    <tablecol dataattribute="DESCRIPTION" id="tas_s1_table1_tb1_tc3" label="Description"/>
    <tablecol dataattribute="EQ2" id="tas_s1_table1_tb1_tc4" label="Building"/>
    <tablecol dataattribute="AS61" id="tas_s1_table1_tb1_tc5" label="Local ID"/>
    </tablebody>
    </table>
    </section>
    <buttongroup id="tas_buttons">
    <pushbutton default="true" id="tas_buttons_b1" label="Save" mxevent="save"/>
    <pushbutton default="true" id="tas_buttons_b2" label="Save/Close" mxevent="dialogok"/>
    <pushbutton id="tas_buttons_b3" label="Cancel" mxevent="dialogcancel"/>
    </buttongroup>
    </dialog>



    ------------------------------
    Andrew Jackson
    ------------------------------


  • 2.  RE: Dialog with it's own datasrc has save button disabled when list tab is empty

    Posted Mon February 09, 2026 07:53 AM

    Hi Andrew

    Do you need the relationship on there, or is that doing the same as the whereclause on the datasrc?

    If you do need it, you may need to create a bean script (possible in 7.6.1.3 by enabling a system property), but if not it seems to load with records even when the underlying table doesn't (although this is MAS)

     



    ------------------------------
    Paul Irving
    Innovation Lead
    MACS EU
    ------------------------------



  • 3.  RE: Dialog with it's own datasrc has save button disabled when list tab is empty

    Posted 30 days ago

    The relationship is going to go from the first ASSET found by the where clause on the datasrc to other (looks like) ASSET records.



    ------------------------------
    Blessings,
    Jason Uppenborn
    Sr. Technical Maximo Consultant
    Cohesive
    ------------------------------



  • 4.  RE: Dialog with it's own datasrc has save button disabled when list tab is empty

    Posted 30 days ago

    The save event is being secured by the data bean for MAINRECORD, because you haven't said where else it should be evaluated against. If I was you, I would try adding a sigoptiondatasrc="casddatasrc" attribute to your dialog or data source.

    Also, if your mboname and whereclause for the datasrc are going to find multiple records, you aren't guaranteed which one will be shown in your dialog. Maybe your siteid condition takes care of that because you only have 1 asset with the trkmnhst flag set per site.

    Happy coding! :-)



    ------------------------------
    Blessings,
    Jason Uppenborn
    Sr. Technical Maximo Consultant
    Cohesive
    ------------------------------



  • 5.  RE: Dialog with it's own datasrc has save button disabled when list tab is empty

    Posted 29 days ago

    Thank you for the suggestions.

    1. The where clause on the datasrc was indeed the same as the relationship. I require the where clause to guarantee that the current user is not restricted from updating the table on the dialog. Perhaps I could use a dummy non-persistent object with the same relationship?
    2. Adding the sigoptiondatasrc="casddatasrc" to the dialog made no difference.
    3. Adding the sigoptiondatasrc="casddatasrc" to the data source made no difference.
    4. Adding the sigoptiondatasrc="casddatasrc" to the save button made no difference.

    The save button appears to be tied to the MAINRECORD and I am unable to change it's datasource. Perhaps I should not be using mxevent="save" with alternate datasrc?



    ------------------------------
    Andrew Jackson
    ------------------------------