- This topic has 2 replies, 1 voice, and was last updated 19 years, 9 months ago by Anneke.
-
AuthorPosts
-
AnnekeMemberHi,
I’m developping a website with Java Server Faces.
I’ve a problem with JavaScript.
I have a table, and each row of that table, has a button, to display more information about that specific row. I want to display this information in a new window. For this I want to use JavaScript.
The new window, of course, needs some information of the other window, to show the right data.
The first time I click the ‘more-information-button’, it works perfectly, but from than on, he keeps showing the same information…
Here is my jsp-page of the first page (the one with the table):
<?xml version="1.0" encoding="UTF-8"?> <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page"> <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/> <f:view> <f:loadBundle basename="languages.MessageBundle" var="bundle"/> <html> <head> <meta content="no-cache" http-equiv="Cache-Control"/> <meta content="no-cache" http-equiv="Pragma"/> <title>- UCV-Period -</title> <link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/> </head> <body style="-rave-layout: grid"> <h:dataTable binding="#{UcvPeriod.dataTable1}" headerClass="list-header" id="dataTable1" rowClasses="list-row-even,list-row-odd" rows="5" style="left: 24px; top: 168px; position: absolute" value="#{UcvPeriod.dataTable1Model}" var="currentRow"> <h:column binding="#{UcvPeriod.column1}" id="column1"> <h:outputText binding="#{UcvPeriod.outputUcvPeriod}" id="outputUcvPeriod" value="#{currentRow['UCVPERIOD']}"/> <f:facet name="header"> <h:outputText binding="#{UcvPeriod.outputText2}" id="outputText2" value="#{bundle.ucvPeriod_columnHeader_ucvPeriod}"/> </f:facet> </h:column> <h:column binding="#{UcvPeriod.column11}" id="column11"> <h:commandButton action="#{UcvPeriod.btnDetails_action}" binding="#{UcvPeriod.btnDetails}" id="btnDetails" value="+"/> <f:facet name="header"> <h:outputText binding="#{UcvPeriod.outputText21}" id="outputText21" value=""/> </f:facet> </h:column> </h:dataTable> </h:form> </body> </html> </f:view> </jsp:root>
Here is my action, when someone clicks on the ‘more-information-button’:
public String bthnDetails_action() { Object s = outputUcvPeriod.getValue(); BigDecimal ucvPeriod = (BigDecimal)outputUcvPeriod.getValue(); this.getSessionBean().setUcvPeriod(new Integer(ucvPeriod.intValue()); return "detail_ucvperiod"; }
Here is my constructor of the Detailspage.
public IsoMessage() { this.txtUcvPeriod.setValue(this.getSessionBean().getUcvPeriod()); }
Here is the navigation part for this part of my faces-config.xml .
<navigation-rule> <from-view-id>/UcvPeriod.jsp</from-view-id> <navigation-case> <from-outcome>detail_ucvperiod</from-outcome> <to-view-id>/Details.jsp</to-view-id> </navigation-case> </navigation-rule>
Thx a lot….
Anneke
AnnekeMemberHi,
I’ve seen that there are was an error in my code.
<h:commandButton action="#{UcvPeriod.btnDetails_action}" binding="#{UcvPeriod.btnDetails}" id="btnDetails" value="+" onclick="window.open(Details.jsp)"/>
Thx
Anneke
AnnekeMemberHi,
I’ve seen that you closed my topic. But the error I posted here, didn’t solve my problem.. So is it possible to reopen it?
Thx a lot
Anneke
-
AuthorPosts