- This topic has 5 replies, 3 voices, and was last updated 18 years, 6 months ago by
Entry.
-
AuthorPosts
-
AsiaMemberI have noticed that using h:inputText tag on a JSF page does not set the property value in the manged bean after the value is modified on the web page.
If I set the initial value, it is displayed on the form, if I set validator method on this field it is called, if I set valueChangeListener method it is called, the action method on the button is called, it all seam to be working fine except that when I modify field value through the page the set method on the property is not called (with or without validator and valueChangeListener defined). What am I missing here?
I also noticed that in the source mode, the property sheet for the h:inputText has the following attribute ‘Initial text’ which when set generates the ‘value’ attribute of the h:inputText. Essentially there is no ‘value’ attribute on the property sheet. It might be be just the wrong label on the property sheet, or it may be that the only way to set the property value is by calling the valueChangeListener method. Which way is it?
I have the following code:
home.jsp: <h:inputText id="questionDescription" value="#{Question.longQuestionDscr}"></h:inputText> <h:commandButton value="#{bundle.preview_button}" action="#{Question.previewForm}" immediate="true"> </h:commandButton> QuestionBean.java: private String longQuestionDscr; public String getLongQuestionDscr() { return longQuestionDscr; } public void setLongQuestionDscr(String longQuestionDscr) { this.longQuestionDscr = longQuestionDscr; } faces-config.xml: <managed-bean> <managed-bean-name>Question</managed-bean-name> <managed-bean-class> com.mycomp.jsf.QuestionBean </managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>longQuestionDscr</property-name> <property-class>java.lang.String</property-class> <null-value></null-value> </managed-property> </managed-bean>
BTW, I run the JSFLoginDemo example to see if that one would behave any differently and no luck there, it seam that setUserName is not called after entering userName.
– System Setup ——————————-
*** Date: Mon Oct 09 22:20:01 PDT 2006*** System properties:
OS=WindowsXP
OS version=5.1
Java version=1.4.2_12*** MyEclipse details:
MyEclipse Enterprise WorkbenchVersion: 5.0 GA
Build id: 20060805-5.0-GA*** Eclipse details:
MyEclipse Enterprise WorkbenchVersion: 5.0.1 GA
Build id: 20060810-5.0.1-GAEclipse Platform
Version: 3.2.1.r321_v20060921-b_XVA-INSQSyMtx
Build id: M20060629-1905Eclipse Java Development Tools
Version: 3.2.1.r321_v20060905-R4CM1Znkvre9wC-
Build id: M20060921-0945Eclipse Project SDK
Version: 3.2.1.r321_v20060801-tQ1w49KnTArT0FZ
Build id: M20060921-0945Eclipse RCP
Version: 3.2.1.r321_v20060801-2ekW2BxmcpPUOoq
Build id: M20060629-1905Eclipse Plug-in Development Environment
Version: 3.2.1.r321_v20060823-6vYLLdQ3Nk8DrFG
Build id: M20060921-0945Eclipse Graphical Editing Framework
Version: 3.2.0.v20060626
Build id: 20060627-0816Eclipse startup command=-os
win32
-ws
win32
-arch
x86
-launcher
C:\eclipse\eclipse.exe
-name
Eclipse
-showsplash
600
-exitdata
e38_74
-product
com.genuitec.myeclipse.product.ide
-vm
C:\j2sdk1.4.2_12\bin\javaw.exeMessage Body ——————————-
Here is a message I found in the log (not sure if realted):
!ENTRY org.eclipse.ui 4 4 2006-10-09 22:04:29.812
!MESSAGE Unhandled event loop exception!ENTRY org.eclipse.ui 4 0 2006-10-09 22:04:30.640
!MESSAGE Widget is disposed
!STACK 0
org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:3374)
at org.eclipse.swt.SWT.error(SWT.java:3297)
at org.eclipse.swt.SWT.error(SWT.java:3268)
at org.eclipse.swt.widgets.Widget.error(Widget.java:435)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:330)
at org.eclipse.swt.widgets.Scrollable.getClientArea(Scrollable.java:151)
at com.genuitec.eclipse.webdesigner3.properties.ElementList.resizeColumns(ElementList.java:310)
at com.genuitec.eclipse.webdesigner3.properties.ElementList$3.run(ElementList.java:192)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)!ENTRY org.eclipse.ui 4 4 2006-10-09 22:04:30.718
!MESSAGE Unhandled event loop exception!ENTRY org.eclipse.ui 4 0 2006-10-09 22:04:30.734
!MESSAGE Widget is disposed
!STACK 0
org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:3374)
at org.eclipse.swt.SWT.error(SWT.java:3297)
at org.eclipse.swt.SWT.error(SWT.java:3268)
at org.eclipse.swt.widgets.Widget.error(Widget.java:435)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:330)
at org.eclipse.swt.widgets.Scrollable.getClientArea(Scrollable.java:151)
at com.genuitec.eclipse.webdesigner3.properties.ElementList.resizeColumns(ElementList.java:310)
at com.genuitec.eclipse.webdesigner3.properties.ElementList$3.run(ElementList.java:192)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)!ENTRY org.eclipse.wst.validation 4 0 2006-10-09 22:04:42.015
!MESSAGE
*** ERROR ***: Mon Oct 09 22:04:42 PDT 2006 org.eclipse.wst.validation.internal.core.ValidationException: IWAE0053E An internal error has occurred running validation on project:SIPS Enterprise]:SIPS Enterprise, check the log file for details
at org.eclipse.jst.j2ee.model.internal.validation.EarValidator.validateInJob(EarValidator.java:165)
at org.eclipse.jst.j2ee.internal.validation.UIEarValidator.validateInJob(UIEarValidator.java:217)
at org.eclipse.wst.validation.internal.operations.ValidatorJob.run(ValidatorJob.java:70)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)!ENTRY org.eclipse.wst.validation 4 0 2006-10-09 22:04:42.031
!MESSAGE
*** ERROR ***: Mon Oct 09 22:04:42 PDT 2006 org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException: META-INF/application.xml
Stack trace of nested exception:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.EmptyResourceException: platform:/resource/SIPS Enterprise/EarContent/META-INF/application.xml
at org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil.getRoot(ArchiveUtil.java:395)
at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.XmlBasedImportStrategyImpl.primLoadDeploymentDescriptor(XmlBasedImportStrategyImpl.java:42)
at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.Ear12ImportStrategyImpl.loadDeploymentDescriptor(Ear12ImportStrategyImpl.java:87)
at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.Ear12ImportStrategyImpl.importMetaData(Ear12ImportStrategyImpl.java:81)
at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EARFileImpl.getDeploymentDescriptor(EARFileImpl.java:296)
at org.eclipse.jst.j2ee.model.internal.validation.EarValidator.validateInJob(EarValidator.java:142)
at org.eclipse.jst.j2ee.internal.validation.UIEarValidator.validateInJob(UIEarValidator.java:217)
at org.eclipse.wst.validation.internal.operations.ValidatorJob.run(ValidatorJob.java:70)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)!ENTRY org.eclipse.wst.validation 4 0 2006-10-09 22:04:47.531
!MESSAGE
*** ERROR ***: Mon Oct 09 22:04:47 PDT 2006 org.eclipse.wst.validation.internal.core.ValidationException: IWAE0053E An internal error has occurred running validation on project:SIPS Enterprise]:SIPS Enterprise, check the log file for details
at org.eclipse.jst.j2ee.model.internal.validation.EarValidator.validateInJob(EarValidator.java:165)
at org.eclipse.jst.j2ee.internal.validation.UIEarValidator.validateInJob(UIEarValidator.java:217)
at org.eclipse.wst.validation.internal.operations.ValidatorJob.run(ValidatorJob.java:70)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)!ENTRY org.eclipse.wst.validation 4 0 2006-10-09 22:04:47.562
!MESSAGE
*** ERROR ***: Mon Oct 09 22:04:47 PDT 2006 org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException: META-INF/application.xml
Stack trace of nested exception:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.EmptyResourceException: platform:/resource/SIPS Enterprise/EarContent/META-INF/application.xml
at org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil.getRoot(ArchiveUtil.java:395)
at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.XmlBasedImportStrategyImpl.primLoadDeploymentDescriptor(XmlBasedImportStrategyImpl.java:42)
at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.Ear12ImportStrategyImpl.loadDeploymentDescriptor(Ear12ImportStrategyImpl.java:87)
at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.Ear12ImportStrategyImpl.importMetaData(Ear12ImportStrategyImpl.java:81)
at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EARFileImpl.getDeploymentDescriptor(EARFileImpl.java:296)
at org.eclipse.jst.j2ee.model.internal.validation.EarValidator.validateInJob(EarValidator.java:142)
at org.eclipse.jst.j2ee.internal.validation.UIEarValidator.validateInJob(UIEarValidator.java:217)
at org.eclipse.wst.validation.internal.operations.ValidatorJob.run(ValidatorJob.java:70)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)!ENTRY com.genuitec.eclipse.webdesigner3 1 0 2006-10-09 22:06:02.968
!MESSAGE Unable to synchronize source selection.
Riyad KallaMemberMoving to OT > Soft Dev
Asia, are you using Sun RI or MyFaces right now? The first thing I do when using JSF on a project, when I run into a *very* obscure bug like this is upgrade my JSF libraries. JSF 1.0 and initial RI 1.1 releases were so buggy for me that running into behaviors like this was the norm, rather than the exception. Just recently I was working on a JSF 1.2 application (on Glassfish) and ran into almost no bugs which was nice. But before we go too far really racking your brain try and see if this is a) a caching issue or b) a bug. Have you tried other browsers? Are you using client or server save state?
AsiaMemberI hate to report this, but I tried Sun’s JSF 1.1 and 1.2 and MyFace 1.1 and I haven’t seen any difference in behavior. I have been saving state on client and Also I tried saving state on server, again no difference in behavior. Still the same problem exists.
Riyad KallaMemberwell that is certainly strange… so the behavior is:
1) Fill out form
2) Submit
3) Hit back
4) Change some value, like username
5) ResubmitAnd the value in the managed bean is still the value from step #2?
AsiaMemberProblem is solved. I had a ‘immediate’ attribute on the form button set to True. This prevented properties of the managed bean from being set. After removing the attribute it all works fine.
Thanks for the assistance.
EntryMemberi have the same problem.
could you describe the exact steps for resolving the problem?
i can’t seem to find the right options.thanks
-
AuthorPosts