我想动态加载片段并拥有以下XML-View:
Uncaught (in promise) Error: resource {= ${/BOOL_VALUE} === 'true' ? 'view/fragment1' : 'view/fragment2'}.fragment.xml could not be loaded from https://sapui5.hana.ondemand.com/1.44.14/resources/{= ${/BOOL_VALUE} === 'true' ? 'view/fragment1' : 'view/fragment2'}.fragment.xml. Check for 'file not found' or parse errors. Reason: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://sapui5.hana.ondemand.com/1.44.14/resources/%7B=%20$%7B/BOOL_VALUE%7…'true'%20?%20%27view/fragment1%27%20:%20%27view/fragment2%27}.fragment.xml'.
at Object.error (jquery.sap.global-dbg.js:4573)
at p (jquery-dbg.js:3187)
at Object.fireWith [as rejectWith] (jquery-dbg.js:3317)
at h3 (jquery-dbg.js:8787)
at Function.ajax (jquery-dbg.js:8689)
at Object.q.sap.loadResource (jquery.sap.global-dbg.js:4564)
at Object.X.loadTemplate (XMLTemplateProcessor-dbg.js:64)
at constructor.init (Fragment-dbg.js:469)
at constructor.F._initCompositeSupport (Fragment-dbg.js:135)
at ManagedObject-dbg.js:427
但不知何故,当我加载它时,fragmentName中的表达式不会被评估,并且比较被视为文件名:
import sys
def hello(a, b):
print "hello and that's your sum:"
sum = a+b
print sum
if __name__== "__main__":
hello(int(sys.argv[1]), int(sys.argv[2]))
我在这里做错了什么?
答案 0 :(得分:0)
我认为您不能对属性' fragmentName'使用表达式绑定,就像您不能使用' id'或者' class'你应该使用格式化函数。