Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/EmptyTag/157.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
&引用_“空白”;不适用于Oracle 12c中按钮的TargetFrame属性_Oracle_Oracle Adf_Jdeveloper_Oracle12c - Fatal编程技术网

&引用_“空白”;不适用于Oracle 12c中按钮的TargetFrame属性

&引用_“空白”;不适用于Oracle 12c中按钮的TargetFrame属性,oracle,oracle-adf,jdeveloper,oracle12c,Oracle,Oracle Adf,Jdeveloper,Oracle12c,我看过很多关于如何在浏览器中打开新选项卡/窗口的帖子。大多数人建议为按钮设置属性target=\u blank,我就是这么做的(我使用了TargetFrame=\u blank)。它仍然在同一窗口/选项卡中打开链接。我也尝试过使用一些浏览器,但都给出了相同的结果。我相信这可能是甲骨文12c的问题。对于\u blank建议,我看到的大多数公认答案都早于Oracle 12c。我怎样才能解决这个问题 更新 按钮的来源: <af:button text="report" id="b1" bindi

我看过很多关于如何在浏览器中打开新选项卡/窗口的帖子。大多数人建议为按钮设置属性
target=\u blank
,我就是这么做的(我使用了
TargetFrame=\u blank
)。它仍然在同一窗口/选项卡中打开链接。我也尝试过使用一些浏览器,但都给出了相同的结果。我相信这可能是甲骨文12c的问题。对于
\u blank
建议,我看到的大多数公认答案都早于Oracle 12c。我怎样才能解决这个问题

更新

按钮的来源:

<af:button text="report" id="b1"
binding="#{backingBeanScope.Backing.reportButton}"
action="#{backingBeanScope.Backing.urlConcatenatioinForReporting}"
targetFrame="_blank"
destination="#{backingBeanScope.Backing.URLToDisplayInBrowser}"
windowModalityType="modeless"
useWindow="true"/>
private String URLToDisplayInBrowser; //This has its accessors 

public String urlConcatenatioinForReporting() {
    String URL = "http://localhost:7101/";
    String destination = URL+textToAppendToReportUrl;
    setURLToDisplayInBrowser(destination);

    try {
        FacesContext.getCurrentInstance().getExternalContext().redirect(URLToDisplayInBrowser);
    }catch(IOException e) {
        e.printStackTrace();
    }
    return null;
}

你把事情搞砸了。

我不确定您是否真的需要绑定,但将其保留为完整的
action
actionListener
是没有用的,因为目标属性将被克服。 从文件:

Destinationon—此组件在激活时引用的URI。这是一个 使用操作的替代方法,目标优先 当两者都设置好时


useWindow
windowModality
用于弹出窗口。

现在发生的事情是,首先是按钮从getter读取
destination
的值,现在它是空的,所以
destination
属性被禁用。现在
操作
将开始。在
action
(方法
URLConcatenationInformReporting
)中,您为
目的地设置属性,但是现在不会读取该属性,然后使用以下代码强制外部重定向:
FacesContext.getCurrentInstance().getExternalContext().redirect(URLTodDisplayInBrowser),它将取代。因此,当您按下按钮时,您将在当前选项卡内被重定向到string
URLToDisplayInBrowser

因此,您实际需要做的是:

<af:button text="report" id="b1"
binding="#{backingBeanScope.Backing.reportButton}"
targetFrame="_blank"
destination="#{backingBeanScope.Backing.urlToDisplayInBrowser}"/>

现在它应该可以正常工作了。试试看,然后根据需要修改bean代码。

你能提供这个按钮组件的完整代码吗?@Nagh我刚刚用按钮代码更新了这个问题
// note: properties names should start from lowercase
private String urlToDisplayInBrowser; //This has its accessors 
public String getUrlToDisplayInBrowser(){
  // FIXME: Setting it to some constant for testing purpose
  urlToDisplayInBrowser = "http://www.google.com";
  return urlToDisplayInBrowser;
}