Maximo

Maximo

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

 View Only
  • 1.  Hide Table in a Dialogue and display only a section

    Posted 04/27/26 08:33 AM

    Hello, I have a requirement to filter assets based on other dependent tables. I have code ready with me. I would need a small help to hide table and display only section that uses datasrc from table. 

    Here is the UI and code in backend. 



    <table id="assetsearch_1" beanclass="psdi.webclient.beans.assetcat.SearchAttributeQbeBean" label="AND/OR" mboname="SEARCHATTRIBUTE" >
    <tablebody id="and_or_1">
    <tablecol dataattribute="REE_ANDOR" id="and_or1" label="And Or" lookup="valuelistwithvalueonly" width = "70"/>
    </tablebody>
    </table>
    <section datasrc="assetsearch_1" id="ree_assettypeheader1">
    <combobox dataattribute="REE_ANDOR" id="h11" label="And/OR" lookup="valuelistwithvalueonly"/>
    </section>
    I would like to hide table, the table row is getting created through script written on DATABEAN.assetdialogue.
    -------------------------------------------------------------------------------------------------------------------------------------------
    def initialize (ctx):
        
        wcs = ctx.webclientsession()
        app = wcs.getCurrentApp()        
        AndOr1 = app.getDataBean("assetsearch_1")
        Set1 = AndOr1.getMboSet()
        if Set1.isEmpty():
            Set1.add()


    ------------------------------
    Pavan Uppalanchu
    ------------------------------


  • 2.  RE: Hide Table in a Dialogue and display only a section

    Posted 04/28/26 04:18 PM

    Hi Pavan,

    Looking only at the technical question, you may want to check the allowed attributes for the table element in the Maximo presentation XML schema:

    /opt/IBM/SMP/maximo/applications/maximo/properties/presentation.xsd

    In this case, it should be possible to hide the table by adding display="false". For example,

    <table id="assetsearch_1" beanclass="psdi.webclient.beans.assetcat.SearchAttributeQbeBean" label="AND/OR" mboname="SEARCHATTRIBUTE" display="false">

    If you need more control over the UI behavior, you can also use custom CSS via the style or cssclass attributes. The relevant attributes in the schema are:

    <xsd:attribute default="true" name="display" type="xsd:boolean"/>

    <xsd:attribute name="cssclass" type="xsd:string"/>

    <xsd:attribute name="style" type="xsd:string"/>

    Please try display="false" first and let me know if that works.



    ------------------------------
    Ivan Lagunov
    Manager Technology - Europe
    Naviam (formerly ZNAPZ)
    ------------------------------



  • 3.  RE: Hide Table in a Dialogue and display only a section

    Posted 04/29/26 01:29 PM

    Ivan Lagunov Thank you for the response. 

    I tried with datasrc and it's working. The table is not displayed. Also, I even tried with display = "false", this approach is also working. 

    <datasrc beanclass="psdi.webclient.beans.assetcat.SearchAttributeQbeBean" id="assetsearch_1" mboname="SEARCHATTRIBUTE"/>

    Now, I tried getting data input by user in a AND/OR section. I could not succeed. can you please help me?

    <section datasrc="assetsearch_1" id="ree_assettypeheader1">
    <combobox dataattribute="REE_ANDOR" id="h11" label="And/OR" lookup="valuelistwithvalueonly" mxevent="ree_capture_andor" inputmode = 'default'/>
    </section>
    <buttongroup id="ree_SEARCHATTR__2">
    <pushbutton id="ree_SEARCHATTR_2_3" label="Cancel" mxevent="dialogcancel"/>
    <pushbutton id="ree_AttributeSearch_Factors_Drivers_table_btn3" label="Find" mxevent="ree_Filtergaps_bean"/>
    </buttongroup>
    </dialog>
    My code is written on DATABEAN.ASSET with function - ree_Filtergaps_bean. and beanid = 'REE_SEARCHATTR' which is dialogue ID.
    def initialize (ctx):
        wcs = ctx.webclientsession()
        app = wcs.getCurrentApp()       
        AndOr1 = app.getDataBean("assetsearch_1")
        Set1 = AndOr1.getMboSet()
        if Set1.isEmpty():
            Set1.add()

    def ree_Filtergaps_bean(ctx):
        # 1. Initialize UI and App Beans
        wcs = ctx.webclientsession()
        app = wcs.getCurrentApp()
        
    How do I get data input in a section reference with datasrc = 'assetsearch_1'


    ------------------------------
    Pavan Uppalanchu
    ------------------------------



  • 4.  RE: Hide Table in a Dialogue and display only a section

    Posted 04/29/26 04:58 PM

    Hi Pavan,

    I have not tested this specific case, but I would expect the selected value to be stored on the current MBO of the assetsearch_1 data bean. So I would first test whether the selected value is visible here when the Find button is clicked:

    service.log(app.getDataBean("assetsearch_1").getString("REE_ANDOR"))

    If this logs the selected value, you can use the same call in your filtering logic. If it logs blank, then I would check whether assetsearch_1 has a current MBO row before the button event runs.

    Please let me know if that works.



    ------------------------------
    Ivan Lagunov
    Manager Technology - Europe
    Naviam (formerly ZNAPZ)
    ------------------------------



  • 5.  RE: Hide Table in a Dialogue and display only a section

    Posted 04/30/26 01:28 AM

    Hello Ivan, Ivan Lagunov I tried this, getting blank value in logs/error mesage.no luck.  I am guessing there is no link between datascr and section col. not sure. 



    ------------------------------
    Pavan Uppalanchu
    ------------------------------