You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Martin Gainty (JIRA)" <ji...@apache.org> on 2008/08/18 03:23:25 UTC

[jira] Commented: (WW-2771) target div tag does not generate any response

    [ https://issues.apache.org/struts/browse/WW-2771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44570#action_44570 ] 

Martin Gainty commented on WW-2771:
-----------------------------------

example html form which should be rendered with s:form

<%@ taglib uri="http://struts-menu.sf.net/tag" prefix="menu" %>
<html>
<head>
<title>A test for Henning..</title>
<script language="JavaScript">
<!-- Begin
function doit() 
{
 var divTag = document.createElement("div"); 
 divTag.id = "div1"; 
 divTag.setAttribute("align","center"); 
 divTag.style.margin = "0px auto"; 
 divTag.className ="dynamicDiv";
 divTag.innerHTML = "This <b>HTML Div tag</b> is created using Javascript DOM dynamically.";
 document.body.appendChild(divTag); 
}
// End -->
</script>
</head>
<body>
<%@ include file="/common/taglibs.jsp"%>
<script type="text/javascript"  src="<c:url value='/scripts/prototype.js'/>"></script>
<script type="text/javascript" src="${ctx}/scripts/calendar/calendar.js"></script>
<script type="text/javascript" src="${ctx}/scripts/calendar/calendar-setup.js"></script>
<!-- script type="text/javascript" src="${ctx}/scripts/calendar/lang/calendar-${pageContext.request.locale}.js"></script -->
I use the following technique to load it into the div:
 
<form id="form_TraitPage" onSubmit='javascript:doit()' method="post" target="traitDiv">
    	<input type="submit" id="submitSelectTraitPage" theme="ajax">
    	</input>
</form>
   
</body>
</html>

thanks/
Martin-

> target div tag does not generate any response
> ---------------------------------------------
>
>                 Key: WW-2771
>                 URL: https://issues.apache.org/struts/browse/WW-2771
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.1.0
>         Environment: s: form doesnt with submit does not generate response content to div tag
>            Reporter: Martin Gainty
>
> s:form doesnt generate correct results
> <%@ taglib uri="http://struts-menu.sf.net/tag" prefix="menu" %>
> <%@ include file="/common/taglibs.jsp"%>
> <script text="javascript>function doit { return "display_this" } </script>
> <s:div id="traitDiv" cssstyle="width: 100%;" theme="ajax"> </s:div>
> <s:form id="form_TraitPage" action="'javascript:doit()'" namespace="/" method="post">
>     <s:radio list="traits" listValue="getText(class.name)"  listKey="class.name" name="traitType">
>     </s:radio>
>     <s:submit id="submitSelectTraitPage" theme="ajax" targets="traitDiv">
>     </s:submit>
> </s:form>
> generates this
> <script text="javascript>function doit { return "display_this" } </script>
> <s:div id="traitDiv" cssstyle="width: 100%;" theme="ajax"> </s:div>
> <s:form id="form_TraitPage" method="post" namespace="/" action="'javascript:doit()'">
> <s:radio name="traitType" listkey="class.name" listvalue="getText(class.name)" list="traits"> </s:radio>
> <s:submit id="submitSelectTraitPage" targets="traitDiv" theme="ajax"> </s:submit>
> </s:form>
> but the response does not display the response text in the div tag defined in targets
> ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.