Tryton - Issues

 

Message45289

Author xar
Recipients
Date 2018-12-12.15:11:09
Content
When a page in a notebook is displayed, if server-side code changes invisibility state to 'true', the page tab is hidden, but its content is not.

EG :
For this piece of view : 
    <notebook colspan="6">
        <page string="Page1" id="id_page1">
            <label name="field1"/><field name="field1"/>
        </page>
        <page string="Page2" id="id_page2">
            <label name="field2"/><field name="field2"/>
        </page>
     </notebook>

And this piece of code asking for invisibility :
    @classmethod
    def view_attributes(cls):
        return super(MyModel, cls).view_attributes() + [
            ('//page[@id="page2"]', 'states', {'invisible': Eval('field0') != 'P',}),
                ]

If 'page2' is displayed, and the conditions asks for hidding, the content div is still displayed

It seems that the content is still marked as active.
Below is the div state that is unchanged before and after the server side code asked for invisibility :
    <div role="tabpanel" class="tab-pane active" id="ui-id-30">
History
Date User Action Args
2018-12-12 15:11:09xarsetmessageid: <1544623869.62.0.110645366552.issue7923@tryton.org>
2018-12-12 15:11:09xarlinkissue7923 messages
2018-12-12 15:11:09xarcreate

Showing 10 items. Show all history (warning: this could be VERY long)