Win a copy of Rust Web Development this week in the Other Languages forum!

Elam Daly

Greenhorn
+ Follow
since Aug 09, 2003
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 Elam Daly

Hi all,

I have a <selectOneMenu> which has a valueChangeEvent and a onchange="submit" javascript bind, so that when the menu choice changes the bean method bound to the valueChangeEvent is called, which does some logic processing. By default, the page that called the valueChangeEvent is then refreshed.

What I then need for it to do is navigate to another page based on the outcome of the method logic, but of course ValueChange events don't do this. Is there a way to alter the navigation outcome via the JSF api so that I can navigate to other pages through my faces-config.xml. In other words, act as if a actionEventListener is attached to my selectOneMenu?

Thanks,
Elam Daly
16 years ago
JSF
Okay, that apparently isn't going to work because of accessing a non-static variable from a static method.

So I guess then I have to register all data components with the dataStructure object, ie all JLists, JTextfields, and JTextareas, so that if their values change, the dataStructure object is aware and will update it's own variables to reflect the changes? The buttons are only going to be used as a 'trigger', to send/query the data to the database?

And in my dataStructure object, is it best to simply use a long if/then block to figure out which events are what?
[ July 29, 2005: Message edited by: Elam Daly ]
16 years ago
Okay last question,

The dataStructure now receives the event properly, but I still to need read values from various other objects in the gui, ie text fields and jlists. Is my best option to make static methods on the objects in question to send the dataStructure their current values?

Thanks again for the help.

Elam
16 years ago
Hi Scott,

Thanks for the reply.

I am aware of the MVC model, but am not familiar with implementing it in Swing, so thanks for the link.

Couldn't I also use a Singleton model, so that I have a static method that simply returns the instance of the dataStructure class in order to register it with the various relevant Swing objects?

Elam
[ July 27, 2005: Message edited by: Elam Daly ]
16 years ago
Howdy all,

I have a Swing mockup for a program in which I have created all relevant sections of the application as separate objects. So I have a SearchPanel object, in which the client types in a number and hits the search button, or the update button to update the database. Another object is the PatientData object, which merely displays all relevant patient data, etc. Each of the objects extends a JPanel, and in another object I compose them altogether in a JFrame. The main impetus for doing this was because I'm using JDeveloper's GUI building tools, and it's nice to be able to focus on each area of the appication in solitude.

I also have a dataStructure object in which I store all the data that will be updated in the database due to the client changing the data displayed in the Swing app.

Now,the problem I'm running into is how to register the dataStructure object with the relevant swing objects as receiving their event objects. The dataStructure object doesn't know anything about the Swing objects, because I create it in the main() method of the runtime object. So how am I to register the dataStructure with say a JButton in the swing app for instance? I could write a method is the object that contains the JButton, which accepts an instance of the dataStructure object and can therefore register said instance, but how do I call that method from the dataStructure object, considering the dataStructure object doesn't know that the swing app exists?

I realize this is a bit rambling, and I can be more concise if need be, as in code and class structure, so any help would be apprecitated.

Cheers.
[ July 27, 2005: Message edited by: Elam Daly ]
16 years ago
Thanks for both of your replies.

Ernest, I don't see how I could use a JTable in this situation. The only static field is the A/B header, everything else is a JComboBox. Could you elaborate?

Cheers
16 years ago
Hi all,

I have a JPanel, in which I am adding anonymous JComboBoxes per request of a user. In fact, it is some what of a table structure:



So if the user added a new BBox, which would be BBox4, then I would have to add the corresponding ResultBoxes's all the way through the last entered ABox, which would be ABox3 in the example. And vice-versa with a ABox, as all ResultBoxes would have to be created to the last BBox.

The problem arises when I need to delete either an ABox or BBox, because I have no way of deleting the corresponding ResultBoxes, as they are all anonymous.

Does anyone have any design suggestions for correcting this? The user has specified that they want this format, with a table of JComboBoxes, but I'm pretty sure that the anonymous approach won't work.

Cheers.
[ June 09, 2005: Message edited by: Elam Daly ]
16 years ago
Hi all,

Lets say I have a JPanel with a preset layout, which consists of buttons and combo boxes. If the user presses the button, I would like to add another combo box. The version I coded calls the repaint method on the JPanel in question, but the changes only show if I resize the JPanel. Is there a way to have the Panel repaint without resizing?

16 years ago
Hi All,

I have been assigned the task of accessing a .net web service. The service requires an xml string as input, ie:


When I use Axis and pass the variable to the .net service, it becomes encoded so all the < become lt; and the > become gt;
Is it possible to pass that string data literally using Axis?

Cheers,
Elam
[ April 27, 2005: Message edited by: Elam Daly ]
16 years ago
Hi Adeel,

Same result.
16 years ago
JSP
Howdy all,

I am writing a jsp application which uses a proprietary JDBC database driver. I am getting errors thrown and am having trouble drilling down to the cause. The error is thrown when I use a prepared statement and the <sql:query> tag ie:



This is the error:


Now if I take away the prepared statement and explicitly set the value ie:


everything works fine, but I'd rather not do this.

So before I talk to the jdbc provider describing the problem, am I correct in assuming that the driver is not casting the prepared statement value correctly? Is there some way to explicitly cast the value myself using the <sql:query> tag?

Cheers.
[ March 28, 2005: Message edited by: Elam Daly ]
16 years ago
JSP
Howdy All,

I apologize if this is in the wrong forum. I couldn't think of where else to post it.

I am trying to set up a simple test using JSF and JDBC and the h:dataTable tag.

The Faces servlet is throwing a javax.servlet.ServletException: javax.servlet.jsp.JspException: java.sql.SQLException: This ResultSet is Forward Only. exception and I don't know if this is due to incorrect usage of the h:dataTable, my JDBC driver(proprietary) doing something fishy or just an incorrect bean implementation. If anyone can point me in the right direction it would be most appreciated.

Thanks!


[ September 16, 2004: Message edited by: Elam Daly ]
17 years ago
Hi all,

I'm doing the Sun JDBC tutorial and am confused on something.
If I declare a Connection object outside of a try/catch block, shouldn't the connection be valid outside of the try/catch block in which it is actually initialized?

I'm getting a 'variable con might not have been initialized' error. Does this mean that I have to enclose everything in a giant try/catch block?
The code works if I put the 'con=DriverManger.getConnection( url )' inside of the 2nd try block, but that can't be efficient. Opening a connection everytime to do a query?


Thanks.

[ June 18, 2004: Message edited by: elam daly ]
[ June 18, 2004: Message edited by: elam daly ]
O'Reilly has some excellent Linux books, most notably Running Linux. I started out with that and found it enormously helpful
18 years ago