• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

pdk-struts-html:select

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am new to portal area. My current project needs to use struts framework to design a java application as a portlet. The problem I am facing is, I can't pass the selected value of a dropdown box to the next portal page, it kept giving me null.

My jsp looks like:

<%@page contentType="text/html; charset=windows-1252"%>

<%@ taglib uri="/WEB-INF/pdk-struts-html.tld" prefix="html" %>
<html:form action="/portal/TransferPricingSearch.do">
<table>
<tr>
<td>Products and Services</td>
<td>
<html:select property="productServiceStr" size="1">
<html ptionsCollection property="productServiceList" value="value" label="name"/>
</html:select>
</td>
</tr>
<tr>
<td>LID</td>
<td><html:text property="lid" /></td>
</tr>
</table>
<html:submit/>
</html:form>

And my search action who handles submit looks like:

public class TransferPricingSearchAction extends Action
{
Logger logger = Logger.getLogger(this.getClass().getName());

public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
logger.debug("Entering TransferPricingSearchAction");
TransferPricingHomeForm TPHomeForm = (TransferPricingHomeForm)form;
String productServiceStr = TPHomeForm.getProductServiceStr();
String lidStr = TPHomeForm.getLid();
logger.debug("lidStr: " + lidStr);
logger.debug("productServiceStr: " + productServiceStr);
return (mapping.findForward(productServiceStr ));
}
}

Right now, the log file indicates that the value of productServiceStr which is the dropdown always returns null when I try to go to the next portal page. However, the value of lid which uses the html:text tag pass value fine.

Does anyone has similar problems, it seems to me it is the tag problem. But I have no idea how to fix it.


Thanks

Jenni
 
reply
    Bookmark Topic Watch Topic
  • New Topic