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
JR Utily
2016-10-20 00:38:10 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
Jean-Francois Leveque
2016-11-08 10:01:50 +0100
Commit
9f4550068c55fc74a69d0c24fed660f35722313f
9f455006
1 parent
e15b6e19
fix le load (et reload) des revisions (acces via GET parameters)
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
13 deletions
src/main/java/org/legrog/presentation/PublisherRevisionView.java
src/main/webapp/publisherRevision.xhtml
src/main/java/org/legrog/presentation/PublisherRevisionView.java
View file @
9f45500
...
...
@@ -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.bean.ViewScoped
;
import
javax.faces.context.FacesContext
;
import
javax.faces.view.ViewScoped
;
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 @
9f45500
...
...
@@ -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