File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes can i modify my code in this way ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "can i modify my code in this way ?" Watch "can i modify my code in this way ?" New topic
Author

can i modify my code in this way ?

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 437
hi, i have sample code as follow, it should have more methods like this with the different of form.isPpo_chkbox_?() and form.getPpo_txtfieldscno_?(), ? - is number like 2,3,4,5...






as the methods are doing the same function, someone suggest that i do like this case



but i think we have problem of calling form.getPpo_txtfieldscno(i) with parameter i , can someone suggest how to solve it ? thank you

(Marilyn added line breaks)
[ June 15, 2005: Message edited by: Marilyn de Queiroz ]
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10

Notice how much easier it is to read formatted code than code on one line that is over 400 characters long?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
but i think we have problem of calling form.getPpo_txtfieldscno(i) with parameter i , can someone suggest how to solve it ?


If you wrote getPpo_txtfieldsscno(i) you can solve the problem there. How do you get one text field from a bunch of text fields by knowing a number? You need some kind of indexed bunch. If you know the number of text fields ahead of time an array is fine. If you don't, one of the Collections would do the job.

See if you can build some code around that idea. If you get stuck, post what you have and we'll take a look.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can i modify my code in this way ?
 
Similar Threads
how to i refactoring in my case ?
Permission denied exception on saving file to filesystem
Reset the Action form values
Page section does not update after call of a4j:support in IE 9
GUI interaction