具有3个实体的依赖关系的主细节导航

时间:2016-07-27 11:33:09

标签: navigation sapui5 master detail

我使用主详细信息模板构建了一个应用程序。 Normaly你在两个实体之间导航。例如存储类型(母版页)和所属数量(详细信息页面)。我的问题是,存储类型取决于仓库号,这在我的情况下是固定的。 导航到详细信息页面需要2个关键ID。给出了存储类型,但我的仓库编号的值为" null"但应该是" Y01"。如何在我的代码中手动分配仓库编号或更好地在哪里找到此参数?

RequestPayload

- batch_3d6f-76ed-a97a 内容类型:application / http 内容传输编码:二进制

获取LagertypSet(Lgnum = null,Lgtyp =' D41')HTTP / 1.1

sap-contextid-accept:header 接受:application / json 接受语言:de-DE DataServiceVersion:2.0 MaxDataServiceVersion:2.0 x-csrf-token:Uae5fDde8SUoJexmuZEsug ==

- batch_3d6f-76ed-a97a -

亲切的问候, 菲利克斯

1 个答案:

答案 0 :(得分:0)

就像一个小小的开头小说:通常一个很好的做法是不对代码中的仓库编号进行硬编码,而是从某个配置表中获取它,无论是在您的应用程序中,还是从后端更好(例如用户参数?)

无论如何,秘密存在于createKey方法中,它可能是您生成的代码的一部分? createKey根据您传递的参数和服务的元模型构造部分// bind the alamofire backgroundCompletionHandler func application(application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: () -> Void) { // NSLog("handle events for background: \(identifier)") if identifier == SyncMangerIdentifier{ SyncManager.instance.backgroundCompletionHandler = completionHandler } } // Identifier for long running background task for SyncManager class var backgroundSyncTask: UIBackgroundTaskIdentifier? // Call this at the beginning of syncing func beginBackgroundSyncTask() { backgroundRestoreTask = UIApplication.sharedApplication().beginBackgroundTaskWithExpirationHandler({ self.endBackgroundRestoreTask() }) } // Call this when syncing process ends func endBackgroundSyncTask() { guard backgroundSyncTask != nil else { return } UIApplication.sharedApplication().endBackgroundTask(self.backgroundSyncTask!) self.backgroundSyncTask = UIBackgroundTaskInvalid } 。在您的情况下,这应该是:

LagertypSet(Lgnum=null,Lgtyp='D41')

Lgnum不应该再指向null的变量,而应指向包含var key = createKey("/LagertypeSet", { Lgnum: somethingThatsNull, Lgtyp: keyFromMaster }); 的变量。 E.g:

Y01

我希望通过这些指针,您将能够改进您的代码。祝你好运!