Menu

#26 use of f_selectCard

v_1.0_beta_3
open
nobody
5
2007-10-03
2007-10-03
nps2007
No

I am trying to use f_tabbedPane.f_selectCard to enable my page to go to the second tab either on reload or by pressing a button. The example page and javascript I as using follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:v="http://rcfaces.org/core"
xmlns:vh="http://rcfaces.org/html">
<head>
<vh:init title="${titleOfPage}" disableCache="true" disableContextMenu="false" />

<script type="text/javascript">
function setTab()
{
var x=f_core.GetElementById("formId:tabbedPane888Id",document,true)
alert("x="+x+" x.class="+x.className+" x.innerHTML="+x.innerHTML)
var y=f_core.GetElementById("formId:incidentId",document,true)
alert("y="+y+" y.class="+y.className+" y.innerHTML="+y.innerHTML)
var success = x.f_selectTab(y, true)
alert("successfully set tab incident:"+success)
}
</script>

<ui:insert name="head" />
</head>
<body onload="setTab()">
<f:view>
<ui:include src="/all/header.xhtml" />
<h:form id="formId">
<v:tabbedPane id="tabbedPane888Id" textAlignment="right">
<v:tab text="Home" id="homeId" textAlignment="left">
<ui:insert name="homeTabBody">
<p>Default Home</p>
<h:commandButton value="Default Home"></h:commandButton>
</ui:insert>
</v:tab>
<v:tab text="Incidents" id="incidentId" textAlignment="left">
<ui:insert name="incidentTabBody">
<p>Default Incident</p>
<h:commandButton value="Default Incident"></h:commandButton>
</ui:insert>
</v:tab>

<v:tab text="Reports" textAlignment="left">
<ui:insert name="reportTabBody">
<p>Default Report</p>
<h:commandButton value="Default Report"></h:commandButton>
</ui:insert>
</v:tab>

<v:tab text="Search" textAlignment="left">
<ui:insert name="searchTabBody">
<p>Default Search</p>
<h:commandButton value="Default Search"></h:commandButton>
</ui:insert>
</v:tab>

<v:tab text="Preferences" textAlignment="left">
<ui:insert name="preferencesTabBody">
<p>Default Preferences</p>
<h:commandButton value="Default Preferences"></h:commandButton>
</ui:insert>
</v:tab>

<v:tab text="Admin" textAlignment="left">
<ui:insert name="adminTabBody">
<p>Default Admin</p>
<h:commandButton value="Default Admin"></h:commandButton>
</ui:insert>
</v:tab>

</v:tabbedPane>
<!-- <v:selectedCard value="formId:incidentId" /> -->
<h:commandButton value="go to Incident" onclick="setTab()" />
</h:form>
</f:view>
</body>
</html>

Discussion

  • Olivier Oeuillot

    Logged In: YES
    user_id=306652
    Originator: NO

    And what is the problem ?

    Have you a Java/Javascript exception ?

    Regards,

    Olivier.

     
  • nps2007

    nps2007 - 2007-10-05

    Logged In: YES
    user_id=1904910
    Originator: YES

    I get a IE popup with a javascript error of
    "A Runtime Error Has Occurred
    Line:12
    Error:Object doesn't support this property or method."

    I get this one for line#12 2x and then the same error for line#17 2x.
    I am using IE 6.0.
    I see the results from the first 2 alerts and neither object is null.
    I don't see the results from the 3rd alert.
    I don't see the "incident" tab come forward.
    Same errors from the onload and the commandButton.

     
  • nps2007

    nps2007 - 2007-10-05

    Logged In: YES
    user_id=1904910
    Originator: YES

    On Netscape Navigator 9.0
    I get no popup javascript error but in the error console I get

    x.f_selectTab is not a function Line:13

     

Log in to post a comment.

MongoDB Logo MongoDB