<c:forEach items="${smsgs }" var="smsg">
           <tr>
           <td>${smsg.content }</td>
           <td>${smsg.sendtime }</td>
           <td><html:button property="detail" value="detail" onclick="openwin();"> </html:button></td>
           </tr>
           </c:forEach>
     想法是点击按钮后弹出窗口显示当前列表项(smsg)的详细信息,smsg的详细信息包括smsg.content, smsg.sendtime, smsg.addrs和smsg.count。需要在弹出窗口函数openwin()中传递smsg的信息。请问该如何传递并显示出来?

解决方案 »

  1.   

    各位高手帮帮忙啊!小弟初接触web编程,实在是没办法啊~~~~(>_<)~~~~ 
      

  2.   

    你可以在弹出函数openwin()中传值啊,把你想要的值传参过去到弹出页面中得到并显示。
    window.showModalDialog("a.jsp&b="+c,"商品列表","......)
      

  3.   

    <html:button property="detail" value="detail" onclick="javascript:window.open('test.jsp?content=${smsg.content }&time=${smsg.sendtime }','_blank')"();"> </html:button>
      

  4.   

    你使用js弹出新窗体,在onclick='openwin("smsg.content", "smsg.sendtime". "smsg.addrs","smsg.count");'
    在openwin方法中拼出格式就可以了,或者当参数传递也行!
      

  5.   

    openwin()中写实现啊
    window.showModalDialog(url, window, 'help:no;status:no;resizable:no;dialogWidth:350px;dialogHeight:200px;unadorne:yes;edge:sunken');
      

  6.   

    窗口是可以打开,不过content=${smsg.content }&time=${smsg.sendtime }参数却传递不过去
      

  7.   

    如果是使用window.open打开窗口,使用window.opener可获得父页面对象,就可以获得父页面元素的值
      

  8.   

    我现在想获得的是c:forEach循环中某次循环的值,该如何获得?