Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 2nd, 2002, 08:38 AM
loneill loneill is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 0 loneill User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
passing multiple values

I don't know if this is possible and it's difficult to explain. I have a form which shows a list of records from a table. Beside each record there is a checkbox. If the checkbox is checked it takes the value from the first field and passes it onto the next page. But what I want to do is when the box is checked I want to pass on the values from the first two fields as it's a combined primary and I'm using these values for a search condition where in delete sql statement. Here is the code for passing one value is it possible to pass two??

for (int i=0;i<v1.size();i++)

{
%>
<tr><td><%=v1.get(i)%></td>
<td><%=v2.get(i)%></td>
<td><%=v3.get(i)%></td>
<td><center><input type=checkbox name=delete value="<%=v1.get(i)%>"></td>
</tr>

Reply With Quote
  #2  
Old July 2nd, 2002, 05:06 PM
dhtmlkitchen dhtmlkitchen is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Boston, MA
Posts: 30 dhtmlkitchen User rank is Sergeant Major (2000 - 5000 Reputation Level)dhtmlkitchen User rank is Sergeant Major (2000 - 5000 Reputation Level)dhtmlkitchen User rank is Sergeant Major (2000 - 5000 Reputation Level)dhtmlkitchen User rank is Sergeant Major (2000 - 5000 Reputation Level)dhtmlkitchen User rank is Sergeant Major (2000 - 5000 Reputation Level)dhtmlkitchen User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 55
Tough question. There's really not enough info there to address it well, so forgive me if I missed your point.

It looks like you have declared (somewhere, at some point) a Vector v1.

It also appears that this Vector contains form data and checkbox info that needs processing. Right so far?

If I am correct, I'd suggest that you write a separate void class that accepts a Vector and pass v1 to this class:

Code:
public void processV1(Vector v1){

   synchronized(v1){
       . . . 
   }
    . . . 

}



Another possibility:
Code:
Vector v1 = parametersToVector(request.getParameterNames(), request);

public Vector parametersToVector(Enumeration enumeration, HttpServletRequest request){
    Vector v = new Vector();
    String param;

    if(enumeration == null) return v;
    
    // process Hashtable of parameters
     while( enumeration.hasMoreElements() ) {
     try{
         param = enumeration.nextElement();
    }
    catch(NoSuchElementException nsee){}
    
     . . .
        
    }
}

Kind of awkward using the second way. It's a good idea to whisk the logic out of the page though.

If I didn't answer you question, provide more detail.
__________________
http://dhtmlkitchen.com/

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > passing multiple values

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap