Toggle navigation
Toggle navigation
This project
Loading...
Sign in
grogv3
/
grog-cubi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Francois Leveque
2016-10-20 09:55:49 +0200
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
d6ff1181e5d0fc84c712c59ffd2684f2d578b156
d6ff1181
2 parents
ba28cf03
d45c97cc
Merge branch 'historiqueEditeur' of grogv3.legrog.org:grogv3/web-application into historiqueEditeur
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
src/main/java/org/legrog/presentation/PublisherRevisionView.java
src/main/webapp/publisherRevision.xhtml
src/main/java/org/legrog/presentation/PublisherRevisionView.java
View file @
d6ff118
...
...
@@ -7,17 +7,15 @@ import org.legrog.entities.User;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.enterprise.context.RequestScoped
;
import
javax.faces.view.ViewScoped
;
import
javax.faces.context.FacesContext
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.Map
;
@Named
@ViewScoped
public
class
PublisherRevisionView
{
public
class
PublisherRevisionView
implements
Serializable
{
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
@Inject
...
...
@@ -40,11 +38,18 @@ public class PublisherRevisionView {
private
Timestamp
publisherRevisionDatetime
;
public
void
loadData
()
{
Map
<
String
,
String
>
params
=
FacesContext
.
getCurrentInstance
().
getExternalContext
().
getRequestParameterMap
(
);
logger
.
debug
(
"publisherRevisionId = {}"
,
this
.
publisherRevisionId
);
PublisherRevision
publisherRevision
=
publisherRevisionService
.
getPublisherRevision
(
new
Integer
(
params
.
get
(
"publisherRevisionId"
)));
setPublisherRevisionId
(
publisherRevision
.
getPublisherRevisionId
());
logger
.
info
(
"publisherRevisionId = "
+
getPublisherRevisionId
());
PublisherRevision
publisherRevision
=
publisherRevisionService
.
getPublisherRevision
(
publisherRevisionId
);
logger
.
debug
(
"Found a publisher revision : {}"
,
publisherRevision
.
toString
());
// Map<String,String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
//
// PublisherRevision publisherRevision = publisherRevisionService.getPublisherRevision(new Integer(params.get("publisherRevisionId")));
// setPublisherRevisionId(publisherRevision.getPublisherRevisionId());
// logger.info("publisherRevisionId = " + getPublisherRevisionId());
}
public
int
getPublisherRevisionId
()
{
...
...
src/main/webapp/publisherRevision.xhtml
View file @
d6ff118
...
...
@@ -4,14 +4,23 @@
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:h=
"http://xmlns.jcp.org/jsf/html"
xmlns:ui=
"http://xmlns.jcp.org/jsf/facelets"
xmlns:f=
"http://xmlns.jcp.org/jsf/core"
>
xmlns:f=
"http://xmlns.jcp.org/jsf/core"
xmlns:jsf=
"http://xmlns.jcp.org/jsf"
>
<head>
<f:metadata>
<f:viewParam
name=
"publisherRevisionId"
value=
"#{publisherRevisionView.publisherRevisionId}"
/>
<f:
event
type=
"preRenderView"
listener
=
"#{publisherRevisionView.loadData}"
/>
<f:
viewAction
action
=
"#{publisherRevisionView.loadData}"
/>
</f:metadata>
</head>
<body>
<p>
Depuis le paramètre :
<h:outputText
value=
"#{param['publisherRevisionId']}"
/></p>
<p>
En passant par la vue :
<h:outputText
value=
"#{publisherRevisionView.publisherRevisionId}"
/></p>
<p>
Depuis le paramètre : #{param['publisherRevisionId']}
</p>
<p>
En passant par la vue : #{publisherRevisionView.publisherRevisionId}
</p>
<form
action=
""
jsf:id=
"reload-form"
>
<button
jsf:id=
"reload"
jsf:action=
"#{publisherRevisionView.loadData}"
>
Reload !
</button>
</form>
</body>
</html>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment