• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem running dojo.plugin in struts2.1.6

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic