You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Clement, Steve" <SC...@flyfrontier.com> on 2007/08/14 22:59:20 UTC

struts2 ajax theme and textarea

I am working with Struts2 within a tabbed panel in an ajax theme. In one
of the divs, I am using the <s:texarea > in a form that uses the ajax
theme. The problem is that the content of the textarea does not submit
the new content if I have the notifyTopics attribute set in the submit
tag.

This problem only occurs in IE. In Firefox, the submit action changes
the textarea WYSIWYG text area (provided by Dojo in Struts 2) into a
regular html  textarea right before submitting. The changed (or new)
content is then sent to the action.

In IE7, however, only the originally populated content is sent, not the
changes.

If I don't turn on the notifyTopics property, then the textarea content
is submitted, but the div does not refresh, so there is no way the user
can be sure that the submission has completed.

Here are the relevant code snippets:

Main Index Page:
<s:tabbedPanel id="menu" >
   <s:div 
   		id="home" 
   		key="index.tab.user.label.home" 
   		theme="ajax" 
   		labelposition="top" 
   		>
 		<br/>
 		<s:text name="index.salutation">
 			<s:param>${user.firstName}</s:param>
 			<s:param>${user.lastName}</s:param>
 		</s:text>
 		
   </s:div>
   <s:div 
   		id="emergency" 
   		key="index.tab.user.label.emergency" 
   		theme="ajax" 
   		href="%{adminEmergency}" 
   		listenTopics="update"
   		refreshOnShow="true" 
   		>
   </s:div>
</s:tabbedPanel>

Edit Page:
<s:form 
	id="frmPressReleaseDetail"
	action="releaseSave" 
	method="post"
	theme="ajax"
	>
<s:hidden id="id" name="id" value="${pressRelease.id}"></s:hidden>
<s:hidden id="emergencyId" name="emergencyId"
value="${emergency.id}"></s:hidden>
<s:checkbox id="active" label="Is Active" name="active"
value="${pressRelease.active}" fieldValue="true" ></s:checkbox>
<s:textfield id="headline" name="headline" label="Headline"
value="${pressRelease.headline }"></s:textfield> 
<s:textarea  id="content"  name="content" label="Content" rows="30"
cols="50" value="${pressRelease.content }"></s:textarea>
<s:textfield id="creationDate" name="creationDate" label="Creation Date"
disabled="true" value="${cDate }"></s:textfield>
<s:submit theme="ajax" notifyTopics="update"  ></s:submit>
</s:form>

All changes to the checkbox and textfield tags are properly sent to the
releaseSave action. Only the textarea tag refuses to send the modified
content in IE7.

So either I lose the WYSIWYG editor widget that I get when the form is
in ajax theme, I lose the user experience of refreshing the "emergency"
div, or I lose the changes made to the content textarea. None of these
options sits well.

Any suggestions?

Steve Clement




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