File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes problem running dojo.plugin in struts2.1.6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem running dojo.plugin in struts2.1.6" Watch "problem running dojo.plugin in struts2.1.6" New topic

problem running dojo.plugin in struts2.1.6

anil rashnil

Joined: Jul 06, 2009
Posts: 2
When i m using struts2.1.6 dojo plugin.

It gives error here.

function show_details() {
dojo.event.topic.publish("show_detail"); /*...The function publish(String) is undefined.*/

Code where i m using this function.

<s:if test="conn!=null">
<td><s:url id="d_url" action="DetailAction.action" /></td>
<table width="600" align="Center">

<s:form name="DBLabelAction" id="DBLabelAction" action="UpdateRemoteDBLable">
<td>System is connected to remote database.</td>
<s:select name="attributeName" list="dbLabelList"
label="Select Attribute" headerKey="0"
headerValue="--Please Select--" cssClass="textfield" required="true" />
<td> </td>

<s:select name="remoteDbTable" list="remoteDbtableList"
label="Select Table" headerKey="0" headerValue="--Please Select--"
cssClass="textfield" required="true"
onchange= "show_details()"/>

showLoadingText="false" id="details" href="DetailAction" theme="ajax"
listenTopics="show_detail" formId="DBLabelAction">

<s:submit value=" submit " align="center"></s:submit>
<td> </td>



Please help what to do, in order to run ajax successfully. i have tried all sources to run this, but not successful.
Roberto Hernandez
Ranch Hand

Joined: Apr 29, 2009
Posts: 33
Do you have dojo declared inside your head tag?
<sx:head />

Is your <script> declared after the above line? It should look something like this:

Also, is your code inside another <sx:div or <sx:tabbedPannel ?? If that's the case, you need to use executeScripts=true and separateScripts="false"

give it a try!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

"rashnil invincible",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

JavaRanch Sheriff

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: problem running dojo.plugin in struts2.1.6
jQuery in Action, 3rd edition