• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem running dojo.plugin in struts2.1.6

 
anil rashnil
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i m using struts2.1.6 dojo plugin.

It gives error here.

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

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">
<tr>
<td>System is connected to remote database.</td>
</tr>
<tr>
<s:select name="attributeName" list="dbLabelList"
label="Select Attribute" headerKey="0"
headerValue="--Please Select--" cssClass="textfield" required="true" />
</tr>
<tr>
<td> </td>
</tr>

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


<sx:div
showLoadingText="false" id="details" href="DetailAction" theme="ajax"
listenTopics="show_detail" formId="DBLabelAction">
</sx:div>



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

</table>


</s:if>


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
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.

Thanks!
bear
JavaRanch Sheriff
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic