• 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

Struts1.1 ( TreeView & Paging)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
I'm using Struts 1.1 to build a search engine
Based on the Search result (dynamic) i want to build a tree structure ( 10 words ) per page ( includes pagination)

This is Action Class code..

if (query != null ) {

AgrovocBrowsing conInd = new AgrovocBrowsing();
//int hcount = conInd.getHcount(query);
//log.debug(" Hit length in ViewDefinitionAction : "+ hcount);
List<AgrovocResDoc> agrovoc = new ArrayList<AgrovocResDoc>();
try {
agrovoc = conInd.retrieveAgrovocs(query, se,request);
} catch (Exception e1) {
e1.printStackTrace();
}

if (agrovoc != null && agrovoc.size() != 0) {

session.setAttribute("agrovoc", agrovoc);
}
}

In JSP for tree structure i used "Struts-improve" <layout.treeview> tag lib

Now tree structure is coming fine , now i want add paging (pagination) for this...how to add paging..

this is JSP code..

<table align="left" >
<tr class="broaderterms">
<td valign="top">


<layout:treeview >
<logic resent name="agrovoc" >
<logic:iterate id="agrovoc" name="agrovoc" scope="session">
<c:set var="term" value="${agrovoc.AGTerm}" />
<c:set var="bterm" value="${agrovoc.AGBTerm}" />
<c:set var="nterm" value="${agrovoc.AGNTerm}" />
<c:set var="rterm" value="${agrovoc.AGRTerm}" />
<c:set var="nuri" value="${agrovoc.AGNURI}" />
<c:set var="ruri" value="${agrovoc.AGRURI}" />

<layout:menuItem key="${agrovoc.AGURI}" link="#" >

<logic:notEmpty name="bterm">
<layout:menuItem key="BroaderTerms">
<layout:menuItem key="${agrovoc.AGBURI}" link="#"/>
</layout:menuItem>
</logic:notEmpty>

<logic:notEmpty name="nterm">
<layout:menuItem key="NarrowerTerms">
<logic:iterate id="nuri" name="nuri">
<layout:menuItem key="${nuri}" link="#" />
</logic:iterate>
</layout:menuItem>
</logic:notEmpty>

<logic:notEmpty name="rterm">
<layout:menuItem key="RelatedTerms">
<logic:iterate id="ruri" name="ruri">
<layout:menuItem key="${ruri}" link="#" />
</logic:iterate>
</layout:menuItem>
</logic:notEmpty>

</layout:menuItem>

</logic:iterate>
</logic resent>
</layout:treeview>






</td>
</tr>


<layout ager> doesn't work with <layout:treeview> tag... Any other way to implement paging for this....?
 
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic