You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Tommaso Nuccio <to...@fwctc.com> on 2006/01/30 10:27:56 UTC

Portlet Action not called from HTML-Form

Hi there,

I have the problem that an action method is not called, "doRefresh()", and I 
don't know why!?

Here is the code of the Action class:
---
    protected void buildNormalContext(Portlet portlet, RunData rundata)
	{
    	rundata.getRequest().setAttribute("Hint", "Build");
	}
	
    protected void doRefresh(RunData rundata, Portlet portlet)
    {
    	rundata.setTitle("Yooooooooooooooooooooooooo!!!!");
    	Spiel = rundata.getRequest().getAttribute("match").toString();
    	rundata.getRequest().setAttribute("Hint", "request is still");

    	if(rundata.getRequest().getAttribute("match").toString() != null)
    	{
        	rundata.getRequest().setAttribute("Hint", "request is 
correct");
        	rundata.getRequest().setAttribute("Spiel", rundata.getRequest
().getAttribute("match"));
        	rundata.getRequest().setAttribute("iSpiel", new Integer
(Integer.parseInt(Spiel)));
    	}
    	else
    	{
        	rundata.getRequest().setAttribute("Hint", "match nicht 
bekommen");    		
    	}
    }
---

The portlet registry:
---
    <portlet-entry name="EZTPortlet (fast)" hidden="false" type="ref" 
parent="JSP" application="false">
        <meta-info>
            <title>EZT Portlet - finale Version</title>
            <description>EZT Report - Public UND Group Sales</description>
            <image></image>
        </meta-info>
        <classname>org.apache.jetspeed.portal.portlets.JspPortlet</classname>
        <parameter name="template" value="EZTPortlet" hidden="true" 
cachedOnName="true" cachedOnValue="true"/>
        <parameter name="action" value="portlets.EZTPortletAction" 
hidden="true" cachedOnName="true" cachedOnValue="true"/>
        <media-type ref="html"/>
        <url cachedOnURL="true"/>
    </portlet-entry>
---
A snippet of the JSP:
---
if(request.getAttribute("match") != null)
{
	iSpiel = Integer.parseInt(data.getRequest().getAttribute
("iSpiel").toString());
	spiel = data.getRequest().getAttribute("Spiel").toString();
	out.write("String: "+ spiel + " Int: "+ iSpiel + "<br>");
}
else
	out.write("String: >"+ spiel + "< Int: >"+ iSpiel + "< <br>");

out.write("Titel= "+ data.getTitle() +" <br> ");
out.write("Hint1: "+ data.getRequest().getAttribute("Hint").toString() 
+"<br>");

//Form zur Spielauswahl
//Form-START
%>
<br>
<TABLE border="0" align='center' bgcolor="black">
<TR>
<TD>
<TABLE border="0" bgcolor="#DDDDDD">
<TR>
<td align='center' bgcolor='#CCCCCC'> EZT Menu </td>
<%
out.write("<form action=\""+jlink.getPortletById(portlet.getID())+"\" 
method=\"post\">");
out.write("<tr><td colspan='8'>");
out.write("<SELECT name=\"match\">");
out.write("<OPTION value=\"0\"> Wählen Sie hier ein Spiel aus: </OPTION>");
out.write("<OPTION value=\"65\"> TOTAL </OPTION>");
for(int i = 1; i < 65;i++)
{
	if(spiel != "")
	{
		if(i == iSpiel)
			out.write("<OPTION selected value=\""+ i +"\">"+ i 
+"</OPTION>");
		else
			out.write("<OPTION value=\""+ i +"\">"+ i 
+"</OPTION>");
	}
	else
	{
		out.write("<OPTION value=\""+ i +"\">"+ i +"</OPTION>");
	}
}
out.write("</SELECT>");
out.write("</td></tr>");
out.write("<tr>");
out.write("<td colspan='8' align='center' bgcolor='#CCCCCC'><INPUT 
TYPE=\"SUBMIT\" NAME=\"eventSubmit_doRefresh()\" VALUE=\"Refresh\"></td>");
out.write("<input type=\"hidden\" name=\"js_peid\" value="+ (String) 
request.getAttribute("js_peid") +">");
out.write("</tr>");
out.write("</form>");
---

The output:
---
Hint: Build
String: >< Int: >0< 
Titel= 
Hint1: Build 
---

As you can see, the attribute "Hint", shows only "build", even though it is 
given a new value "request is correct", in the do Refresh() method. So my idea 
is that doRefresh() is not called! But why? What am I missing.

Many thanks in advance,
  Tommaso


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Portlet Action not called from HTML-Form

Posted by Tommaso Nuccio <to...@fwctc.com>.
Tommaso Nuccio <tommaso.nuccio <at> fwctc.com> writes:

> 
> Hi there,
> 
> I have the problem that an action method is not called, "doRefresh()", and I 
> don't know why!?


Hi community,

I got the problem solved.
It is UNBELIEVABLE!!
Let's see, who also finds it :)

Ciao,
  Tommaso



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org