不能在页面模板中使用属性表单?

时间:2013-07-29 13:37:20

标签: jsf oracle-adf jdeveloper

我正在使用JDeveloper 11.1.2.3.0 我必须通过单击页面模板中的链接来显示弹出窗口。为此,我在pageTemplate中创建了一个弹出框,然后插入了一个dialogBox,在对话框中,我从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表单吗? 如果是这样,请给我一个提示,以实现我在第一句中解释的内容。

2 个答案:

答案 0 :(得分:3)

我刚刚找到了解决这个问题的方法。每个页面都有自己的绑定,因此使用模板的页面(或者如果要使用其他页面的绑定)必须在页面绑定的可执行文件部分中声明该页面。新的可执行文件应具有页面的ID(在本例中为模板的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}” - 这有点奇怪但是在这种情况下你不会得到页面绑定并且会得到只有模板。

答案 1 :(得分:0)

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