Scott Stephens

Greenhorn
+ Follow
since Jun 25, 2011
Scott likes ...
Eclipse IDE Tomcat Server Debian
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 Scott Stephens

For those interested of Event handling in DJBrowser, I found the solution for my Problem.

1.) I needed to create a JWebBrowser object that I could use in the TripHandler class. In order to do this I needed to modify the BPanel like this:

I removed the WebBrowserlistener that was initially in the BPanel class stuck in a nested anonymous class that I couldn't access. Because I now have an object in my TripHandler class:


I could add the listener and get the "destination" that was sent from the browser via JavaScript:

the last step was to extend my TripHandler class with a WebBrowserListener provided from DJBrowser
8 years ago
My project is a taxi management module that manages planned trips that need the distance from a point A.
I guess I wasn't clear enough about the invoking class(class that implements an instance of the DJBrowser. I am trying to follow an MVC Approach and have a view class TripHandler that sets up the UI:

That means Class TripHandler implements the management view that invokes the BPanel Class that Returns the object browser. Because the Listener is in the static method util.BPanel.createContent(), with the inner class having access to the distance returned from the javascript, I don't know how to get the value of "distance" from the nested inner class from BPanel and assign it to member distance in the TripHandler class . It's probably really simple. Just don't know how to do it. I hope that makes it more understandable. Thanks for the replies.
8 years ago
I am using the DJWebbrowser in a Java Swing Application that I am working on


and am sending data from a Google Map API , Distance Matrix Query with following code


The DJBrowser Class that invokes the browser



has a Browser Listener Implementation public commandReceived(

I haven't found a way to access a class property from the class that invoked the web browser, because the above WebBrowserAdapter is in an anonymous Inner Class.´I would like to have the distance that is sent from the Javascript to the application be passed on to the class member "distance" that in the invoking class. I Need some help.
8 years ago
I have a view that is supposed to show data from different tables. For this, I have separated the business logic into different backing beans, sdHandler and urlaubHandler,which then connect to the DAO-Layer. The first iinitialization of the urlaubHandler initializes a parameter "sd" via faces-config.xml, but after the first loading of the view the component "showUrlaub" has no way of knowing for which person it should load the corresponding data- when <h:commandButton styleClass="calNavBtn" value="Edit"
action="#{sdHandler.editStammdaten}"> is called

What is the best for backing beans to share a "global" property? Is it possible or even suggested?

9 years ago
JSF
Before I read the replies, I tried an example line from Bernd Müller's Java Server Faces "ein Arbeitsbuch für die Praxis"
It is more the direction that Tim suggested, keeping the business code and not using an action listener and looks like this:

9 years ago
JSF
I'm still working on this. This function checks the dates to make sure some conditions are met. It is the action of the code already posted above. When I do the validation here, I can access the fields Uvon and Ubis. If I try to validate the input with the validator I can only access the Object value from the validator signature. But I need to compare it to see if the dates are valid and these belong together. Using the function saveUrlaub all my needs are met except being able to create a validation message!
How can I throw an exception that lands in the <h:message></h:message> tags?

9 years ago
JSF
The following jsf code has a start date and end date for applying for vacation.
the commandButton has an action="#{urlaubHandler.saveUrlaub}" to submit these dates.

I need to validate the dates that

1. start is before the end date
2. the dates have work days >0
3. the employee has enough vacation days on their account
4. there are no overlapping days with other vacation

My question is : Can I do all of the above checking in the function "saveUrlaub" If yes, can I throw a validator exception to aquire error messaging for the different error cases without using a bound validator in the jsf page?

9 years ago
JSF
For anyone looking for an example how to compare dates, the following code now does it:
9 years ago
JSF
I just finished a page that implements editing data and inserting data using the same <h:form> and the same backing bean. I did use the "RESET" combined with an action="#{MyClass.resetData}" where I nulled out each of the field values. This seems to work fine, a little tedious, if the form is populated with much data, but so far effective. I'll keep this topic in my watches, to see if there is a trick, but it sounds like after the form is populated and a Request has been sent, and the backing bean updated, the "memory" of the browser will always return what was last sent.
9 years ago
JSF
I realize this isnt strictly a JSF Problem, but it is in a backing bean that is called by my JSF App.
My problem is that when I compare :

if (dt == result)

dt has the value 2012-11-02 and result has Fri Nov 02 20:29:23 CET 2012 even though I formatted it with SimpleDateFormat.
the static variable ferienTage is an array of holidays that is supposed to be valid for any year. The function compares the parameter dt to the array and returns
true/false if it is a holiday.
Why is there a difference. Both Date objects have been instansiated and initialized.

Maybe someone can help here.
9 years ago
JSF
I am having a problem that only one of the <h:commandButton> tags fire when I have two <h:form> tags on the page. Is it allowed to have more than one <h:form> tag on the page. The Html from two forms is rendered, however the action="backing bean" isn't fired. I could use some help here.
Using JSF 2.0 with MyFaces and hibernate 3.2

9 years ago
JSF
I got the Derby database on another table to use identity and it works fine for a session.save.
I now have both session.save and session saveOrUpdate working!! However with a table that is not identity. For now a good step. I have in my mapping file class="assigned" and assign the id after getting a list and finding the size +1
I am still working on many of the concepts, so it takes a while to sort through some of the details- when class="assigned", the id has to be set before you can use an EL-Expression in a JSF Page. Otherwise, it says Null pointer.

here the error msg that is displayed in the browser:
org.hibernate.PropertyAccessException: Exception occurred inside getter of model.Stammdaten.id
org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:172)
org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:67)
org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:67)
org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:147)
org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:457)
org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:131)
org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
dao.HibernateUtil.<clinit>(HibernateUtil.java:12)
dao.DAOStammdaten.saveStammdaten(DAOStammdaten.java:74)
The above mentioned is the error that comes when I use identity.
I don't set the id field at all. The data is in a managed bean. The variable sd is instansiated at class loading. id is set to null.
The DAOStammdaten.save() function is called from JSF per EL



sdHandler.saveStammdaten just calls the DAO function keeping the business logic in it's layer.