Forums de discussion

Not able to navigate to another page on button in jsf portlet

Pravin Gate, modifié il y a 11 années.

Not able to navigate to another page on button in jsf portlet

Junior Member Publications: 57 Date d'inscription: 24/04/12 Publications récentes
I am trying to develop a jsf portlet(primefaces 3.2)

I have created a jsf portlet in which i am displaying a datatable.Inside my datable there is one button.

Now when i will click on that button a jsp page should open. its not working actually.


I am trying to achieve it using this way.

 <div style="text-align:right">
                        <p:lightbox iframe="true" width="1000" height="840">
                            <h:outputlink value="./next.jsp">
                                <p:commandbutton value="Add" icon="ui-icon ui-icon-plusthick" style="margin:3px;display: table-cell;vertical-align: middle;" /> 
                            </h:outputlink>
                        </p:lightbox>
                    </div>


My current portletViewMode.xhtml(portlet display page) and next.jsp are present inside portlet(in xhtml folder).

Its gives me this error.

Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

Please contact the website owners to inform them of this problem.



Please guide me how can I solve this problem
Pravin Gate, modifié il y a 11 années.

RE: Not able to navigate to another page on button in jsf portlet

Junior Member Publications: 57 Date d'inscription: 24/04/12 Publications récentes
If anybody needs more explanation, plz let me know.
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: Not able to navigate to another page on button in jsf portlet

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Do you want the JSP to render inside your JSF portlet, or do you want to redirect to the JSP? Normally Facelet views navigate to other Facelet views. Would it be possible for you to navigate to an XHTML Facelet View instead of a JSP?
Pravin Gate, modifié il y a 11 années.

RE: Not able to navigate to another page on button in jsf portlet

Junior Member Publications: 57 Date d'inscription: 24/04/12 Publications récentes
Yes, exactly I wish to render jsp page insdie my jsf portlet. And after that I should be able to display a jsf form(primefaces 3.2 component), after submitting this form should be able to navigate to other xhtml page which have another form inside it and so on.

Should it be possible in liferay?
How can I do that?
I can do it in plain jsf 2.0 environment easily. But as I am new to liferay , I am not able to do it.

I also tried navigation rules in jsf 2.0 , which are also not working. I might be doing in wrong way also. but plz clear my doubts.

And please provide me some good link if possible for jsf -interportlet communication.
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: Not able to navigate to another page on button in jsf portlet

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Is the JSP page a JSF view? Or is it a non-JSF view that simply renders a fragment of HTML markup?
Pravin Gate, modifié il y a 11 années.

RE: Not able to navigate to another page on button in jsf portlet

Junior Member Publications: 57 Date d'inscription: 24/04/12 Publications récentes
I didn't get you exactly Neil.

Ok,Yes,Its a jsf view(portletViewMode.xhtml) which creates when you create a jsf-portlet . and in that view I have displayed a datatable inside there is a button.

When I 'll click on that button I should be able to navigate to a jsp page which acts as a light box.. So if I close I should be able to see my previous jsf view.

So I am trying to navigate from jsf view to another jsp page on action of a button(which is a jsf component) .

what should I need to do for that?

You have mentioned in reply that should I need that JSP to render inside your JSF portlet, or do you want to redirect to the JSP.

Please consider at your best what will be the best solution for me, as I am trying to grasp liferay.

Waiting for your helpful response.
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: Not able to navigate to another page on button in jsf portlet

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Is there a reason why you must have XHTML (Facelet) views and JSP (Non-Facelet) views in the same portlet? It would be best if you used 100% Facelets.
thumbnail
Konstantin Chudinov, modifié il y a 10 années.

RE: Not able to navigate to another page on button in jsf portlet

New Member Publications: 7 Date d'inscription: 13/01/14 Publications récentes
Hi all. I have similar problem. I need to submit form in JSF portlet, make some action and then dispatch to another page (not in current portlet because i need to change a title of portlet and also open second page from url without first one). Is there any solution for this case?
Thanks in advance
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Not able to navigate to another page on button in jsf portlet

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Typically developers do something like this in the action method:

FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext externalContext = facesContext.getExternalContext();
externalContext.redirect(url);
thumbnail
Konstantin Chudinov, modifié il y a 10 années.

RE: Not able to navigate to another page on button in jsf portlet

New Member Publications: 7 Date d'inscription: 13/01/14 Publications récentes
Thank you so much, Neil!
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Not able to navigate to another page on button in jsf portlet

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
You are very welcome Konstantin. Thanks for using Liferay Faces emoticon