Mervin Chan

Greenhorn
+ Follow
since Dec 03, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mervin Chan

I have a large JTable with 100 over columns.

I wish to allow the user to click on a button to make the JTable display scroll to a specified column.

ie, button "display column 20 onwards" will cause the Jtable to scroll to column 20.
16 years ago
I have a problem. If i have to call a bunch of methods with similar names like

String rec1 = Records.getRecord1();
String rec2 = Records.getRecord2();
String rec3 = Records.getRecord3();

is there a way I can do this in a loop?

for example:

for(int count=1;count<4;count++){

rec//count// = Records.getRecord//count//();
}
16 years ago
I have a problem.

I have a jsp page that is accessed via two different links. Depending on from which link it (the page) is accessed from, I want to display different text.

Suppose I cannot have seperate jsp pages for each link. is there a way I can identify which link it accessed from? Using javascript?
Simple Question:

I have two tables A,B on my Jsp page

I want to use javascript to, upon pressing a button, alternate between displaying table A or B. But not both at the same time.

ie.

Button pressed - Table A displayed.
Button pressed again - Table B displayed
.... A, B, A , ...


How do i do that?
[ October 06, 2005: Message edited by: Bear Bibeault ]
I have a UI question.

I have two drop-down select boxes in my html page, A and B.

Depending what I select in select-box A, select-box B will load different values.

This is easily done by javascript. No problems here.

My problem is, for certain options (are selected) in select-box A, I want select-box B to become a regular text-input box (for user input).


ie.

Select-box A -> "Fruit" Chosen

Select-box B ->Apples
Oranges
Grape

Select-box A -> "Name" Chosen
Select-box B -> becomes a textbox


Could this be possible?
[ September 16, 2005: Message edited by: Mervin Chan ]
Prakash:

Thanks man.

It was quite useful.
18 years ago
JSP
I have a problem with presenting my data on my JSP.

My struts app pulls some data from the DB and presents it in a table on a jsp page.
because the records may range from 1 to 1000++, depending on the user's query.

i am wondering if there is anyway, to
"save the table" and spread the data (let's say every 50 rows) on the jsp.

The user will click a "next" button to see the next 50 rows until the end.

Preferbly, I would prefer to do the SQL query once, and post-process the data, rather than
executing the SQL query n times.

Wonder if you guys can point to me the general direction of a solution.

Thanks!
18 years ago
JSP
I have a performance related question:

My Struts app uses has two modules deployed in two seperate "war" files. ie
myApp-ear/a.war , myApp-ear/b.war.

My question is, would it run faster if I take the effort to combine the two war files into one?

If so, are there tools, tutorials that would aid me in doing it?

and another related question: Are there any online resources for improving the performace (esp the loading time) of struts apps?

Thanks!
18 years ago
Thanks Alan. Worked.
18 years ago
I have a form. Previously, I submit the form using a button.

Like this:

<html:form action="someAction.do">

<input type="textArea" .... >
<html:submit value="Check" property="event">
...

Its supposed to fire someAction.do?event=Check when button is pressed.

What I want to do, is to write a javascript to fire off the event when the textbox is "onBlur".

How do i do this, when I have other buttons with other "event" values in the same form?
18 years ago
I have a problem with struts form-submission.

I want to insert entries to a DB using a form. The form looks something like this.

1. Entry 1 [submit]
2. Entry 2 [submit]

The number of rows is dynamic.Every row has a "Submit" button. When the user hits the button, the DB is updated with the row's data. This is done via an ActionForm, which will pass the parameters to the db via a single SQL insert statement. All this works (for a single row "insert")

What I want to achieve is for the user to amend the entries, then hit a single submit button, to insert all the rows' data in one go, like so

1. Entry 1
2. Entry 2

[Submit All]

How can i achieve this? Is there a way to loop through the entries, doing the "insert" statement multiple times (depending on the number of rows on my table?). The "Insert" statement works for only one row. I do not wish to change the insert statement. The main problem is that the number of rows is not-fixed.

If anyone can point to me a similar solution online, it'll be mightly fine. Thanks!
18 years ago
I been scratching my head over this, and my Goggle-fu has failed me.

I've been looking a javascript to do this UI.Its hard to describe.
So here's a pic.

http://docs.rinet.ru/Oru7na95/images/31/31dpo31.gif

Does anyone know what is this called (is there a name for this type of GUI widget?) and is there pre-made code for this sorta thing.

Thanks
18 years ago
Is there any link where there are comparisons between storing objects in lists, arrays ?

Comparisons in terms of speed.

Thanks?
19 years ago
I have a problem with flow control.

I am testing for a few conditions:

while( (a==true)&&(b==true)&&(c==true)... )
{
do something
}

The problem is that I do not know how many conditions to test at runtime.

The items to test (a,b,c ...) are read from a text file.

If this is the case, how do i write my while loop to accomodate this?
19 years ago
I am trying to start 2 different rmiregistry on 2 different ports on the same PC.

I do this by:

try {
java.rmi.registry.LocateRegistry.createRegistry(1099);
System.out.println("RMI registry ready.");
} catch (Exception e) {
System.out.println("Exception starting RMI registry:");
e.printStackTrace();
}


try {
java.rmi.registry.LocateRegistry.createRegistry(2099);
System.out.println("RMI registry ready.");
} catch (Exception e) {
System.out.println("Exception starting RMI registry:");
e.printStackTrace();
}

I cannot seem to start the 2nd rmiregistry. But if i comment out the first try{} , the 2nd rmiregistry works.

I come to the conclusion that 2 rmiregistry on 2 different ports on the same PC does not work? True?
19 years ago