Note that there are some explanatory texts on larger screens.

plurals
  1. POJSF 2.0 URL parameter needed on larger scope
    primarykey
    data
    text
    <p>I have found a few good replies to similar content so far, but never something that solves my issue. I am trying to accomplish this in the best manner possible.</p> <p>Within my application (JSF 2.0 running on Glasshfish), I have a list of events (let's call this the EventPage). It is possible to click on each event to then show a page of "results" (ResultPage), showing a list of people who have attended this event.</p> <p>On the EventPage, the link is made as such :</p> <pre><code> &lt;h:link value="#{event.eventName}" outcome="displayResults"&gt; &lt;f:param name="eventCode" value="#{event.eventCode}"/&gt; &lt;/h:link&gt; </code></pre> <p>Then, on the outcome - displayResult, I have code such as this in my backing bean (inspiried by a similar):</p> <pre><code>@ManagedBean @RequestScoped public class DisplayResults { @ManagedProperty(value="#{param.eventCode}") ... </code></pre> <p>This works well. The results are displayed in a Datatable. Now I want the ability to sort them. So I've followed this example : <a href="http://www.mkyong.com/jsf2/jsf-2-datatable-sorting-example/" rel="nofollow">http://www.mkyong.com/jsf2/jsf-2-datatable-sorting-example/</a>.</p> <p>But, once I change the scope of my backing bean to be something else the "request", I can't use the ManagedProperty anymore. And thus am thinking I have to refer to something less elegant such as : </p> <pre><code>public String getPassedParameter() { FacesContext facesContext = FacesContext.getCurrentInstance(); this.passedParameter = (String) facesContext.getExternalContext(). getRequestParameterMap().get("id"); return this.passedParameter; } </code></pre> <p>Aslo reading on this forum I share the opinion that if you have to dig down into the FacesContext, you are probably doing it wrong.</p> <p>SO: 1. Is it possible to sort a Datatable without refreshing the view? Only the datatable in question? 2. Is there another good solution to get the url parameter (or use diffrent means)?</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload