Skip to Content
0

Model in ViewSettingsDialog not saving values when closing (Dialog however works)

Dec 13, 2016 at 02:37 PM

50

avatar image

Hello Experts,

I'm having problem using ViewSettingsDialog with a custom tab.

Attched two fragments of settings dialog.

The 1st is using ViewSettingsDialog and the 2nd is using "simple" sap.m.Dialog.

Both fragments are bound to a global named model - 'searchDocMaterialModel' which is set from the opening view).
The ViewSettingsDialog loses the values when closing it but the simple dialog doesn't.

I tried to set the model on view level like mentioned in this link:
https://help.sap.com/saphelp_uiaddon10/helpdata/en/ae/b86c181b9742a2bf88049abf9ccb95/content.htm
But only global works in my case (the method described in the link works for Desktop but causes mobile browser to hang)

I want to make the ViewSettingsDialog work and I'm guessing I'm having a problem in the fragment xml file.

SAPUI5 version is 1.38 (I also tried with 1.42 - same behaviour)

How can I make it work?

Also, ViewSettingsDialog takes full screen on mobile app and sap.m.Dialog takes MOST of the screen but not all of it.
How can I resize the Dialog so it'll use full screen like ViewSettingsDialog?

Regards,
Omri

<core:FragmentDefinition
        xmlns="sap.m"
        xmlns:core="sap.ui.core">
    <Dialog
            title="Filter"
            confirm="handleFilter">
            <beginButton>
                         <Button text="OK" press="handleFilter" />
                </beginButton>
        
                    <endButton>
                    <Button text="Cancel" press="onCloseFilter" />
                    </endButton>
                    
                 <content>
                    <Panel>
                        <content>
                            <Label text="P1" design="Bold" />
                            <Input showValueHelp="true" valueHelpRequest="onSiteSearchHelp"  value="{searchDocMaterialModel>/storageSite}" />
                            
                            <Label text="P2" design="Bold" />
                            <Input value="{searchDocMaterialModel>/docNumber}" />
                            
                            <Label text="P3" design="Bold" />
                            <DatePicker value="{searchDocMaterialModel>/docDate}"
                                    displayFormat="dd/MM/yyyy" valueFormat="yyyyMMdd" placeholder=""></DatePicker>
                            
                            <Label text="P4" design="Bold" />
                            <Input value="{searchDocMaterialModel>/ref}" />
                            
                            <Label text="P5" design="Bold" />
                            <Input value="{searchDocMaterialModel>/track}" />
                        </content>
                    </Panel>
            </content>
            
    </Dialog>
</core:FragmentDefinition>
<core:FragmentDefinition
        xmlns="sap.m"
        xmlns:core="sap.ui.core">
    <ViewSettingsDialog
            title="Filter"
            confirm="handleFilter">
         
         <customTabs>
            <ViewSettingsCustomTab icon="sap-icon://filter" title="Filter" tooltip="Filter">
                <content>
                    <Panel>
                        <content>
                            <Label text="P1" design="Bold" />
                            <Input showValueHelp="true" valueHelpRequest="onSiteSearchHelp"  value="{searchDocMaterialModel>/storageSite}" />
                            
                            <Label text="P2" design="Bold" />
                            <Input value="{searchDocMaterialModel>/docNumber}" />
                            
                            <Label text="P3" design="Bold" />
                            <DatePicker value="{searchDocMaterialModel>/docDate}"
                                    displayFormat="dd/MM/yyyy" valueFormat="yyyyMMdd" placeholder=""></DatePicker>
                            
                            <Label text="P4" design="Bold" />
                            <Input value="{searchDocMaterialModel>/ref}" />
                            
                            <Label text="P5" design="Bold" />
                            <Input value="{searchDocMaterialModel>/track}" />
                        </content>
                    </Panel>
                </content>
            </ViewSettingsCustomTab>
         </customTabs>
    </ViewSettingsDialog>
</core:FragmentDefinition>
10 |10000 characters needed characters left characters exceeded

For the second question:

How can I resize the Dialog so it'll use full screen like ViewSettingsDialog?

Setting the Dialog's stretch property to true does it

Omri

0
* Please Login or Register to Answer, Follow or Comment.

0 Answers