cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with empty date fields in Smarttable

MaxThs
Discoverer
0 Kudos
129

Hi all,

I am trying to display a table with start/enddate and start/endtime in an Smarttable. Unfortunately it is possible that the enddate and the endtime are not set yet. In this case the fields are empty.

The Smarttable is not showing any data whatsoever. Not even other rows with filled enddate/endtime. As soon as i dont display the fields it shows everything again.

The app is a Fiori Elements app with a custompage, where the smartable is implemented. It contains the ChildEntities of the Main Project.

<f:DynamicPage id="dynamicPage" fitContent="true">
                    <f:header>
                        <f:DynamicPageHeader>
                            <bar:SmartFilterBar
                                id="smartFilterBar"
                                entitySet="EntitySet">
                                <bar:controlConfiguration>
                                    <bar:ControlConfiguration
                                        key="StartDate"
                                        visibleInAdvancedArea="true"
                                        conditionType="{
                                            module: 'sap.ui.comp.config.condition.DateRangeType',
                                            defaultOperation: 'TODAY'
                                        }"
                                    />
                                </bar:controlConfiguration> 
                                <bar:layoutData>
                                    <FlexItemData shrinkFactor="0"/>
                                </bar:layoutData> 
                            </bar:SmartFilterBar>
                        </f:DynamicPageHeader>
                    </f:header>
                    <f:content > 
                        <smartTable:SmartTable
                            id ="SmartTable"
                            entitySet="EntitySet"
                            smartFilterId="smartFilterBar"
                            tableType="ResponsiveTable"
                            enableExport="true"
                            beforeExport="onBeforeExport"
                            useVariantManagement="true"
                            useTablePersonalisation="true"
                            header="{i18n>JournalTable}"
                            showRowCount="true"
                            persistencyKey="SmartTableAnalytical_Explored"
                            enableAutoBinding="true"
                            demandPopin="true"
                            class="sapUiResponsiveContentPadding"
                            enableAutoColumnWidth="true"
                            tableBindingPath="to_Child"
                            beforeRebindTable="onBeforeRebindTable"
                            initiallyVisibleFields="WBSElement,CategoryName,Trade,Workpackage,Workstep,StatusName,Partner,StartDate,StartTime,EndDate,EndTime,PMUser,WorkType,CommentText,Finding,Organisation,WorkRessource,hasAttachments"
                            requestAtLeastFields="ProjectInternalID,HeadID,PositionID"
                        >
                        </smartTable:SmartTable>
                       
                    </f:content>
                </f:DynamicPage>

One solution is to cast the fields into character fields in the cds-View. Then the smarttable has no problems with initial fields. But i have to convert date and time according to the conventions of the User.

Does anyone has a similiar usecase? Do i overlook something simple?

Thank you for your help.

Best Regards Maximilian

View Entire Topic
junwu
SAP Champion
SAP Champion
0 Kudos

what is your backend/odata implementation?

I think you have set the attribute nullable for date field.

MaxThs
Discoverer
0 Kudos
Hey,
MaxThs
Discoverer
0 Kudos
Hey, the Backend is implemented via RAP. But it uses an ODATA V2. Regards Maximilian
junwu
SAP Champion
SAP Champion
0 Kudos
do have any code messing around that date field?