tag:blogger.com,1999:blog-5396570633771229267.post5327788084305339452..comments2024-03-29T08:43:05.719+01:00Comments on The BalusC Code: Populate child menu'sBalusChttp://www.blogger.com/profile/00299057045960008647noreply@blogger.comBlogger43125tag:blogger.com,1999:blog-5396570633771229267.post-12177222660427295942011-05-30T00:43:48.206+02:002011-05-30T00:43:48.206+02:00The exception message suggests that you didn't...The exception message suggests that you didn't put the class in a package. Classes in the default package are invisible to classes in a normal package. Always put public classes in a package.<br /><br />But you told about annotations, which in turn suggests that you're using JSF 2.0. This article is written with JSF 1.2 in mind and I don't gurarantee that it works in JSF 2.0 due to BalusChttps://www.blogger.com/profile/00299057045960008647noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-52325980211969143022011-05-29T23:07:11.259+02:002011-05-29T23:07:11.259+02:00Some more things:
1) The crash happens after I...Some more things: <br />1) The crash happens after I've selected a country and then a city.<br />2) I use JDK 1.6 with Netbeans<br />3) I'm using annotations instead of the faces-config stuff.<br />4) I've just moved the whole stuff to a separate project to be sure, and remove the annotations and used the faces-config stuff; the crash still happens.Tilman Hausherrhttps://www.blogger.com/profile/05836776008948503388noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-90812761723025224662011-05-29T22:47:40.025+02:002011-05-29T22:47:40.025+02:00root cause
java.lang.InstantiationException: Coun...root cause <br />java.lang.InstantiationException: Country<br /> java.lang.Class.newInstance0(Class.java:340)<br /> java.lang.Class.newInstance(Class.java:308)<br /> javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:107)<br /> javax.faces.component.ComponentStateHelper.restoreState(ComponentStateHelper.java:292)<br /> javax.faces.component.UIComponentBase.restoreState(Tilman Hausherrhttps://www.blogger.com/profile/05836776008948503388noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-68794626847670033162011-05-29T22:02:07.414+02:002011-05-29T22:02:07.414+02:00@Tilman: the example compiles and runs. What's...@Tilman: the example compiles and runs. What's the root cause of the `InstantiationException`?BalusChttps://www.blogger.com/profile/00299057045960008647noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-41056535425138576692011-05-29T20:08:49.904+02:002011-05-29T20:08:49.904+02:00this line
area.parent = this;
doesn't work b...this line<br /><br />area.parent = this;<br /><br />doesn't work because parent is private.<br /><br />I never got the example to work, because of this:<br /> javax.servlet.ServletException: java.lang.InstantiationException: Country<br /><br />not sure if this is related to me removing the "private".Tilman Hausherrhttps://www.blogger.com/profile/05836776008948503388noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-14131193079555610742011-03-03T17:37:27.088+01:002011-03-03T17:37:27.088+01:00@BalusC Can this work with Ajax I am looking for D...@BalusC Can this work with Ajax I am looking for Dynamic DropDrown with Ajax using ajax4jUnknownhttps://www.blogger.com/profile/10168449936525876992noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-1352173772528314172011-01-06T00:14:54.938+01:002011-01-06T00:14:54.938+01:00Hi!
Is is possible to run with Tomcat 6?Hi!<br /><br />Is is possible to run with Tomcat 6?Sibusiso Nkambulehttps://www.blogger.com/profile/14362179413533049626noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-79769925011641279202010-08-27T01:34:10.058+02:002010-08-27T01:34:10.058+02:00hey,
first i want to thank you, this article is ve...hey,<br />first i want to thank you, this article is very interesting.<br /><br />second, i want you to help me if it's possible. i'm a beginner in jsf framework, i'm using your code in my application and it works very well, but i would like to use data from database instead of data from file World. my structure DB is like this :<br /><br />country(code varchar(4), name varchar(35)) Unknownhttps://www.blogger.com/profile/07129718871894474945noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-1679477165458809502010-06-23T16:34:04.708+02:002010-06-23T16:34:04.708+02:00Thanks JSF tutorial is very user full me.. thanks ...Thanks JSF tutorial is very user full me.. thanks lot..sddhttps://www.blogger.com/profile/00910381707964796202noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-50941429421774408982010-05-13T18:10:11.451+02:002010-05-13T18:10:11.451+02:00Hi BalusC
I am having two select box JSF componen...Hi BalusC<br /><br />I am having two select box JSF components in the jsp, and both has two separate custom value change listener’s class. When I try to change value of one select box component both the value change Listener is getting called. When I analyzed the problem I found that the old value passed is always empty in the Value change Listener class. Because of this the new value and oldRameshhttps://www.blogger.com/profile/15368964978494921320noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-60786146550862750392009-06-18T08:29:45.627+02:002009-06-18T08:29:45.627+02:00Hi BalusC,
I just wanted to thank you! Your articl...Hi BalusC,<br />I just wanted to thank you! Your article helped me quickly figure out mess with refreshing data in user interface. <br />Thank you,<br />Aleksandar Lukic<br />Software Developer<br />National Bank Of SerbiaUnknownhttps://www.blogger.com/profile/04743266760627916704noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-47766711451370596312009-04-14T17:36:00.000+02:002009-04-14T17:36:00.000+02:00Hi BalusC,
I just wanted tou thank you! Your ar...Hi BalusC,<br /> I just wanted tou thank you! Your article helped me quickly fix a bug that I believe would have otherwise taken a lot of time!<br /><br />Thanks,<br />Mark Snider<br />Research Programmer Ohio State UniversityMark Sniderhttps://www.blogger.com/profile/04390396156845334659noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-38880814836858493042009-04-06T19:32:00.000+02:002009-04-06T19:32:00.000+02:00Actually it is working fine as long as I don't per...Actually it is working fine as long as I don't persist my form (containing other data). After I persist the data, same information is shown after opening the page again as the bean is in session scope. If I change scope to request, the combo change is working fine but when I submit, I receive error the value is not validkapilhttps://www.blogger.com/profile/11723205628675930324noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-29797820266747641252009-04-06T19:18:00.000+02:002009-04-06T19:18:00.000+02:00Hi,I am having problem in changing the country com...Hi,<BR/>I am having problem in changing the country combo. When I change the option and after the value change event, the original value is shown selected in the country combo instead of new value. Am I missing something here?kapilhttps://www.blogger.com/profile/11723205628675930324noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-54327569595916251422009-03-02T16:32:00.000+01:002009-03-02T16:32:00.000+01:00Well... I guess I managed to (kind of) resolve the...Well... I guess I managed to (kind of) resolve the problem, in the managed bean that loads the countries and states I look for the person bean, if I find it and then watch for the person's country and load all states related to that country.<BR/><BR/>It's just a workarround to win time, I'll see if I can find a better way n_n.Jaimicohttps://www.blogger.com/profile/10562174523085556334noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-25938247994977554152009-02-27T21:01:00.000+01:002009-02-27T21:01:00.000+01:00Hello BalausC, your post is of great help when I'm...Hello BalausC, your post is of great help when I'm creating a new record of... let's say a person who has a state of birth that depends on a country.<BR/><BR/>But I have a problem: when I'm editing an existent record the countries selectOneMenu appears with all the countries and is selected the country of birth of the person (which is OK), but the state appears empty, I think it's because the Jaimicohttps://www.blogger.com/profile/10562174523085556334noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-1258599625819500152009-02-27T20:37:00.000+01:002009-02-27T20:37:00.000+01:00Ogi, the t:saveState is from the Apache Tomahawk p...Ogi, the t:saveState is from the Apache Tomahawk project, you can download from here http://myfaces.apache.org/tomahawk/index.html, there're also instructions for installing, just one note, if you're going to use it with jsf 1.2 you'll have to download the <B>tomahawk 1.1.8 for jsf 1.2</B>, and you'll also need it dependency: <B>FileUpload</B> http://commons.apache.org/fileupload/).Jaimicohttps://www.blogger.com/profile/10562174523085556334noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-50700421073748696742009-02-06T13:26:00.000+01:002009-02-06T13:26:00.000+01:00excellent excellent piece of writing. Thank you.I ...excellent excellent piece of writing. Thank you.<BR/><BR/>I am still trying to figure this out for "request" scope though. You previously suggest using t:saveState, from which library was that>Ogihttps://www.blogger.com/profile/07565945613698121801noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-57707018163691345412009-01-23T12:21:00.000+01:002009-01-23T12:21:00.000+01:00Supply a valid (no-arg) constructor.Supply a valid (no-arg) constructor.BalusChttps://www.blogger.com/profile/00299057045960008647noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-46735835429328244902009-01-23T07:03:00.000+01:002009-01-23T07:03:00.000+01:00Hi,Thanks for the blog. I have changed all the nam...Hi,<BR/><BR/>Thanks for the blog. I have changed all the names and implemented the same. I am getting the first dropdown list and when i changed the value of first dropdown i am getting an error page saying ..<BR/><BR/><B><BR/>javax.servlet.ServletException: java.io.InvalidClassException: com.sample.Model; no valid constructor<BR/> javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)<BRHarihttps://www.blogger.com/profile/14211778582484089230noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-81432280546178216122008-11-23T17:13:00.000+01:002008-11-23T17:13:00.000+01:00Hi.I have a similar page to the example with just ...Hi.<BR/><BR/>I have a similar page to the example with just two h:selectOneMenu.<BR/><BR/><BR/>public void selectOneMenu_01Changed(ValueChangeEvent event) {<BR/>//logic<BR/>}<BR/><BR/>public void selectOneMenu_02Changed(ValueChangeEvent event) {<BR/>//logic<BR/>}<BR/><BR/>but I can't identify wich element in the page was selected at least the first time, because two method are fired in the same Unknownhttps://www.blogger.com/profile/00981019498667389290noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-17772595069472049172008-11-13T14:11:00.000+01:002008-11-13T14:11:00.000+01:00If you want to keep it request scoped, you at leas...If you want to keep it request scoped, you at least need to save the state of the options. The Tomahawks t:saveState may come in handy.BalusChttps://www.blogger.com/profile/00299057045960008647noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-39158758617200847262008-11-13T13:57:00.000+01:002008-11-13T13:57:00.000+01:00Brilliant piece! I have one question: does the s...Brilliant piece! I have one question: does the scope of the managed bean have to be "session"? If so, can you point me to where this is documented?botski007https://www.blogger.com/profile/10074688088456369594noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-88815190766648016892008-09-15T18:17:00.000+02:002008-09-15T18:17:00.000+02:00Got it! I just read the article very minutely! Tha...Got it! I just read the article very minutely! ThanksKavitahttps://www.blogger.com/profile/01298591731669243472noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-55593257895832009082008-09-14T03:11:00.000+02:002008-09-14T03:11:00.000+02:00Sorry, that's already been explained in the articl...Sorry, that's already been explained in the article's text. Read it carefully. Learn about the JSF lifecycle. Copy the provided code example unchanged to your sandbox environment and play with it.BalusChttps://www.blogger.com/profile/00299057045960008647noreply@blogger.com