-
1. Re: Issue with JSF <f:view> tag
ssilvert Mar 9, 2007 2:43 PM (in response to vaalati)You need to extend MyFacesGenericPortlet instead.
See http://wiki.apache.org/myfaces/Using_Portlets
Stan
http://jsf.jboss.org -
2. Re: Issue with JSF <f:view> tag
vaalati Mar 9, 2007 3:19 PM (in response to vaalati)Hi Stan,
Thanks for help. Actually I had figured that out the hard way just a while ago before I received your reply.
But now I ran into another issue. I wrote a JSF code in which I have a text-field (<h:inputText>) and I want to access the value entered in it in my portlet class which I wrote extending the MyFacesGenericPortlet. So how do I access it?s value? Usually in Servlets we can do this by using the request.getParameter(). Below is my code in which I have the text-field (<h:inputText>). Now how do I access it?s value in my portlet class?
-----------------------------------------------------------------
<%@ page language="java" session="true" %>
<%@ page import = "javax.portlet.PortletSession" %>
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portlet" %>
<f:loadBundle basename="altair.adm.login.messages" var="msg"/>
<portlet:defineObjects/>
<portlet:actionURL var="loginAction">
<portlet:param name="command" value="doLogin" />
</portlet:actionURL>
ADM Login
<f:view>
<h:form>
<h:panelGrid columns="2">
<h:outputText value="#{msg.user_id_tag}" />
<h:inputText value="" required="true" id="ADM_USER_ID" />
<h:commandButton action="#{loginAction}"
value="#{msg.login_button_tag}" id="ADM_LOGIN_BUTTON"/>
</h:panelGrid>
</h:form>
</f:view>
-----------------------------------------------------------------
Thanks,
Vijay -
3. Re: Issue with JSF <f:view> tag
ssilvert Mar 9, 2007 3:23 PM (in response to vaalati)portletRequest.getParameter()
-
4. Re: Issue with JSF <f:view> tag
vaalati Mar 9, 2007 3:31 PM (in response to vaalati)Hi Stan,
Are you saying that if I have the below form element:
<h:inputText value="" required="true" id="ADM_USER_ID" />
Then I can access the above field value in my portlet's doView() method (which extends MyFacesGenericPortlet) using renderRequest.getParameter(paramName) ?
If that is so, then getParameter(paramName) accepts the name of the field and not the ID of the field, right? Then in the above code I do not have a name for the field but I have an ID. So how do I access it's value now? Is there some thing more that I need to do?
Please help.
Thanks much,
Vijay -
5. Re: Issue with JSF <f:view> tag
ssilvert Mar 9, 2007 4:46 PM (in response to vaalati)If you have also given the surrounding form an id then the param name will be something like "formid:ADM_USER_ID". If not, JSF will make up its own id.
Stan -
6. Re: Issue with JSF <f:view> tag
ssilvert Mar 9, 2007 4:48 PM (in response to vaalati)BTW, doing this inside portlet code is not the recommended way to access the param. You should do it inside the JSF framework if possible.
Stan
http://jsf.jboss.com -
7. Re: Issue with JSF <f:view> tag
vaalati Mar 9, 2007 6:49 PM (in response to vaalati)Hi Stan,
I tried the following ways but could not succeed:
1)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("vijay_form:ADM_USER_ID");
2) ((PortletRequest)request).getParameter("vijay_form:ADM_USER_ID");
3) request.getParameter("vijay_form:ADM_USER_ID");
4)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("ADM_USER_ID");
I tried quickly going through the MyFaces link you sent previously. But I could not find (probably I missed a lot..to be read) any help where I could know how to retrieve the value.
But in your previous reply you were mentioning that my approach was not correct. Could you please explain and/or give more details into what should be my approach to retrieve the values.
I really appreciate your time on my issue. I am a beginner and I do not have much help from anyone who might know/worked with JSF before.
Thanks very much,
Vijay -
8. Re: Issue with JSF <f:view> tag
ssilvert Mar 9, 2007 9:49 PM (in response to vaalati)I'm sorry. I don't have time to give you an individual tutorial. There are plenty of good books at the bookstore and good tutorials on line.
Stan -
9. Re: Issue with JSF <f:view> tag
vaalati Mar 12, 2007 12:18 PM (in response to vaalati)Hi Stan,
Instead of JSF, I moved my code to JSP and wrote my portlet extending the GenericPortlet. Now I try to access the request.getParameter() and it still gives me a null return. So what I am thinking here is that is there any setting/configuration that I need to do in JBoss portal/application server and due to which I am having this problem of not being able to access the form parameters using request.getParameter()?
Please help.
Thanks,
Vijay