• 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

Struts 2.1.6: keeping information in the same div - using tree node

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All

I am fairly new to struts. I have been trying to implement the dynamic tree example using <sx:tree> as demonstration in struts-showcase-2.1.6: Tree Example (dynamic).

I have the tree appearing fine and when I click on my nodes the corresponding dojo.bind executes fine and delivers my returned jsp page in the correct div.

However it is when I process information on the resulting jsp in that div, I get taken out of the div! I want to stay in that div and have all future information displayed there.

What do I need to do to constantly keep the executed form on that jsp page, within the div element?

Below are the relevent bits in my jsp page:


dojo.io.bind({

url: "<s:url value='retrieveWBSElementDetail-"+wbsId+".action'/>",

load: function(type, data, evt) {

var divDisplay = dojo.byId("wbsDetails");

divDisplay.innerHTML=data;

},

mimeType: "text/html"

});




<div id="tree">

<sx:tree
id="tree"
rootNode="%{treeRootNode}"
childCollectionProperty="children"
nodeIdProperty="id"
nodeTitleProperty="name"
toggle="explode"
cssClass="tdLabel"
selectedNotifyTopics="treeSelected"
/>
</div>





<sx:div label="WBS" id="wbsDetails" loadingText="Loading..."/>


So when a node is clicked on the tree, wbsDetails div gets popuplated fine. However in the resulting page that gets rendered in the div, when I execute a submit or edit in that div, I get taken out of that page altogether & end up in a new jsp based on actions result. I need to stay in that div. The page that gets rendered in wbsDetails div is a standard jsp page with a form. The form has a submit button, whose target I have put to be wbsDetails. But as already mentioned this doesnt work. I was hoping when i submit that form, the target will take into effect and update my div.





I have also tried to used <sx:bind> on the form containing the page that is rendered in the div. however, as soon as I process something new on this page, I go out of my div and into the resulting jsp as per the struts.xml

help is very much appreciated.

Thanking you so much in advance.

Michael
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic