1

我正在使用 JDeveloper 11.1.2.3.0 我必须通过单击页面模板中的链接来显示一个弹出窗口。为此,我在 pageTemplate 中创建了一个弹出窗口,然后插入了一个对话框,在该对话框中,我从 DataControl 面板中拖放了我的 VO,并将其作为 ADF 表单插入。问题是,当我运行并单击链接(包含“ShowPopupBehavior”)时,我收到此错误:

//C:/Oracle/Middleware/jdeveloper/jdev/system11.1.2.3.39.62.76.1/MyNew/ViewControllerWebApp.war/WEB-INF/templates/myTemplates.jsf @58,118 value="#{bindings.TypeName.inputValue}": Target Unreachable, 'TypeName' returned null
ADF_FACES-60097:For more information, please see the server's error log for an entry beginning with: ADF_FACES-60096:Server Exception during PPR, #2

我可以在此处插入的每个视图都会发生这种情况。这是因为我不允许在页面模板中插入 ADF 表单吗?如果是这样,请给我一个提示,以实现我在第一句话中解释的内容。

4

2 回答 2

3

我只是想出了解决这个问题的方法。每个页面都有自己的绑定,因此使用模板的页面(或者如果想要使用来自其他页面的绑定)必须在页面绑定的可执行文件部分中声明该页面。新的可执行文件应该有页面的 ID(在这种情况下是模板)和页面的路径。然后可以按照此处的说明访问模板的绑定:

public String cb1_action() {
BindingContext bctx = BindingContext.getCurrent();
DCBindingContainer bindings = 
            (DCBindingContainer)bctx.getCurrentBindingsEntry();
//access the page template Pagedef file reference in the 
//Executable section of the consumer page's Pagedef file
DCBindingContainer templateBinding = 
                (DCBindingContainer)bindings.get("ptb1");
//get the MethodBinding 
OperationBinding printMethod = 
    (OperationBinding)templateBinding .get("printThis");
//invoke the print method exposed on the template's PageDef file
printMethod.getParamsMap().put("message","Hello World");
printMethod.execute();
return null;
}

https://blogs.oracle.com/jdevotnharvest/entry/how_to_invoke_adf_bindings

ps:注意不要在你的页面中绑定模板的值 ex: value="#{bindings.ptb1}" - 这有点奇怪,但在这种情况下你不会得到页面绑定,只会得到模板那些。

于 2013-07-30T08:44:30.563 回答
0

应该从 pageTemplate 标记中删除包含 #{bindings.ptb1} 的 value 属性,但 ptb1 引用必须在页面 PageDef 文件中。

于 2017-04-18T18:19:56.097 回答