Doing Master/Slave view with a dataTable in multiframes
Hi,
In one frame, I have the Master view.
In the other frame, I have the Detail view.
In the Master view, is displayed the building list thanks to a dataTable.
When I click on a link in a row of the list, I need to display the detail of the row in the detail view (the other frame).
The problem is that, when I click in a row, the whole list is displayed again in the Detail frame.... why ? I don't the expected detail view.
Here the code of the master view :
<h:form target="bottomRight" >
<h:dataTable value="#{buildingHandler.buildingsModel}" var="building" >
<h:column>
<f:facet name="header">
<h:outputText value="Object id" />
</f:facet>
<h:commandLink action="#{buildingHandler.select}" immediate="false">
<h:outputText value="#{building.objectId}" />
</h:commandLink>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Name" />
</f:facet>
<h:outputText value="#{building.name}" />
</h:column>
</h:dataTable>
</h:form>
Here the code of the detail view :
<f:view>
<h:outputText value="Name :"></h:outputText>
<h:outputText value="#{buildingHandler.currentBuilding.name}"></h:outputText>
<h:outputText value="objectId :"></h:outputText>
<h:outputText value="#{buildingHandler.currentBuilding.objectId}"></h:outputText>
</f:view>
Here the code of the HTML frames
<html>
<head>
<title>simple document</title>
</head>
<frameset cols="20%,80%" rows="450" scrolling="auto">
<frame src="accueilice.iface"></frame>
<frameset rows="50%,50%" rows="225,225" scrolling="auto">
<frame src="buildingTable.jsf" name="upperRight"></frame>
<frame src="buildingDetail.jsf" name="bottomRight"></frame>
</frameset>
<noframes>
<body>
noframes content
</body>
</noframes>
</frameset>
</html>
Thanks for your help !
[2968 byte] By [
kokoricoa] at [2007-11-26 14:50:19]

# 4
Thanks very much but already done ! In fact the probelm becomes that I need now to click several times so as the detail view display the effective clicked link in the row...otherwise the previous selected row is still displayed.
The Javascript code :
<h:form onsubmit="window.setTimeout('top.bottomRight.document.location.reload()',500);">
The backing bean is up to date : it is a session bean which store the selection in a variable when we click on a link in the row.
EDIT : but if I use this trick with dataTable built-in component with ADF Faces, this trick doesn't work and the result obtains keep unchanged (whole list displayed in the detail view). I deduce that I am going to use pure JSF and coding my own component :/ (dataTable with sort, edition, multi selection, etc... isn't it ?
Message was edited by:
kokorico
# 6
Thanks for your advice. I tried this code :
<h:form onsubmit="window.setTimeout('top.bottomRight.document.location.reload()',750);">
<h:dataTable value="#{buildingHandler.buildingsModel}" var="building"
rows="#{buildingHandler.noOfRows}"
first="#{buildingHandler.firstRowIndex}">
<h:column>
<f:facet name="header">
<h:outputText value="Object id" />
</f:facet>
<h:outputLink target="bottomRight">
<h:outputText value="#{building.objectId}" />
<f:param value="#{building.objectId}" name="buildingParam"
binding="#{buildingHandler.buildingParam}" />
</h:outputLink>
</h:column>
So a backing bean get the value of the IUParameter component (from f:param tag) and then set the current building in the backing bean. Putting the target attribute to the f:outputLink tag provokes the same problem : the master list is displayed in the detail view (or frame). I'am afraid that javascript is the only one solution I know to make things working (putting a good timing make the application work).