• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Multiple Row Updation

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to update multiple rows which will be upadated depending upon the chexbox selected.Kindly help me.Better if somebody can give some example.
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What "multiple rows" do you want to update?
 
subhasish nag
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In frontend (jsp)there will be some no of rows displaying datas of one table .I need some functionality so that user can update multiple rows of a jsp page by selecting checkboxes,which will also update the table.
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

You can update multiple row like :

For jsp code user map:

<s:iterator value="auctionListingFeesList" status="rowstatus">
<s:hidden name="auctionListingFeesMap[%{id}].id" value="%{id}" />
<s:set name="classCSS" value="%{'Textfiled-no-border-odd'}" var="classCSS"></s:set>
<s:set name="bgColor" value="%{'#FFFFFF'}" var="bgColor"></s:set>

<s:if test="#rowstatus.even">
<s:set var="classCSS" value="%{'Textfiled-no-border-even'}"></s:set>
<s:set var="bgColor" value="%{'#F8F8F8'}"></s:set>
</s:if>

<tr>
<td align="center" class="verdana12Greybold right-border" bgcolor="<s roperty value="%{bgColor}" />">
 
<b><s roperty value="%{#rowstatus.index + 1}" /></b> 
</td>
<td align="center" class="verdana12Greybold right-border" bgcolor="<s roperty value="%{bgColor}" />">
<s:textfield theme="simple" cssClass="%{classCSS}"
name="auctionListingFeesMap[%{id}].startingPriceFrom"
value="%{startingPriceFrom}" size="15" />
</td>
<td align="center" class="verdana12Greybold right-border" bgcolor="<s roperty value="%{bgColor}" />">
<s:textfield theme="simple" cssClass="%{classCSS}"
name="auctionListingFeesMap[%{id}].startingPriceTo"
value="%{startingPriceTo}" size="15" />
</td>

</tr>
</s:iterator>


For Java code

Use private Map<Integer, AuctionListingFees> auctionListingFeesMap;

AuctionListingFees - is your Hibernate DTO.

generate getter and setter method for it.

this.miscellaneousFees = MiscellaneousFeesServiceDelegator.getMiscellaneousFees();
this.auctionListingFeesMap = new HashMap<Integer, AuctionListingFees>();
this.auctionListingFeesList = AuctionListingFeesServiceDelegator.getAuctionListingFees();

for (AuctionListingFees auctionListingFee : this.auctionListingFeesList) {
this.auctionListingFeesMap.put(auctionListingFee.getId(), auctionListingFee);
}

For update user this code.


MiscellaneousFees tmpMiscellaneousFees = MiscellaneousFeesServiceDelegator.getMiscellaneousFees();
this.miscellaneousFees.setFeaturedShopFee(tmpMiscellaneousFees.getFeaturedShopFee());
this.miscellaneousFees.setSearchEngineMonthlyFees(tmpMiscellaneousFees.getSearchEngineMonthlyFees());
MiscellaneousFeesServiceDelegator.updateMiscellaneousFees(this.miscellaneousFees);
 
money grubbing section goes here:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic