You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Raj .G. Narasimhan" <go...@gmail.com> on 2008/02/21 03:34:51 UTC
[tobago] :Issue with ValueChangeEvent & Validator
I am trying to show the details of 'SelectItem' object of SelectOneListBox
on a set of Input fields. Problem that I am facing is, whenever the page is
rendered partially, it always returns the 'value' of SelectOneListBox as
null. I have tried using both 'change' and 'click' facets, and both of them
are not giving the desired results.
Here's the scenario, in little detail:
When I use, 'click' facet, and tried to select different list items:
** In the valueChangeEvent, everytime it's retaining the initially set value
(First item of List box, which I set when I render the panel for the first
time) .
** getValue() of the source component in the valueChange event, is
supposedly returning the binding value, if the current value is null. And, I
guess, this is the reason, it retains the old value, if the current
localvalue is null.
** After this listerner call, it tries to set the value of the
SelectOneListBox's bound value as null, and this results in NPException, as
the 'DetailPanel's fields are this object's properties.
** I tried intercepting with a Validator - Surprisingly, this is not called
at all...
When I use "Change" facet and tried to select different list items:
** ValueChangeEvent does not occur at all
**Agreeably, 'change' facet's command is also not called
**No validator call is made
Here's the code snippet:
*<tc:panel id="orderPanel">
....
...
<tc:box label="#{rsrcBundle.order_orderListLabel}">
<f:facet name="layout">
<tc:gridLayout rows="*" columns="*" margin="2px" />
</f:facet>
<tc:selectOneListbox value="#{orderPanelController.order}"
valueChangeListener="#{orderPanelController.showInDetail}"
validator="#{orderPanelController.validateListSelection}">
<f:selectItems value="#{orderPanelController.orders}" />
<f:converter converterId="deviceOrderId" />
<f:facet name="click">
<tc:command action="#{orderPanelController.returnNull}">
<tc:attribute value=":cdbmainpage:orderPanel"
name="renderedPartially" />
</tc:command>
</f:facet>
<%-- I tired the same command with 'change' facet' also %>
</tc:selectOneListbox>
</tc:box>
<tc:panel id="orderDetailPanel">*
....
..
OrderPanelController:
*public void showInDetail(ValueChangeEvent valChangeEvent) {
UISelectOne select = (UISelectOne)valChangeEvent.getComponent();
if(select.getValue() == null){
LOG.finer("Value is null");
return;
}
order = (DeviceOrder) select.getValue();
LOG.finer("Selected Order: "+select.getValue());
return;
}
public void validateListSelection(FacesContext context, UIComponent
component, Object value) throws ValidatorException {
if (value == null) {
System.out.println("List validation:Came here : Value is null");
return;
}
order = (DeviceOrder) value;
LOG.finer("Selected order in validation: "+order);
}
*
Appreciate your help!*
*--
Thanks,
Raj .G. Narasimhan
Re: [tobago] :Issue with ValueChangeEvent & Validator
Posted by "Raj .G. Narasimhan" <go...@gmail.com>.
This is to update on the <tc:selectOneBox> valuechangeListenerEvent issue...
I was making conversion error in my list objects' converter, which was
returning 'null' as it was not able to find the 'object' in the Map....
Now, it works fine! Thanks Volker!
-R
On Mon, Feb 25, 2008 at 10:08 AM, Raj .G. Narasimhan <go...@gmail.com>
wrote:
> Volker, I will provide you one...by tomorrow...
>
> regards,
> -R
>
>
> On Mon, Feb 25, 2008 at 3:31 AM, Volker Weber <v....@inexso.de> wrote:
>
> > Hi Raj,
> >
> > i can't reproduce this behavior.
> > Can you provide a small example (if possible as diff on
> > tobago-example-demo) to reproduce this?
> >
> >
> > Regards,
> > Volker
> >
> > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > Volker, here're the log msgs, which might give you somewhat clear
> > picture of
> > > what's going on....
> > >
> > > Appreciate your efforts..!
> > >
> > > 10:06:15,963 INFO [AjaxUtils] ajaxComponentIds =
> > "cdbmainpage:orderPanel"
> > > 10:06:15,963 INFO [AjaxUtils] ajaxComponent for
> > "cdbmainpage:orderPanel" =
> > > "org.apache.myfaces.tobago.component.UIPanel@1ee4dbe"
> > > 2008-02-21 10:06:15: OrderPanelController::showInDetail():
> > > Selected Order: NA9
> > > 2008-02-21 10:06:15: OrderPanelController::setOrder():
> > > Setting Order: null
> > >
> > > Consequently, the following is the trace, as the order is getting set
> > to
> > > Null, everytime, even though the Value change listener is showing the
> > > getValue() of the SelectListOneBox component, is keep on retaining the
> > > initially set value (NA9)...as you can see:
> > >
> > > Feb 21, 2008 10:06:16 AM
> > > org.apache.catalina.core.StandardWrapperValve invoke
> > > SEVERE: Servlet.service() for servlet Faces Servlet threw exception
> > > java.lang.NullPointerException
> > > at
> > > com.uunet.es3.controller.OrderPanelController.getStatus(
> > OrderPanelController.java:101)
> > > 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:585)
> > > at
> > > org.apache.myfaces.el.PropertyResolverImpl.getProperty(
> > PropertyResolverImpl.java:457)
> > > at
> > > org.apache.myfaces.el.PropertyResolverImpl.getValue(
> > PropertyResolverImpl.java:85)
> > > at
> > > org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(
> > ELParserHelper.java:535)
> > > at
> > > org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
> > > at
> > > org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java
> > :386)
> > > at
> > > javax.faces.component.UIOutput.getValue(UIOutput.java:80)
> > > 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:585)
> > > at
> > > javax.faces.component._ComponentAttributesMap.getComponentProperty
> > (_ComponentAttributesMap.java:387)
> > > at
> > > javax.faces.component._ComponentAttributesMap.get
> > (_ComponentAttributesMap.java:235)
> > > at
> > > org.apache.myfaces.tobago.renderkit.LabelWithAccessKey.<init>(
> > LabelWithAccessKey.java:43)
> > > at
> > >
> > org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.LabelRenderer.encodeEnd
> > (LabelRenderer.java:79)
> > > at
> > > javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java
> > :539)
> > > at
> > > org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java
> > :86)
> > > at
> > >
> > org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent
> > (GridLayoutRenderer.java:379)
> > > at
> > > org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent
> > (UILayout.java:70)
> > > at
> > >
> > org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent
> > (UIGridLayout.java:276)
> > > at
> > > org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(
> > UIPanelBase.java:43)
> > > at
> > > org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java
> > :79)
> > > at
> > >
> > org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent
> > (GridLayoutRenderer.java:379)
> > > at
> > > org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent
> > (UILayout.java:70)
> > > at
> > >
> > org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent
> > (UIGridLayout.java:276)
> > > at
> > > org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(
> > UIPanelBase.java:43)
> > > at
> > > org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java
> > :79)
> > > at
> > >
> > org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent
> > (GridLayoutRenderer.java:379)
> > > at
> > > org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent
> > (UILayout.java:70)
> > > at
> > >
> > org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent
> > (UIGridLayout.java:276)
> > > at
> > > org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(
> > UIPanelBase.java:43)
> > > at
> > > org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java
> > :79)
> > > at
> > >
> > org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent
> > (GridLayoutRenderer.java:379)
> > > at
> > > org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent
> > (UILayout.java:70)
> > > at
> > >
> > org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent
> > (UIGridLayout.java:276)
> > > at
> > > org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(
> > UIPanelBase.java:43)
> > > at
> > >
> > org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.PanelRenderer.encodeAjax
> > (PanelRenderer.java:173)
> > > at
> > > org.apache.myfaces.tobago.ajax.api.AjaxUtils.encodeAjaxComponent(
> > AjaxUtils.java:67)
> > > at
> > > org.apache.myfaces.tobago.component.UIPanelBase.encodeAjax(
> > UIPanelBase.java:48)
> > > at
> > > org.apache.myfaces.tobago.util.EncodeAjaxCallback.execute(
> > EncodeAjaxCallback.java:32)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> > ComponentUtil.java:1246)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent
> > (ComponentUtil.java:1278)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> > ComponentUtil.java:1252)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent
> > (ComponentUtil.java:1278)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> > ComponentUtil.java:1252)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent
> > (ComponentUtil.java:1278)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> > ComponentUtil.java:1252)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent
> > (ComponentUtil.java:1278)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> > ComponentUtil.java:1252)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent
> > (ComponentUtil.java:1278)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> > ComponentUtil.java:1252)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent
> > (ComponentUtil.java:1278)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> > ComponentUtil.java:1252)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent
> > (ComponentUtil.java:1278)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> > ComponentUtil.java:1252)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent
> > (ComponentUtil.java:1278)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> > ComponentUtil.java:1252)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent
> > (ComponentUtil.java:1278)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> > ComponentUtil.java:1252)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIForm(
> > ComponentUtil.java:1271)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> > ComponentUtil.java:1250)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent
> > (ComponentUtil.java:1278)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> > ComponentUtil.java:1252)
> > > at
> > > org.apache.myfaces.tobago.component.ComponentUtil.invokeOnComponent(
> > ComponentUtil.java:1240)
> > > at
> > >
> > org.apache.myfaces.tobago.ajax.api.AjaxResponseRenderer.renderComponent(
> > AjaxResponseRenderer.java:140)
> > > at
> > > org.apache.myfaces.tobago.ajax.api.AjaxResponseRenderer.renderResponse
> > (AjaxResponseRenderer.java:120)
> > > at
> > > org.apache.myfaces.tobago.lifecycle.RenderResponseExecutor.execute(
> > RenderResponseExecutor.java:47)
> > > at
> > > org.apache.myfaces.tobago.lifecycle.TobagoLifecycle.render(
> > TobagoLifecycle.java:141)
> > > at
> > > javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
> > > at
> > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> > ApplicationFilterChain.java:290)
> > > at
> > > org.apache.catalina.core.ApplicationFilterChain.doFilter(
> > ApplicationFilterChain.java:206)
> > > at
> > >
> > org.apache.myfaces.tobago.webapp.TobagoMultipartFormdataFilter.doFilter(
> > TobagoMultipartFormdataFilter.java:127)
> > > at
> > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> > ApplicationFilterChain.java:235)
> > > at
> > > org.apache.catalina.core.ApplicationFilterChain.doFilter(
> > ApplicationFilterChain.java:206)
> > > at
> > > org.apache.catalina.core.StandardWrapperValve.invoke(
> > StandardWrapperValve.java:233)
> > > at
> > > org.apache.catalina.core.StandardContextValve.invoke(
> > StandardContextValve.java:175)
> > > at
> > > org.apache.catalina.core.StandardHostValve.invoke(
> > StandardHostValve.java:128)
> > > at
> > > org.apache.catalina.valves.ErrorReportValve.invoke(
> > ErrorReportValve.java:102)
> > > at
> > > org.apache.catalina.core.StandardEngineValve.invoke(
> > StandardEngineValve.java:109)
> > > at
> > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> > :286)
> > > at
> > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
> > :844)
> > > at
> > >
> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
> > Http11Protocol.java:583)
> > > at
> > > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java
> > :447)
> > > at java.lang.Thread.run(Thread.java:595)
> > >
> > >
> > > On Thu, Feb 21, 2008 at 10:13 AM, Raj .G. Narasimhan <
> > gopalnrg@gmail.com>
> > > wrote:
> > > > Currently, I'm using 1.0.15...(since two days)...Previously, I
> > started the
> > > development with 1.0.13....
> > > >
> > > > thanks,
> > > > -R
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Thu, Feb 21, 2008 at 10:09 AM, Volker Weber <v....@inexso.de>
> > wrote:
> > > >
> > > > > Which version of tobago? I'm trying to reproduce this.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > > > Yes, I did....Volker... But, there is none...
> > > > > >
> > > > > > thanks,
> > > > > > -R
> > > > > >
> > > > > >
> > > > > > On Thu, Feb 21, 2008 at 9:59 AM, Volker Weber <v.weber@inexso.de
> > >
> > > wrote:
> > > > > > > than it should work!
> > > > > > >
> > > > > > > can you add a tc:messages tag inside the orderPanel to ensure
> > there
> > > > > > > are no conversion/validation errors.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > > > > > Thanks Volker, for the reply!
> > > > > > > >
> > > > > > > > The SelectOneListBox with the facet, is within the rendered
> > panel
> > > > > > > > (orderPanel which encloses both this selectListOneBox
> > component,
> > > as well
> > > > > > as
> > > > > > > > the 'orderDetailPanel'). Hence, I expected the value of
> > > > > > SelectOneListBox,
> > > > > > > > to be processed. And, it's not.
> > > > > > > >
> > > > > > > > I will try with the other two options....
> > > > > > > >
> > > > > > > > Appreciate it!
> > > > > > > >
> > > > > > > > tx,
> > > > > > > > -R
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > <tc:panel id="orderPanel">
> > > > > > > > ....
> > > > > > > > ...
> > > > > > > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > > > > > > <f:facet name="layout">
> > > > > > > > <tc:gridLayout rows="*" columns="*" margin="2px"
> > />
> > > > > > > > </f:facet>
> > > > > > > > <tc:selectOneListbox value="#{
> > orderPanelController.order}"
> > > > > > > >
> > > > > > > >
> > > > > >
> > > valueChangeListener="#{orderPanelController.showInDetail}"
> > > > > > > >
> > > > > > > >
> > > > > >
> > > validator="#{orderPanelController.validateListSelection}">
> > > > > > > > <f:selectItems value="#{
> > orderPanelController.orders}"
> > > />
> > > > > > > > <f:converter converterId="deviceOrderId" />
> > > > > > > >
> > > > > > > > <f:facet name="click">
> > > > > > > > <tc:command
> > > action="#{orderPanelController.returnNull}">
> > > > > > > > <tc:attribute
> > value=":cdbmainpage:orderPanel"
> > > > > > > > name="renderedPartially" />
> > > > > > > > </tc:command>
> > > > > > > > </f:facet>
> > > > > > > > <%-- I tired the same command with 'change' facet' also %>
> > > > > > > > </tc:selectOneListbox>
> > > > > > > >
> > > > > > > > </tc:box>
> > > > > > > >
> > > > > > > > <tc:panel id="orderDetailPanel">
> > > > > > > >
> > > > > > > >
> > > > > > > > On Thu, Feb 21, 2008 at 3:22 AM, Volker Weber <
> > v.weber@inexso.de>
> > > > > > wrote:
> > > > > > > > > Hi Raj,
> > > > > > > > >
> > > > > > > > > if i interpret your code snippet correct,
> > > > > > > > >
> > > > > > > > > the selectOneListbox with the click/change facet is NOT
> > inside
> > > the
> > > > > > > > > partially rendered panel. This is the problem, only the
> > content
> > > of the
> > > > > > > > > partiallyRendered component is processed on the server.
> > > > > > > > >
> > > > > > > > > you have two(tree) choices:
> > > > > > > > > 1. include the listbox into the renderedPartially scope.
> > > > > > > > > 2. invoke the processing of listbox lifecycle in your
> > action.
> > > > > > > > > UIComponent listbox =
> > > facesContext.getViewRoot().findComponent(<id
> > > > > > > > > of listbox>);
> > > > > > > > > listbox.processDecodes(facesContect);
> > > > > > > > > listbox.processValidations(facesContect);
> > > > > > > > > listbox.processUpdates(facesContect);
> > > > > > > > >
> > > > > > > > > 3.(experimental) use 1.1-SNAPSHOT version.
> > > > > > > > > you can declare full page to be submitted (and processed)
> > > partially
> > > > > > and
> > > > > > > > > in your action method remove the page and add orderPanel
> > > from/to the
> > > > > > > > > partially
> > > > > > > > > component list.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Regards,
> > > > > > > > > Volker
> > > > > > > > >
> > > > > > > > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > I am trying to show the details of 'SelectItem' object
> > of
> > > > > > > > SelectOneListBox
> > > > > > > > > > on a set of Input fields. Problem that I am facing is,
> > > whenever the
> > > > > > page
> > > > > > > > is
> > > > > > > > > > rendered partially, it always returns the 'value' of
> > > > > > SelectOneListBox as
> > > > > > > > > > null. I have tried using both 'change' and 'click'
> > facets,
> > > and both
> > > > > > of
> > > > > > > > them
> > > > > > > > > > are not giving the desired results.
> > > > > > > > > >
> > > > > > > > > > Here's the scenario, in little detail:
> > > > > > > > > >
> > > > > > > > > > When I use, 'click' facet, and tried to select different
> > list
> > > items:
> > > > > > > > > >
> > > > > > > > > > ** In the valueChangeEvent, everytime it's retaining the
> > > initially
> > > > > > set
> > > > > > > > value
> > > > > > > > > > (First item of List box, which I set when I render the
> > panel
> > > for the
> > > > > > > > first
> > > > > > > > > > time) .
> > > > > > > > > >
> > > > > > > > > > ** getValue() of the source component in the valueChange
> > > event, is
> > > > > > > > > > supposedly returning the binding value, if the current
> > value
> > > is
> > > > > > null.
> > > > > > > > And, I
> > > > > > > > > > guess, this is the reason, it retains the old value, if
> > the
> > > current
> > > > > > > > > > localvalue is null.
> > > > > > > > > >
> > > > > > > > > > ** After this listerner call, it tries to set the value
> > of the
> > > > > > > > > > SelectOneListBox's bound value as null, and this results
> > in
> > > > > > NPException,
> > > > > > > > as
> > > > > > > > > > the 'DetailPanel's fields are this object's properties.
> > > > > > > > > >
> > > > > > > > > > ** I tried intercepting with a Validator -
> > Surprisingly, this
> > > is
> > > > > > not
> > > > > > > > called
> > > > > > > > > > at all...
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > When I use "Change" facet and tried to select different
> > list
> > > items:
> > > > > > > > > > ** ValueChangeEvent does not occur at all
> > > > > > > > > > **Agreeably, 'change' facet's command is also not
> > called
> > > > > > > > > > **No validator call is made
> > > > > > > > > >
> > > > > > > > > > Here's the code snippet:
> > > > > > > > > > <tc:panel id="orderPanel">
> > > > > > > > > > ....
> > > > > > > > > > ...
> > > > > > > > > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > > > > > > > > <f:facet name="layout">
> > > > > > > > > > <tc:gridLayout rows="*" columns="*"
> > margin="2px"
> > > />
> > > > > > > > > > </f:facet>
> > > > > > > > > > <tc:selectOneListbox
> > > value="#{orderPanelController.order}"
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > >
> > > > > >
> > > valueChangeListener="#{orderPanelController.showInDetail}"
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > >
> > > > > >
> > > validator="#{orderPanelController.validateListSelection}">
> > > > > > > > > > <f:selectItems
> > > value="#{orderPanelController.orders}" />
> > > > > > > > > > <f:converter converterId="deviceOrderId" />
> > > > > > > > > >
> > > > > > > > > > <f:facet name="click">
> > > > > > > > > > <tc:command
> > > > > > action="#{orderPanelController.returnNull}">
> > > > > > > > > > <tc:attribute
> > > value=":cdbmainpage:orderPanel"
> > > > > > > > > > name="renderedPartially" />
> > > > > > > > > > </tc:command>
> > > > > > > > > > </f:facet>
> > > > > > > > > > <%-- I tired the same command with 'change' facet' also
> > %>
> > > > > > > > > > </tc:selectOneListbox>
> > > > > > > > > >
> > > > > > > > > > </tc:box>
> > > > > > > > > >
> > > > > > > > > > <tc:panel id="orderDetailPanel">
> > > > > > > > > > ....
> > > > > > > > > > ..
> > > > > > > > > >
> > > > > > > > > > OrderPanelController:
> > > > > > > > > > public void showInDetail(ValueChangeEvent
> > valChangeEvent) {
> > > > > > > > > > UISelectOne select =
> > > > > > > > > > (UISelectOne)valChangeEvent.getComponent();
> > > > > > > > > > if(select.getValue() == null){
> > > > > > > > > > LOG.finer("Value is null");
> > > > > > > > > > return;
> > > > > > > > > > }
> > > > > > > > > > order = (DeviceOrder) select.getValue();
> > > > > > > > > > LOG.finer("Selected Order: "+select.getValue());
> > > > > > > > > > return;
> > > > > > > > > > }
> > > > > > > > > >
> > > > > > > > > > public void
> > > validateListSelection(FacesContext
> > > > > > context,
> > > > > > > > > > UIComponent component, Object value) throws
> > ValidatorException
> > > {
> > > > > > > > > > if (value == null) {
> > > > > > > > > > System.out.println("List validation:Came
> > here :
> > > Value is
> > > > > > > > null");
> > > > > > > > > > return;
> > > > > > > > > > }
> > > > > > > > > > order = (DeviceOrder) value;
> > > > > > > > > > LOG.finer("Selected order in validation:
> > "+order);
> > > > > > > > > > }
> > > > > > > > > >
> > > > > > > > > > Appreciate your help!
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Thanks,
> > > > > > > > > >
> > > > > > > > > > Raj .G. Narasimhan
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > inexso - information exchange solutions GmbH
> > > > > > > > > Bismarckstraße 13 | 26122 Oldenburg
> > > > > > > > > Tel.: +49 441 4082 356 |
> > > > > > > > > FAX: +49 441 4082 355 | www.inexso.de
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Thanks,
> > > > > > > >
> > > > > > > > Raj .G. Narasimhan
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > inexso - information exchange solutions GmbH
> > > > > > > Bismarckstraße 13 | 26122 Oldenburg
> > > > > > > Tel.: +49 441 4082 356 |
> > > > > > > FAX: +49 441 4082 355 | www.inexso.de
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Thanks,
> > > > > >
> > > > > > Raj .G. Narasimhan
> > > > >
> > > > >
> > > > > --
> > > > >
> > > > >
> > > > >
> > > > > inexso - information exchange solutions GmbH
> > > > > Bismarckstraße 13 | 26122 Oldenburg
> > > > > Tel.: +49 441 4082 356 |
> > > > > FAX: +49 441 4082 355 | www.inexso.de
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Thanks,
> > > >
> > > > Raj .G. Narasimhan
> > >
> > >
> > >
> > > --
> > > Thanks,
> > >
> > > Raj .G. Narasimhan
> >
> >
> > --
> > inexso - information exchange solutions GmbH
> > Bismarckstraße 13 | 26122 Oldenburg
> > Tel.: +49 441 4082 356 |
> > FAX: +49 441 4082 355 | www.inexso.de
> >
>
>
>
> --
> Thanks,
>
> Raj .G. Narasimhan
--
Thanks,
Raj .G. Narasimhan
Re: [tobago] :Issue with ValueChangeEvent & Validator
Posted by "Raj .G. Narasimhan" <go...@gmail.com>.
Volker, I will provide you one...by tomorrow...
regards,
-R
On Mon, Feb 25, 2008 at 3:31 AM, Volker Weber <v....@inexso.de> wrote:
> Hi Raj,
>
> i can't reproduce this behavior.
> Can you provide a small example (if possible as diff on
> tobago-example-demo) to reproduce this?
>
>
> Regards,
> Volker
>
> 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > Volker, here're the log msgs, which might give you somewhat clear
> picture of
> > what's going on....
> >
> > Appreciate your efforts..!
> >
> > 10:06:15,963 INFO [AjaxUtils] ajaxComponentIds =
> "cdbmainpage:orderPanel"
> > 10:06:15,963 INFO [AjaxUtils] ajaxComponent for
> "cdbmainpage:orderPanel" =
> > "org.apache.myfaces.tobago.component.UIPanel@1ee4dbe"
> > 2008-02-21 10:06:15: OrderPanelController::showInDetail():
> > Selected Order: NA9
> > 2008-02-21 10:06:15: OrderPanelController::setOrder():
> > Setting Order: null
> >
> > Consequently, the following is the trace, as the order is getting set to
> > Null, everytime, even though the Value change listener is showing the
> > getValue() of the SelectListOneBox component, is keep on retaining the
> > initially set value (NA9)...as you can see:
> >
> > Feb 21, 2008 10:06:16 AM
> > org.apache.catalina.core.StandardWrapperValve invoke
> > SEVERE: Servlet.service() for servlet Faces Servlet threw exception
> > java.lang.NullPointerException
> > at
> > com.uunet.es3.controller.OrderPanelController.getStatus(
> OrderPanelController.java:101)
> > 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:585)
> > at
> > org.apache.myfaces.el.PropertyResolverImpl.getProperty(
> PropertyResolverImpl.java:457)
> > at
> > org.apache.myfaces.el.PropertyResolverImpl.getValue(
> PropertyResolverImpl.java:85)
> > at
> > org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(
> ELParserHelper.java:535)
> > at
> > org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
> > at
> > org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java
> :386)
> > at
> > javax.faces.component.UIOutput.getValue(UIOutput.java:80)
> > 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:585)
> > at
> > javax.faces.component._ComponentAttributesMap.getComponentProperty
> (_ComponentAttributesMap.java:387)
> > at
> > javax.faces.component._ComponentAttributesMap.get
> (_ComponentAttributesMap.java:235)
> > at
> > org.apache.myfaces.tobago.renderkit.LabelWithAccessKey.<init>(
> LabelWithAccessKey.java:43)
> > at
> >
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.LabelRenderer.encodeEnd
> (LabelRenderer.java:79)
> > at
> > javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java
> :539)
> > at
> > org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java
> :86)
> > at
> >
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent
> (GridLayoutRenderer.java:379)
> > at
> > org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(
> UILayout.java:70)
> > at
> >
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent
> (UIGridLayout.java:276)
> > at
> > org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(
> UIPanelBase.java:43)
> > at
> > org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java
> :79)
> > at
> >
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent
> (GridLayoutRenderer.java:379)
> > at
> > org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(
> UILayout.java:70)
> > at
> >
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent
> (UIGridLayout.java:276)
> > at
> > org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(
> UIPanelBase.java:43)
> > at
> > org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java
> :79)
> > at
> >
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent
> (GridLayoutRenderer.java:379)
> > at
> > org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(
> UILayout.java:70)
> > at
> >
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent
> (UIGridLayout.java:276)
> > at
> > org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(
> UIPanelBase.java:43)
> > at
> > org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java
> :79)
> > at
> >
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent
> (GridLayoutRenderer.java:379)
> > at
> > org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(
> UILayout.java:70)
> > at
> >
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent
> (UIGridLayout.java:276)
> > at
> > org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(
> UIPanelBase.java:43)
> > at
> >
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.PanelRenderer.encodeAjax
> (PanelRenderer.java:173)
> > at
> > org.apache.myfaces.tobago.ajax.api.AjaxUtils.encodeAjaxComponent(
> AjaxUtils.java:67)
> > at
> > org.apache.myfaces.tobago.component.UIPanelBase.encodeAjax(
> UIPanelBase.java:48)
> > at
> > org.apache.myfaces.tobago.util.EncodeAjaxCallback.execute(
> EncodeAjaxCallback.java:32)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> ComponentUtil.java:1246)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
> ComponentUtil.java:1278)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> ComponentUtil.java:1252)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
> ComponentUtil.java:1278)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> ComponentUtil.java:1252)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
> ComponentUtil.java:1278)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> ComponentUtil.java:1252)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
> ComponentUtil.java:1278)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> ComponentUtil.java:1252)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
> ComponentUtil.java:1278)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> ComponentUtil.java:1252)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
> ComponentUtil.java:1278)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> ComponentUtil.java:1252)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
> ComponentUtil.java:1278)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> ComponentUtil.java:1252)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
> ComponentUtil.java:1278)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> ComponentUtil.java:1252)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
> ComponentUtil.java:1278)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> ComponentUtil.java:1252)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIForm(
> ComponentUtil.java:1271)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> ComponentUtil.java:1250)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
> ComponentUtil.java:1278)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
> ComponentUtil.java:1252)
> > at
> > org.apache.myfaces.tobago.component.ComponentUtil.invokeOnComponent(
> ComponentUtil.java:1240)
> > at
> > org.apache.myfaces.tobago.ajax.api.AjaxResponseRenderer.renderComponent(
> AjaxResponseRenderer.java:140)
> > at
> > org.apache.myfaces.tobago.ajax.api.AjaxResponseRenderer.renderResponse(
> AjaxResponseRenderer.java:120)
> > at
> > org.apache.myfaces.tobago.lifecycle.RenderResponseExecutor.execute(
> RenderResponseExecutor.java:47)
> > at
> > org.apache.myfaces.tobago.lifecycle.TobagoLifecycle.render(
> TobagoLifecycle.java:141)
> > at
> > javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
> > at
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:290)
> > at
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:206)
> > at
> > org.apache.myfaces.tobago.webapp.TobagoMultipartFormdataFilter.doFilter(
> TobagoMultipartFormdataFilter.java:127)
> > at
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:235)
> > at
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:206)
> > at
> > org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:233)
> > at
> > org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:175)
> > at
> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :128)
> > at
> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :102)
> > at
> > org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:109)
> > at
> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :286)
> > at
> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
> :844)
> > at
> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
> Http11Protocol.java:583)
> > at
> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> > at java.lang.Thread.run(Thread.java:595)
> >
> >
> > On Thu, Feb 21, 2008 at 10:13 AM, Raj .G. Narasimhan <gopalnrg@gmail.com
> >
> > wrote:
> > > Currently, I'm using 1.0.15...(since two days)...Previously, I started
> the
> > development with 1.0.13....
> > >
> > > thanks,
> > > -R
> > >
> > >
> > >
> > >
> > >
> > > On Thu, Feb 21, 2008 at 10:09 AM, Volker Weber <v....@inexso.de>
> wrote:
> > >
> > > > Which version of tobago? I'm trying to reproduce this.
> > > >
> > > >
> > > >
> > > >
> > > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > > Yes, I did....Volker... But, there is none...
> > > > >
> > > > > thanks,
> > > > > -R
> > > > >
> > > > >
> > > > > On Thu, Feb 21, 2008 at 9:59 AM, Volker Weber <v....@inexso.de>
> > wrote:
> > > > > > than it should work!
> > > > > >
> > > > > > can you add a tc:messages tag inside the orderPanel to ensure
> there
> > > > > > are no conversion/validation errors.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > > > > Thanks Volker, for the reply!
> > > > > > >
> > > > > > > The SelectOneListBox with the facet, is within the rendered
> panel
> > > > > > > (orderPanel which encloses both this selectListOneBox
> component,
> > as well
> > > > > as
> > > > > > > the 'orderDetailPanel'). Hence, I expected the value of
> > > > > SelectOneListBox,
> > > > > > > to be processed. And, it's not.
> > > > > > >
> > > > > > > I will try with the other two options....
> > > > > > >
> > > > > > > Appreciate it!
> > > > > > >
> > > > > > > tx,
> > > > > > > -R
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > <tc:panel id="orderPanel">
> > > > > > > ....
> > > > > > > ...
> > > > > > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > > > > > <f:facet name="layout">
> > > > > > > <tc:gridLayout rows="*" columns="*" margin="2px"
> />
> > > > > > > </f:facet>
> > > > > > > <tc:selectOneListbox value="#{
> orderPanelController.order}"
> > > > > > >
> > > > > > >
> > > > >
> > valueChangeListener="#{orderPanelController.showInDetail}"
> > > > > > >
> > > > > > >
> > > > >
> > validator="#{orderPanelController.validateListSelection}">
> > > > > > > <f:selectItems value="#{
> orderPanelController.orders}"
> > />
> > > > > > > <f:converter converterId="deviceOrderId" />
> > > > > > >
> > > > > > > <f:facet name="click">
> > > > > > > <tc:command
> > action="#{orderPanelController.returnNull}">
> > > > > > > <tc:attribute
> value=":cdbmainpage:orderPanel"
> > > > > > > name="renderedPartially" />
> > > > > > > </tc:command>
> > > > > > > </f:facet>
> > > > > > > <%-- I tired the same command with 'change' facet' also %>
> > > > > > > </tc:selectOneListbox>
> > > > > > >
> > > > > > > </tc:box>
> > > > > > >
> > > > > > > <tc:panel id="orderDetailPanel">
> > > > > > >
> > > > > > >
> > > > > > > On Thu, Feb 21, 2008 at 3:22 AM, Volker Weber <
> v.weber@inexso.de>
> > > > > wrote:
> > > > > > > > Hi Raj,
> > > > > > > >
> > > > > > > > if i interpret your code snippet correct,
> > > > > > > >
> > > > > > > > the selectOneListbox with the click/change facet is NOT
> inside
> > the
> > > > > > > > partially rendered panel. This is the problem, only the
> content
> > of the
> > > > > > > > partiallyRendered component is processed on the server.
> > > > > > > >
> > > > > > > > you have two(tree) choices:
> > > > > > > > 1. include the listbox into the renderedPartially scope.
> > > > > > > > 2. invoke the processing of listbox lifecycle in your
> action.
> > > > > > > > UIComponent listbox =
> > facesContext.getViewRoot().findComponent(<id
> > > > > > > > of listbox>);
> > > > > > > > listbox.processDecodes(facesContect);
> > > > > > > > listbox.processValidations(facesContect);
> > > > > > > > listbox.processUpdates(facesContect);
> > > > > > > >
> > > > > > > > 3.(experimental) use 1.1-SNAPSHOT version.
> > > > > > > > you can declare full page to be submitted (and processed)
> > partially
> > > > > and
> > > > > > > > in your action method remove the page and add orderPanel
> > from/to the
> > > > > > > > partially
> > > > > > > > component list.
> > > > > > > >
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > > Volker
> > > > > > > >
> > > > > > > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > > I am trying to show the details of 'SelectItem' object of
> > > > > > > SelectOneListBox
> > > > > > > > > on a set of Input fields. Problem that I am facing is,
> > whenever the
> > > > > page
> > > > > > > is
> > > > > > > > > rendered partially, it always returns the 'value' of
> > > > > SelectOneListBox as
> > > > > > > > > null. I have tried using both 'change' and 'click'
> facets,
> > and both
> > > > > of
> > > > > > > them
> > > > > > > > > are not giving the desired results.
> > > > > > > > >
> > > > > > > > > Here's the scenario, in little detail:
> > > > > > > > >
> > > > > > > > > When I use, 'click' facet, and tried to select different
> list
> > items:
> > > > > > > > >
> > > > > > > > > ** In the valueChangeEvent, everytime it's retaining the
> > initially
> > > > > set
> > > > > > > value
> > > > > > > > > (First item of List box, which I set when I render the
> panel
> > for the
> > > > > > > first
> > > > > > > > > time) .
> > > > > > > > >
> > > > > > > > > ** getValue() of the source component in the valueChange
> > event, is
> > > > > > > > > supposedly returning the binding value, if the current
> value
> > is
> > > > > null.
> > > > > > > And, I
> > > > > > > > > guess, this is the reason, it retains the old value, if
> the
> > current
> > > > > > > > > localvalue is null.
> > > > > > > > >
> > > > > > > > > ** After this listerner call, it tries to set the value of
> the
> > > > > > > > > SelectOneListBox's bound value as null, and this results
> in
> > > > > NPException,
> > > > > > > as
> > > > > > > > > the 'DetailPanel's fields are this object's properties.
> > > > > > > > >
> > > > > > > > > ** I tried intercepting with a Validator - Surprisingly,
> this
> > is
> > > > > not
> > > > > > > called
> > > > > > > > > at all...
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > When I use "Change" facet and tried to select different
> list
> > items:
> > > > > > > > > ** ValueChangeEvent does not occur at all
> > > > > > > > > **Agreeably, 'change' facet's command is also not called
> > > > > > > > > **No validator call is made
> > > > > > > > >
> > > > > > > > > Here's the code snippet:
> > > > > > > > > <tc:panel id="orderPanel">
> > > > > > > > > ....
> > > > > > > > > ...
> > > > > > > > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > > > > > > > <f:facet name="layout">
> > > > > > > > > <tc:gridLayout rows="*" columns="*"
> margin="2px"
> > />
> > > > > > > > > </f:facet>
> > > > > > > > > <tc:selectOneListbox
> > value="#{orderPanelController.order}"
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> > valueChangeListener="#{orderPanelController.showInDetail}"
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> > validator="#{orderPanelController.validateListSelection}">
> > > > > > > > > <f:selectItems
> > value="#{orderPanelController.orders}" />
> > > > > > > > > <f:converter converterId="deviceOrderId" />
> > > > > > > > >
> > > > > > > > > <f:facet name="click">
> > > > > > > > > <tc:command
> > > > > action="#{orderPanelController.returnNull}">
> > > > > > > > > <tc:attribute
> > value=":cdbmainpage:orderPanel"
> > > > > > > > > name="renderedPartially" />
> > > > > > > > > </tc:command>
> > > > > > > > > </f:facet>
> > > > > > > > > <%-- I tired the same command with 'change' facet' also
> %>
> > > > > > > > > </tc:selectOneListbox>
> > > > > > > > >
> > > > > > > > > </tc:box>
> > > > > > > > >
> > > > > > > > > <tc:panel id="orderDetailPanel">
> > > > > > > > > ....
> > > > > > > > > ..
> > > > > > > > >
> > > > > > > > > OrderPanelController:
> > > > > > > > > public void showInDetail(ValueChangeEvent valChangeEvent)
> {
> > > > > > > > > UISelectOne select =
> > > > > > > > > (UISelectOne)valChangeEvent.getComponent();
> > > > > > > > > if(select.getValue() == null){
> > > > > > > > > LOG.finer("Value is null");
> > > > > > > > > return;
> > > > > > > > > }
> > > > > > > > > order = (DeviceOrder) select.getValue();
> > > > > > > > > LOG.finer("Selected Order: "+select.getValue());
> > > > > > > > > return;
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > public void
> > validateListSelection(FacesContext
> > > > > context,
> > > > > > > > > UIComponent component, Object value) throws
> ValidatorException
> > {
> > > > > > > > > if (value == null) {
> > > > > > > > > System.out.println("List validation:Came here
> :
> > Value is
> > > > > > > null");
> > > > > > > > > return;
> > > > > > > > > }
> > > > > > > > > order = (DeviceOrder) value;
> > > > > > > > > LOG.finer("Selected order in validation: "+order);
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > Appreciate your help!
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Thanks,
> > > > > > > > >
> > > > > > > > > Raj .G. Narasimhan
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > inexso - information exchange solutions GmbH
> > > > > > > > Bismarckstraße 13 | 26122 Oldenburg
> > > > > > > > Tel.: +49 441 4082 356 |
> > > > > > > > FAX: +49 441 4082 355 | www.inexso.de
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Thanks,
> > > > > > >
> > > > > > > Raj .G. Narasimhan
> > > > > >
> > > > > >
> > > > > > --
> > > > > >
> > > > > >
> > > > > >
> > > > > > inexso - information exchange solutions GmbH
> > > > > > Bismarckstraße 13 | 26122 Oldenburg
> > > > > > Tel.: +49 441 4082 356 |
> > > > > > FAX: +49 441 4082 355 | www.inexso.de
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Thanks,
> > > > >
> > > > > Raj .G. Narasimhan
> > > >
> > > >
> > > > --
> > > >
> > > >
> > > >
> > > > inexso - information exchange solutions GmbH
> > > > Bismarckstraße 13 | 26122 Oldenburg
> > > > Tel.: +49 441 4082 356 |
> > > > FAX: +49 441 4082 355 | www.inexso.de
> > > >
> > >
> > >
> > >
> > > --
> > > Thanks,
> > >
> > > Raj .G. Narasimhan
> >
> >
> >
> > --
> > Thanks,
> >
> > Raj .G. Narasimhan
>
>
> --
> inexso - information exchange solutions GmbH
> Bismarckstraße 13 | 26122 Oldenburg
> Tel.: +49 441 4082 356 |
> FAX: +49 441 4082 355 | www.inexso.de
>
--
Thanks,
Raj .G. Narasimhan
Re: [tobago] :Issue with ValueChangeEvent & Validator
Posted by Volker Weber <v....@inexso.de>.
Hi Raj,
i can't reproduce this behavior.
Can you provide a small example (if possible as diff on
tobago-example-demo) to reproduce this?
Regards,
Volker
2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> Volker, here're the log msgs, which might give you somewhat clear picture of
> what's going on....
>
> Appreciate your efforts..!
>
> 10:06:15,963 INFO [AjaxUtils] ajaxComponentIds = "cdbmainpage:orderPanel"
> 10:06:15,963 INFO [AjaxUtils] ajaxComponent for "cdbmainpage:orderPanel" =
> "org.apache.myfaces.tobago.component.UIPanel@1ee4dbe"
> 2008-02-21 10:06:15: OrderPanelController::showInDetail():
> Selected Order: NA9
> 2008-02-21 10:06:15: OrderPanelController::setOrder():
> Setting Order: null
>
> Consequently, the following is the trace, as the order is getting set to
> Null, everytime, even though the Value change listener is showing the
> getValue() of the SelectListOneBox component, is keep on retaining the
> initially set value (NA9)...as you can see:
>
> Feb 21, 2008 10:06:16 AM
> org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet Faces Servlet threw exception
> java.lang.NullPointerException
> at
> com.uunet.es3.controller.OrderPanelController.getStatus(OrderPanelController.java:101)
> 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:585)
> at
> org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:457)
> at
> org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:85)
> at
> org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:535)
> at
> org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
> at
> org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:386)
> at
> javax.faces.component.UIOutput.getValue(UIOutput.java:80)
> 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:585)
> at
> javax.faces.component._ComponentAttributesMap.getComponentProperty(_ComponentAttributesMap.java:387)
> at
> javax.faces.component._ComponentAttributesMap.get(_ComponentAttributesMap.java:235)
> at
> org.apache.myfaces.tobago.renderkit.LabelWithAccessKey.<init>(LabelWithAccessKey.java:43)
> at
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.LabelRenderer.encodeEnd(LabelRenderer.java:79)
> at
> javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
> at
> org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java:86)
> at
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent(GridLayoutRenderer.java:379)
> at
> org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(UILayout.java:70)
> at
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(UIGridLayout.java:276)
> at
> org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(UIPanelBase.java:43)
> at
> org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java:79)
> at
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent(GridLayoutRenderer.java:379)
> at
> org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(UILayout.java:70)
> at
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(UIGridLayout.java:276)
> at
> org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(UIPanelBase.java:43)
> at
> org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java:79)
> at
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent(GridLayoutRenderer.java:379)
> at
> org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(UILayout.java:70)
> at
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(UIGridLayout.java:276)
> at
> org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(UIPanelBase.java:43)
> at
> org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java:79)
> at
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent(GridLayoutRenderer.java:379)
> at
> org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(UILayout.java:70)
> at
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(UIGridLayout.java:276)
> at
> org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(UIPanelBase.java:43)
> at
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.PanelRenderer.encodeAjax(PanelRenderer.java:173)
> at
> org.apache.myfaces.tobago.ajax.api.AjaxUtils.encodeAjaxComponent(AjaxUtils.java:67)
> at
> org.apache.myfaces.tobago.component.UIPanelBase.encodeAjax(UIPanelBase.java:48)
> at
> org.apache.myfaces.tobago.util.EncodeAjaxCallback.execute(EncodeAjaxCallback.java:32)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(ComponentUtil.java:1246)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(ComponentUtil.java:1278)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(ComponentUtil.java:1252)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(ComponentUtil.java:1278)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(ComponentUtil.java:1252)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(ComponentUtil.java:1278)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(ComponentUtil.java:1252)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(ComponentUtil.java:1278)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(ComponentUtil.java:1252)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(ComponentUtil.java:1278)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(ComponentUtil.java:1252)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(ComponentUtil.java:1278)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(ComponentUtil.java:1252)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(ComponentUtil.java:1278)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(ComponentUtil.java:1252)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(ComponentUtil.java:1278)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(ComponentUtil.java:1252)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(ComponentUtil.java:1278)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(ComponentUtil.java:1252)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIForm(ComponentUtil.java:1271)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(ComponentUtil.java:1250)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(ComponentUtil.java:1278)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(ComponentUtil.java:1252)
> at
> org.apache.myfaces.tobago.component.ComponentUtil.invokeOnComponent(ComponentUtil.java:1240)
> at
> org.apache.myfaces.tobago.ajax.api.AjaxResponseRenderer.renderComponent(AjaxResponseRenderer.java:140)
> at
> org.apache.myfaces.tobago.ajax.api.AjaxResponseRenderer.renderResponse(AjaxResponseRenderer.java:120)
> at
> org.apache.myfaces.tobago.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:47)
> at
> org.apache.myfaces.tobago.lifecycle.TobagoLifecycle.render(TobagoLifecycle.java:141)
> at
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.myfaces.tobago.webapp.TobagoMultipartFormdataFilter.doFilter(TobagoMultipartFormdataFilter.java:127)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> at java.lang.Thread.run(Thread.java:595)
>
>
> On Thu, Feb 21, 2008 at 10:13 AM, Raj .G. Narasimhan <go...@gmail.com>
> wrote:
> > Currently, I'm using 1.0.15...(since two days)...Previously, I started the
> development with 1.0.13....
> >
> > thanks,
> > -R
> >
> >
> >
> >
> >
> > On Thu, Feb 21, 2008 at 10:09 AM, Volker Weber <v....@inexso.de> wrote:
> >
> > > Which version of tobago? I'm trying to reproduce this.
> > >
> > >
> > >
> > >
> > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > Yes, I did....Volker... But, there is none...
> > > >
> > > > thanks,
> > > > -R
> > > >
> > > >
> > > > On Thu, Feb 21, 2008 at 9:59 AM, Volker Weber <v....@inexso.de>
> wrote:
> > > > > than it should work!
> > > > >
> > > > > can you add a tc:messages tag inside the orderPanel to ensure there
> > > > > are no conversion/validation errors.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > > > Thanks Volker, for the reply!
> > > > > >
> > > > > > The SelectOneListBox with the facet, is within the rendered panel
> > > > > > (orderPanel which encloses both this selectListOneBox component,
> as well
> > > > as
> > > > > > the 'orderDetailPanel'). Hence, I expected the value of
> > > > SelectOneListBox,
> > > > > > to be processed. And, it's not.
> > > > > >
> > > > > > I will try with the other two options....
> > > > > >
> > > > > > Appreciate it!
> > > > > >
> > > > > > tx,
> > > > > > -R
> > > > > >
> > > > > >
> > > > > >
> > > > > > <tc:panel id="orderPanel">
> > > > > > ....
> > > > > > ...
> > > > > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > > > > <f:facet name="layout">
> > > > > > <tc:gridLayout rows="*" columns="*" margin="2px" />
> > > > > > </f:facet>
> > > > > > <tc:selectOneListbox value="#{orderPanelController.order}"
> > > > > >
> > > > > >
> > > >
> valueChangeListener="#{orderPanelController.showInDetail}"
> > > > > >
> > > > > >
> > > >
> validator="#{orderPanelController.validateListSelection}">
> > > > > > <f:selectItems value="#{orderPanelController.orders}"
> />
> > > > > > <f:converter converterId="deviceOrderId" />
> > > > > >
> > > > > > <f:facet name="click">
> > > > > > <tc:command
> action="#{orderPanelController.returnNull}">
> > > > > > <tc:attribute value=":cdbmainpage:orderPanel"
> > > > > > name="renderedPartially" />
> > > > > > </tc:command>
> > > > > > </f:facet>
> > > > > > <%-- I tired the same command with 'change' facet' also %>
> > > > > > </tc:selectOneListbox>
> > > > > >
> > > > > > </tc:box>
> > > > > >
> > > > > > <tc:panel id="orderDetailPanel">
> > > > > >
> > > > > >
> > > > > > On Thu, Feb 21, 2008 at 3:22 AM, Volker Weber <v....@inexso.de>
> > > > wrote:
> > > > > > > Hi Raj,
> > > > > > >
> > > > > > > if i interpret your code snippet correct,
> > > > > > >
> > > > > > > the selectOneListbox with the click/change facet is NOT inside
> the
> > > > > > > partially rendered panel. This is the problem, only the content
> of the
> > > > > > > partiallyRendered component is processed on the server.
> > > > > > >
> > > > > > > you have two(tree) choices:
> > > > > > > 1. include the listbox into the renderedPartially scope.
> > > > > > > 2. invoke the processing of listbox lifecycle in your action.
> > > > > > > UIComponent listbox =
> facesContext.getViewRoot().findComponent(<id
> > > > > > > of listbox>);
> > > > > > > listbox.processDecodes(facesContect);
> > > > > > > listbox.processValidations(facesContect);
> > > > > > > listbox.processUpdates(facesContect);
> > > > > > >
> > > > > > > 3.(experimental) use 1.1-SNAPSHOT version.
> > > > > > > you can declare full page to be submitted (and processed)
> partially
> > > > and
> > > > > > > in your action method remove the page and add orderPanel
> from/to the
> > > > > > > partially
> > > > > > > component list.
> > > > > > >
> > > > > > >
> > > > > > > Regards,
> > > > > > > Volker
> > > > > > >
> > > > > > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > I am trying to show the details of 'SelectItem' object of
> > > > > > SelectOneListBox
> > > > > > > > on a set of Input fields. Problem that I am facing is,
> whenever the
> > > > page
> > > > > > is
> > > > > > > > rendered partially, it always returns the 'value' of
> > > > SelectOneListBox as
> > > > > > > > null. I have tried using both 'change' and 'click' facets,
> and both
> > > > of
> > > > > > them
> > > > > > > > are not giving the desired results.
> > > > > > > >
> > > > > > > > Here's the scenario, in little detail:
> > > > > > > >
> > > > > > > > When I use, 'click' facet, and tried to select different list
> items:
> > > > > > > >
> > > > > > > > ** In the valueChangeEvent, everytime it's retaining the
> initially
> > > > set
> > > > > > value
> > > > > > > > (First item of List box, which I set when I render the panel
> for the
> > > > > > first
> > > > > > > > time) .
> > > > > > > >
> > > > > > > > ** getValue() of the source component in the valueChange
> event, is
> > > > > > > > supposedly returning the binding value, if the current value
> is
> > > > null.
> > > > > > And, I
> > > > > > > > guess, this is the reason, it retains the old value, if the
> current
> > > > > > > > localvalue is null.
> > > > > > > >
> > > > > > > > ** After this listerner call, it tries to set the value of the
> > > > > > > > SelectOneListBox's bound value as null, and this results in
> > > > NPException,
> > > > > > as
> > > > > > > > the 'DetailPanel's fields are this object's properties.
> > > > > > > >
> > > > > > > > ** I tried intercepting with a Validator - Surprisingly, this
> is
> > > > not
> > > > > > called
> > > > > > > > at all...
> > > > > > > >
> > > > > > > >
> > > > > > > > When I use "Change" facet and tried to select different list
> items:
> > > > > > > > ** ValueChangeEvent does not occur at all
> > > > > > > > **Agreeably, 'change' facet's command is also not called
> > > > > > > > **No validator call is made
> > > > > > > >
> > > > > > > > Here's the code snippet:
> > > > > > > > <tc:panel id="orderPanel">
> > > > > > > > ....
> > > > > > > > ...
> > > > > > > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > > > > > > <f:facet name="layout">
> > > > > > > > <tc:gridLayout rows="*" columns="*" margin="2px"
> />
> > > > > > > > </f:facet>
> > > > > > > > <tc:selectOneListbox
> value="#{orderPanelController.order}"
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> valueChangeListener="#{orderPanelController.showInDetail}"
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> validator="#{orderPanelController.validateListSelection}">
> > > > > > > > <f:selectItems
> value="#{orderPanelController.orders}" />
> > > > > > > > <f:converter converterId="deviceOrderId" />
> > > > > > > >
> > > > > > > > <f:facet name="click">
> > > > > > > > <tc:command
> > > > action="#{orderPanelController.returnNull}">
> > > > > > > > <tc:attribute
> value=":cdbmainpage:orderPanel"
> > > > > > > > name="renderedPartially" />
> > > > > > > > </tc:command>
> > > > > > > > </f:facet>
> > > > > > > > <%-- I tired the same command with 'change' facet' also %>
> > > > > > > > </tc:selectOneListbox>
> > > > > > > >
> > > > > > > > </tc:box>
> > > > > > > >
> > > > > > > > <tc:panel id="orderDetailPanel">
> > > > > > > > ....
> > > > > > > > ..
> > > > > > > >
> > > > > > > > OrderPanelController:
> > > > > > > > public void showInDetail(ValueChangeEvent valChangeEvent) {
> > > > > > > > UISelectOne select =
> > > > > > > > (UISelectOne)valChangeEvent.getComponent();
> > > > > > > > if(select.getValue() == null){
> > > > > > > > LOG.finer("Value is null");
> > > > > > > > return;
> > > > > > > > }
> > > > > > > > order = (DeviceOrder) select.getValue();
> > > > > > > > LOG.finer("Selected Order: "+select.getValue());
> > > > > > > > return;
> > > > > > > > }
> > > > > > > >
> > > > > > > > public void
> validateListSelection(FacesContext
> > > > context,
> > > > > > > > UIComponent component, Object value) throws ValidatorException
> {
> > > > > > > > if (value == null) {
> > > > > > > > System.out.println("List validation:Came here :
> Value is
> > > > > > null");
> > > > > > > > return;
> > > > > > > > }
> > > > > > > > order = (DeviceOrder) value;
> > > > > > > > LOG.finer("Selected order in validation: "+order);
> > > > > > > > }
> > > > > > > >
> > > > > > > > Appreciate your help!
> > > > > > > >
> > > > > > > > --
> > > > > > > > Thanks,
> > > > > > > >
> > > > > > > > Raj .G. Narasimhan
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > inexso - information exchange solutions GmbH
> > > > > > > Bismarckstraße 13 | 26122 Oldenburg
> > > > > > > Tel.: +49 441 4082 356 |
> > > > > > > FAX: +49 441 4082 355 | www.inexso.de
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Thanks,
> > > > > >
> > > > > > Raj .G. Narasimhan
> > > > >
> > > > >
> > > > > --
> > > > >
> > > > >
> > > > >
> > > > > inexso - information exchange solutions GmbH
> > > > > Bismarckstraße 13 | 26122 Oldenburg
> > > > > Tel.: +49 441 4082 356 |
> > > > > FAX: +49 441 4082 355 | www.inexso.de
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Thanks,
> > > >
> > > > Raj .G. Narasimhan
> > >
> > >
> > > --
> > >
> > >
> > >
> > > inexso - information exchange solutions GmbH
> > > Bismarckstraße 13 | 26122 Oldenburg
> > > Tel.: +49 441 4082 356 |
> > > FAX: +49 441 4082 355 | www.inexso.de
> > >
> >
> >
> >
> > --
> > Thanks,
> >
> > Raj .G. Narasimhan
>
>
>
> --
> Thanks,
>
> Raj .G. Narasimhan
--
inexso - information exchange solutions GmbH
Bismarckstraße 13 | 26122 Oldenburg
Tel.: +49 441 4082 356 |
FAX: +49 441 4082 355 | www.inexso.de
Re: [tobago] :Issue with ValueChangeEvent & Validator
Posted by "Raj .G. Narasimhan" <go...@gmail.com>.
Volker, here're the log msgs, which might give you somewhat clear picture of
what's going on....
Appreciate your efforts..!
10:06:15,963 INFO [AjaxUtils] ajaxComponentIds = "cdbmainpage:orderPanel"
10:06:15,963 INFO [AjaxUtils] ajaxComponent for "cdbmainpage:orderPanel" =
"org.apache.myfaces.tobago.component.UIPanel@1ee4dbe"
2008-02-21 10:06:15: OrderPanelController::showInDetail(): Selected Order:
NA9
2008-02-21 10:06:15: OrderPanelController::setOrder(): Setting Order: null
Consequently, the following is the trace, as the order is getting set to
Null, everytime, even though the Value change listener is showing the
getValue() of the SelectListOneBox component, is keep on retaining the
initially set value (NA9)...as you can see:
Feb 21, 2008 10:06:16 AM org.apache.catalina.core.StandardWrapperValveinvoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
at com.uunet.es3.controller.OrderPanelController.getStatus(
OrderPanelController.java:101)
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:585)
at org.apache.myfaces.el.PropertyResolverImpl.getProperty(
PropertyResolverImpl.java:457)
at org.apache.myfaces.el.PropertyResolverImpl.getValue(
PropertyResolverImpl.java:85)
at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(
ELParserHelper.java:535)
at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java
:386)
at javax.faces.component.UIOutput.getValue(UIOutput.java:80)
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:585)
at javax.faces.component._ComponentAttributesMap.getComponentProperty
(_ComponentAttributesMap.java:387)
at javax.faces.component._ComponentAttributesMap.get
(_ComponentAttributesMap.java:235)
at org.apache.myfaces.tobago.renderkit.LabelWithAccessKey.<init>(
LabelWithAccessKey.java:43)
at
org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.LabelRenderer.encodeEnd
(LabelRenderer.java:79)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java
:539)
at org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java
:86)
at
org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent
(GridLayoutRenderer.java:379)
at
org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(
UILayout.java:70)
at
org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(
UIGridLayout.java:276)
at org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(
UIPanelBase.java:43)
at org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java
:79)
at
org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent
(GridLayoutRenderer.java:379)
at
org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(
UILayout.java:70)
at
org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(
UIGridLayout.java:276)
at org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(
UIPanelBase.java:43)
at org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java
:79)
at
org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent
(GridLayoutRenderer.java:379)
at
org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(
UILayout.java:70)
at
org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(
UIGridLayout.java:276)
at org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(
UIPanelBase.java:43)
at org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java
:79)
at
org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent
(GridLayoutRenderer.java:379)
at
org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(
UILayout.java:70)
at
org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(
UIGridLayout.java:276)
at org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(
UIPanelBase.java:43)
at
org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.PanelRenderer.encodeAjax
(PanelRenderer.java:173)
at org.apache.myfaces.tobago.ajax.api.AjaxUtils.encodeAjaxComponent(
AjaxUtils.java:67)
at org.apache.myfaces.tobago.component.UIPanelBase.encodeAjax(
UIPanelBase.java:48)
at org.apache.myfaces.tobago.util.EncodeAjaxCallback.execute(
EncodeAjaxCallback.java:32)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
ComponentUtil.java:1246)
at
org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
ComponentUtil.java:1278)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
ComponentUtil.java:1252)
at
org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
ComponentUtil.java:1278)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
ComponentUtil.java:1252)
at
org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
ComponentUtil.java:1278)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
ComponentUtil.java:1252)
at
org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
ComponentUtil.java:1278)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
ComponentUtil.java:1252)
at
org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
ComponentUtil.java:1278)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
ComponentUtil.java:1252)
at
org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
ComponentUtil.java:1278)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
ComponentUtil.java:1252)
at
org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
ComponentUtil.java:1278)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
ComponentUtil.java:1252)
at
org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
ComponentUtil.java:1278)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
ComponentUtil.java:1252)
at
org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
ComponentUtil.java:1278)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
ComponentUtil.java:1252)
at org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIForm(
ComponentUtil.java:1271)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
ComponentUtil.java:1250)
at
org.apache.myfaces.tobago.component.ComponentUtil.prepareOnUIComponent(
ComponentUtil.java:1278)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOrPrepare(
ComponentUtil.java:1252)
at org.apache.myfaces.tobago.component.ComponentUtil.invokeOnComponent(
ComponentUtil.java:1240)
at
org.apache.myfaces.tobago.ajax.api.AjaxResponseRenderer.renderComponent(
AjaxResponseRenderer.java:140)
at
org.apache.myfaces.tobago.ajax.api.AjaxResponseRenderer.renderResponse(
AjaxResponseRenderer.java:120)
at org.apache.myfaces.tobago.lifecycle.RenderResponseExecutor.execute(
RenderResponseExecutor.java:47)
at org.apache.myfaces.tobago.lifecycle.TobagoLifecycle.render(
TobagoLifecycle.java:141)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:206)
at
org.apache.myfaces.tobago.webapp.TobagoMultipartFormdataFilter.doFilter(
TobagoMultipartFormdataFilter.java:127)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java
:447)
at java.lang.Thread.run(Thread.java:595)
On Thu, Feb 21, 2008 at 10:13 AM, Raj .G. Narasimhan <go...@gmail.com>
wrote:
> Currently, I'm using 1.0.15...(since two days)...Previously, I started the
> development with 1.0.13....
>
> thanks,
> -R
>
>
> On Thu, Feb 21, 2008 at 10:09 AM, Volker Weber <v....@inexso.de> wrote:
>
> > Which version of tobago? I'm trying to reproduce this.
> >
> > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > Yes, I did....Volker... But, there is none...
> > >
> > > thanks,
> > > -R
> > >
> > >
> > > On Thu, Feb 21, 2008 at 9:59 AM, Volker Weber <v....@inexso.de>
> > wrote:
> > > > than it should work!
> > > >
> > > > can you add a tc:messages tag inside the orderPanel to ensure there
> > > > are no conversion/validation errors.
> > > >
> > > >
> > > >
> > > >
> > > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > > Thanks Volker, for the reply!
> > > > >
> > > > > The SelectOneListBox with the facet, is within the rendered panel
> > > > > (orderPanel which encloses both this selectListOneBox component,
> > as well
> > > as
> > > > > the 'orderDetailPanel'). Hence, I expected the value of
> > > SelectOneListBox,
> > > > > to be processed. And, it's not.
> > > > >
> > > > > I will try with the other two options....
> > > > >
> > > > > Appreciate it!
> > > > >
> > > > > tx,
> > > > > -R
> > > > >
> > > > >
> > > > >
> > > > > <tc:panel id="orderPanel">
> > > > > ....
> > > > > ...
> > > > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > > > <f:facet name="layout">
> > > > > <tc:gridLayout rows="*" columns="*" margin="2px" />
> > > > > </f:facet>
> > > > > <tc:selectOneListbox value="#{orderPanelController.order}"
> > > > >
> > > > >
> > > valueChangeListener="#{orderPanelController.showInDetail}"
> > > > >
> > > > >
> > > validator="#{orderPanelController.validateListSelection}">
> > > > > <f:selectItems value="#{orderPanelController.orders}"
> > />
> > > > > <f:converter converterId="deviceOrderId" />
> > > > >
> > > > > <f:facet name="click">
> > > > > <tc:command action="#{
> > orderPanelController.returnNull}">
> > > > > <tc:attribute value=":cdbmainpage:orderPanel"
> > > > > name="renderedPartially" />
> > > > > </tc:command>
> > > > > </f:facet>
> > > > > <%-- I tired the same command with 'change' facet' also %>
> > > > > </tc:selectOneListbox>
> > > > >
> > > > > </tc:box>
> > > > >
> > > > > <tc:panel id="orderDetailPanel">
> > > > >
> > > > >
> > > > > On Thu, Feb 21, 2008 at 3:22 AM, Volker Weber <v....@inexso.de>
> > > wrote:
> > > > > > Hi Raj,
> > > > > >
> > > > > > if i interpret your code snippet correct,
> > > > > >
> > > > > > the selectOneListbox with the click/change facet is NOT inside
> > the
> > > > > > partially rendered panel. This is the problem, only the content
> > of the
> > > > > > partiallyRendered component is processed on the server.
> > > > > >
> > > > > > you have two(tree) choices:
> > > > > > 1. include the listbox into the renderedPartially scope.
> > > > > > 2. invoke the processing of listbox lifecycle in your action.
> > > > > > UIComponent listbox = facesContext.getViewRoot
> > ().findComponent(<id
> > > > > > of listbox>);
> > > > > > listbox.processDecodes(facesContect);
> > > > > > listbox.processValidations(facesContect);
> > > > > > listbox.processUpdates(facesContect);
> > > > > >
> > > > > > 3.(experimental) use 1.1-SNAPSHOT version.
> > > > > > you can declare full page to be submitted (and processed)
> > partially
> > > and
> > > > > > in your action method remove the page and add orderPanel
> > from/to the
> > > > > > partially
> > > > > > component list.
> > > > > >
> > > > > >
> > > > > > Regards,
> > > > > > Volker
> > > > > >
> > > > > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > > >
> > > > > >
> > > > > >
> > > > > > > I am trying to show the details of 'SelectItem' object of
> > > > > SelectOneListBox
> > > > > > > on a set of Input fields. Problem that I am facing is,
> > whenever the
> > > page
> > > > > is
> > > > > > > rendered partially, it always returns the 'value' of
> > > SelectOneListBox as
> > > > > > > null. I have tried using both 'change' and 'click' facets,
> > and both
> > > of
> > > > > them
> > > > > > > are not giving the desired results.
> > > > > > >
> > > > > > > Here's the scenario, in little detail:
> > > > > > >
> > > > > > > When I use, 'click' facet, and tried to select different list
> > items:
> > > > > > >
> > > > > > > ** In the valueChangeEvent, everytime it's retaining the
> > initially
> > > set
> > > > > value
> > > > > > > (First item of List box, which I set when I render the panel
> > for the
> > > > > first
> > > > > > > time) .
> > > > > > >
> > > > > > > ** getValue() of the source component in the valueChange
> > event, is
> > > > > > > supposedly returning the binding value, if the current value
> > is
> > > null.
> > > > > And, I
> > > > > > > guess, this is the reason, it retains the old value, if the
> > current
> > > > > > > localvalue is null.
> > > > > > >
> > > > > > > ** After this listerner call, it tries to set the value of the
> > > > > > > SelectOneListBox's bound value as null, and this results in
> > > NPException,
> > > > > as
> > > > > > > the 'DetailPanel's fields are this object's properties.
> > > > > > >
> > > > > > > ** I tried intercepting with a Validator - Surprisingly, this
> > is
> > > not
> > > > > called
> > > > > > > at all...
> > > > > > >
> > > > > > >
> > > > > > > When I use "Change" facet and tried to select different list
> > items:
> > > > > > > ** ValueChangeEvent does not occur at all
> > > > > > > **Agreeably, 'change' facet's command is also not called
> > > > > > > **No validator call is made
> > > > > > >
> > > > > > > Here's the code snippet:
> > > > > > > <tc:panel id="orderPanel">
> > > > > > > ....
> > > > > > > ...
> > > > > > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > > > > > <f:facet name="layout">
> > > > > > > <tc:gridLayout rows="*" columns="*" margin="2px"
> > />
> > > > > > > </f:facet>
> > > > > > > <tc:selectOneListbox value="#{
> > orderPanelController.order}"
> > > > > > >
> > > > > > >
> > > > >
> > > valueChangeListener="#{orderPanelController.showInDetail}"
> > > > > > >
> > > > > > >
> > > > >
> > > validator="#{orderPanelController.validateListSelection}">
> > > > > > > <f:selectItems value="#{
> > orderPanelController.orders}" />
> > > > > > > <f:converter converterId="deviceOrderId" />
> > > > > > >
> > > > > > > <f:facet name="click">
> > > > > > > <tc:command
> > > action="#{orderPanelController.returnNull}">
> > > > > > > <tc:attribute
> > value=":cdbmainpage:orderPanel"
> > > > > > > name="renderedPartially" />
> > > > > > > </tc:command>
> > > > > > > </f:facet>
> > > > > > > <%-- I tired the same command with 'change' facet' also %>
> > > > > > > </tc:selectOneListbox>
> > > > > > >
> > > > > > > </tc:box>
> > > > > > >
> > > > > > > <tc:panel id="orderDetailPanel">
> > > > > > > ....
> > > > > > > ..
> > > > > > >
> > > > > > > OrderPanelController:
> > > > > > > public void showInDetail(ValueChangeEvent valChangeEvent) {
> > > > > > > UISelectOne select =
> > > > > > > (UISelectOne)valChangeEvent.getComponent();
> > > > > > > if(select.getValue() == null){
> > > > > > > LOG.finer("Value is null");
> > > > > > > return;
> > > > > > > }
> > > > > > > order = (DeviceOrder) select.getValue();
> > > > > > > LOG.finer("Selected Order: "+select.getValue());
> > > > > > > return;
> > > > > > > }
> > > > > > >
> > > > > > > public void validateListSelection(FacesContext
> > > context,
> > > > > > > UIComponent component, Object value) throws ValidatorException
> > {
> > > > > > > if (value == null) {
> > > > > > > System.out.println("List validation:Came here :
> > Value is
> > > > > null");
> > > > > > > return;
> > > > > > > }
> > > > > > > order = (DeviceOrder) value;
> > > > > > > LOG.finer("Selected order in validation: "+order);
> > > > > > > }
> > > > > > >
> > > > > > > Appreciate your help!
> > > > > > >
> > > > > > > --
> > > > > > > Thanks,
> > > > > > >
> > > > > > > Raj .G. Narasimhan
> > > > > >
> > > > > >
> > > > > > --
> > > > > > inexso - information exchange solutions GmbH
> > > > > > Bismarckstraße 13 | 26122 Oldenburg
> > > > > > Tel.: +49 441 4082 356 |
> > > > > > FAX: +49 441 4082 355 | www.inexso.de
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Thanks,
> > > > >
> > > > > Raj .G. Narasimhan
> > > >
> > > >
> > > > --
> > > >
> > > >
> > > >
> > > > inexso - information exchange solutions GmbH
> > > > Bismarckstraße 13 | 26122 Oldenburg
> > > > Tel.: +49 441 4082 356 |
> > > > FAX: +49 441 4082 355 | www.inexso.de
> > > >
> > >
> > >
> > >
> > > --
> > > Thanks,
> > >
> > > Raj .G. Narasimhan
> >
> >
> > --
> > inexso - information exchange solutions GmbH
> > Bismarckstraße 13 | 26122 Oldenburg
> > Tel.: +49 441 4082 356 |
> > FAX: +49 441 4082 355 | www.inexso.de
> >
>
>
>
> --
> Thanks,
>
> Raj .G. Narasimhan
--
Thanks,
Raj .G. Narasimhan
Re: [tobago] :Issue with ValueChangeEvent & Validator
Posted by "Raj .G. Narasimhan" <go...@gmail.com>.
Currently, I'm using 1.0.15...(since two days)...Previously, I started the
development with 1.0.13....
thanks,
-R
On Thu, Feb 21, 2008 at 10:09 AM, Volker Weber <v....@inexso.de> wrote:
> Which version of tobago? I'm trying to reproduce this.
>
> 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > Yes, I did....Volker... But, there is none...
> >
> > thanks,
> > -R
> >
> >
> > On Thu, Feb 21, 2008 at 9:59 AM, Volker Weber <v....@inexso.de> wrote:
> > > than it should work!
> > >
> > > can you add a tc:messages tag inside the orderPanel to ensure there
> > > are no conversion/validation errors.
> > >
> > >
> > >
> > >
> > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > Thanks Volker, for the reply!
> > > >
> > > > The SelectOneListBox with the facet, is within the rendered panel
> > > > (orderPanel which encloses both this selectListOneBox component, as
> well
> > as
> > > > the 'orderDetailPanel'). Hence, I expected the value of
> > SelectOneListBox,
> > > > to be processed. And, it's not.
> > > >
> > > > I will try with the other two options....
> > > >
> > > > Appreciate it!
> > > >
> > > > tx,
> > > > -R
> > > >
> > > >
> > > >
> > > > <tc:panel id="orderPanel">
> > > > ....
> > > > ...
> > > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > > <f:facet name="layout">
> > > > <tc:gridLayout rows="*" columns="*" margin="2px" />
> > > > </f:facet>
> > > > <tc:selectOneListbox value="#{orderPanelController.order}"
> > > >
> > > >
> > valueChangeListener="#{orderPanelController.showInDetail}"
> > > >
> > > >
> > validator="#{orderPanelController.validateListSelection}">
> > > > <f:selectItems value="#{orderPanelController.orders}" />
> > > > <f:converter converterId="deviceOrderId" />
> > > >
> > > > <f:facet name="click">
> > > > <tc:command action="#{
> orderPanelController.returnNull}">
> > > > <tc:attribute value=":cdbmainpage:orderPanel"
> > > > name="renderedPartially" />
> > > > </tc:command>
> > > > </f:facet>
> > > > <%-- I tired the same command with 'change' facet' also %>
> > > > </tc:selectOneListbox>
> > > >
> > > > </tc:box>
> > > >
> > > > <tc:panel id="orderDetailPanel">
> > > >
> > > >
> > > > On Thu, Feb 21, 2008 at 3:22 AM, Volker Weber <v....@inexso.de>
> > wrote:
> > > > > Hi Raj,
> > > > >
> > > > > if i interpret your code snippet correct,
> > > > >
> > > > > the selectOneListbox with the click/change facet is NOT inside the
> > > > > partially rendered panel. This is the problem, only the content of
> the
> > > > > partiallyRendered component is processed on the server.
> > > > >
> > > > > you have two(tree) choices:
> > > > > 1. include the listbox into the renderedPartially scope.
> > > > > 2. invoke the processing of listbox lifecycle in your action.
> > > > > UIComponent listbox = facesContext.getViewRoot
> ().findComponent(<id
> > > > > of listbox>);
> > > > > listbox.processDecodes(facesContect);
> > > > > listbox.processValidations(facesContect);
> > > > > listbox.processUpdates(facesContect);
> > > > >
> > > > > 3.(experimental) use 1.1-SNAPSHOT version.
> > > > > you can declare full page to be submitted (and processed)
> partially
> > and
> > > > > in your action method remove the page and add orderPanel from/to
> the
> > > > > partially
> > > > > component list.
> > > > >
> > > > >
> > > > > Regards,
> > > > > Volker
> > > > >
> > > > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > > >
> > > > >
> > > > >
> > > > > > I am trying to show the details of 'SelectItem' object of
> > > > SelectOneListBox
> > > > > > on a set of Input fields. Problem that I am facing is, whenever
> the
> > page
> > > > is
> > > > > > rendered partially, it always returns the 'value' of
> > SelectOneListBox as
> > > > > > null. I have tried using both 'change' and 'click' facets, and
> both
> > of
> > > > them
> > > > > > are not giving the desired results.
> > > > > >
> > > > > > Here's the scenario, in little detail:
> > > > > >
> > > > > > When I use, 'click' facet, and tried to select different list
> items:
> > > > > >
> > > > > > ** In the valueChangeEvent, everytime it's retaining the
> initially
> > set
> > > > value
> > > > > > (First item of List box, which I set when I render the panel for
> the
> > > > first
> > > > > > time) .
> > > > > >
> > > > > > ** getValue() of the source component in the valueChange event,
> is
> > > > > > supposedly returning the binding value, if the current value is
> > null.
> > > > And, I
> > > > > > guess, this is the reason, it retains the old value, if the
> current
> > > > > > localvalue is null.
> > > > > >
> > > > > > ** After this listerner call, it tries to set the value of the
> > > > > > SelectOneListBox's bound value as null, and this results in
> > NPException,
> > > > as
> > > > > > the 'DetailPanel's fields are this object's properties.
> > > > > >
> > > > > > ** I tried intercepting with a Validator - Surprisingly, this
> is
> > not
> > > > called
> > > > > > at all...
> > > > > >
> > > > > >
> > > > > > When I use "Change" facet and tried to select different list
> items:
> > > > > > ** ValueChangeEvent does not occur at all
> > > > > > **Agreeably, 'change' facet's command is also not called
> > > > > > **No validator call is made
> > > > > >
> > > > > > Here's the code snippet:
> > > > > > <tc:panel id="orderPanel">
> > > > > > ....
> > > > > > ...
> > > > > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > > > > <f:facet name="layout">
> > > > > > <tc:gridLayout rows="*" columns="*" margin="2px" />
> > > > > > </f:facet>
> > > > > > <tc:selectOneListbox value="#{orderPanelController.order
> }"
> > > > > >
> > > > > >
> > > >
> > valueChangeListener="#{orderPanelController.showInDetail}"
> > > > > >
> > > > > >
> > > >
> > validator="#{orderPanelController.validateListSelection}">
> > > > > > <f:selectItems value="#{orderPanelController.orders}"
> />
> > > > > > <f:converter converterId="deviceOrderId" />
> > > > > >
> > > > > > <f:facet name="click">
> > > > > > <tc:command
> > action="#{orderPanelController.returnNull}">
> > > > > > <tc:attribute
> value=":cdbmainpage:orderPanel"
> > > > > > name="renderedPartially" />
> > > > > > </tc:command>
> > > > > > </f:facet>
> > > > > > <%-- I tired the same command with 'change' facet' also %>
> > > > > > </tc:selectOneListbox>
> > > > > >
> > > > > > </tc:box>
> > > > > >
> > > > > > <tc:panel id="orderDetailPanel">
> > > > > > ....
> > > > > > ..
> > > > > >
> > > > > > OrderPanelController:
> > > > > > public void showInDetail(ValueChangeEvent valChangeEvent) {
> > > > > > UISelectOne select =
> > > > > > (UISelectOne)valChangeEvent.getComponent();
> > > > > > if(select.getValue() == null){
> > > > > > LOG.finer("Value is null");
> > > > > > return;
> > > > > > }
> > > > > > order = (DeviceOrder) select.getValue();
> > > > > > LOG.finer("Selected Order: "+select.getValue());
> > > > > > return;
> > > > > > }
> > > > > >
> > > > > > public void validateListSelection(FacesContext
> > context,
> > > > > > UIComponent component, Object value) throws ValidatorException {
> > > > > > if (value == null) {
> > > > > > System.out.println("List validation:Came here :
> Value is
> > > > null");
> > > > > > return;
> > > > > > }
> > > > > > order = (DeviceOrder) value;
> > > > > > LOG.finer("Selected order in validation: "+order);
> > > > > > }
> > > > > >
> > > > > > Appreciate your help!
> > > > > >
> > > > > > --
> > > > > > Thanks,
> > > > > >
> > > > > > Raj .G. Narasimhan
> > > > >
> > > > >
> > > > > --
> > > > > inexso - information exchange solutions GmbH
> > > > > Bismarckstraße 13 | 26122 Oldenburg
> > > > > Tel.: +49 441 4082 356 |
> > > > > FAX: +49 441 4082 355 | www.inexso.de
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Thanks,
> > > >
> > > > Raj .G. Narasimhan
> > >
> > >
> > > --
> > >
> > >
> > >
> > > inexso - information exchange solutions GmbH
> > > Bismarckstraße 13 | 26122 Oldenburg
> > > Tel.: +49 441 4082 356 |
> > > FAX: +49 441 4082 355 | www.inexso.de
> > >
> >
> >
> >
> > --
> > Thanks,
> >
> > Raj .G. Narasimhan
>
>
> --
> inexso - information exchange solutions GmbH
> Bismarckstraße 13 | 26122 Oldenburg
> Tel.: +49 441 4082 356 |
> FAX: +49 441 4082 355 | www.inexso.de
>
--
Thanks,
Raj .G. Narasimhan
Re: [tobago] :Issue with ValueChangeEvent & Validator
Posted by Volker Weber <v....@inexso.de>.
Which version of tobago? I'm trying to reproduce this.
2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> Yes, I did....Volker... But, there is none...
>
> thanks,
> -R
>
>
> On Thu, Feb 21, 2008 at 9:59 AM, Volker Weber <v....@inexso.de> wrote:
> > than it should work!
> >
> > can you add a tc:messages tag inside the orderPanel to ensure there
> > are no conversion/validation errors.
> >
> >
> >
> >
> > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > Thanks Volker, for the reply!
> > >
> > > The SelectOneListBox with the facet, is within the rendered panel
> > > (orderPanel which encloses both this selectListOneBox component, as well
> as
> > > the 'orderDetailPanel'). Hence, I expected the value of
> SelectOneListBox,
> > > to be processed. And, it's not.
> > >
> > > I will try with the other two options....
> > >
> > > Appreciate it!
> > >
> > > tx,
> > > -R
> > >
> > >
> > >
> > > <tc:panel id="orderPanel">
> > > ....
> > > ...
> > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > <f:facet name="layout">
> > > <tc:gridLayout rows="*" columns="*" margin="2px" />
> > > </f:facet>
> > > <tc:selectOneListbox value="#{orderPanelController.order}"
> > >
> > >
> valueChangeListener="#{orderPanelController.showInDetail}"
> > >
> > >
> validator="#{orderPanelController.validateListSelection}">
> > > <f:selectItems value="#{orderPanelController.orders}" />
> > > <f:converter converterId="deviceOrderId" />
> > >
> > > <f:facet name="click">
> > > <tc:command action="#{orderPanelController.returnNull}">
> > > <tc:attribute value=":cdbmainpage:orderPanel"
> > > name="renderedPartially" />
> > > </tc:command>
> > > </f:facet>
> > > <%-- I tired the same command with 'change' facet' also %>
> > > </tc:selectOneListbox>
> > >
> > > </tc:box>
> > >
> > > <tc:panel id="orderDetailPanel">
> > >
> > >
> > > On Thu, Feb 21, 2008 at 3:22 AM, Volker Weber <v....@inexso.de>
> wrote:
> > > > Hi Raj,
> > > >
> > > > if i interpret your code snippet correct,
> > > >
> > > > the selectOneListbox with the click/change facet is NOT inside the
> > > > partially rendered panel. This is the problem, only the content of the
> > > > partiallyRendered component is processed on the server.
> > > >
> > > > you have two(tree) choices:
> > > > 1. include the listbox into the renderedPartially scope.
> > > > 2. invoke the processing of listbox lifecycle in your action.
> > > > UIComponent listbox = facesContext.getViewRoot().findComponent(<id
> > > > of listbox>);
> > > > listbox.processDecodes(facesContect);
> > > > listbox.processValidations(facesContect);
> > > > listbox.processUpdates(facesContect);
> > > >
> > > > 3.(experimental) use 1.1-SNAPSHOT version.
> > > > you can declare full page to be submitted (and processed) partially
> and
> > > > in your action method remove the page and add orderPanel from/to the
> > > > partially
> > > > component list.
> > > >
> > > >
> > > > Regards,
> > > > Volker
> > > >
> > > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > > >
> > > >
> > > >
> > > > > I am trying to show the details of 'SelectItem' object of
> > > SelectOneListBox
> > > > > on a set of Input fields. Problem that I am facing is, whenever the
> page
> > > is
> > > > > rendered partially, it always returns the 'value' of
> SelectOneListBox as
> > > > > null. I have tried using both 'change' and 'click' facets, and both
> of
> > > them
> > > > > are not giving the desired results.
> > > > >
> > > > > Here's the scenario, in little detail:
> > > > >
> > > > > When I use, 'click' facet, and tried to select different list items:
> > > > >
> > > > > ** In the valueChangeEvent, everytime it's retaining the initially
> set
> > > value
> > > > > (First item of List box, which I set when I render the panel for the
> > > first
> > > > > time) .
> > > > >
> > > > > ** getValue() of the source component in the valueChange event, is
> > > > > supposedly returning the binding value, if the current value is
> null.
> > > And, I
> > > > > guess, this is the reason, it retains the old value, if the current
> > > > > localvalue is null.
> > > > >
> > > > > ** After this listerner call, it tries to set the value of the
> > > > > SelectOneListBox's bound value as null, and this results in
> NPException,
> > > as
> > > > > the 'DetailPanel's fields are this object's properties.
> > > > >
> > > > > ** I tried intercepting with a Validator - Surprisingly, this is
> not
> > > called
> > > > > at all...
> > > > >
> > > > >
> > > > > When I use "Change" facet and tried to select different list items:
> > > > > ** ValueChangeEvent does not occur at all
> > > > > **Agreeably, 'change' facet's command is also not called
> > > > > **No validator call is made
> > > > >
> > > > > Here's the code snippet:
> > > > > <tc:panel id="orderPanel">
> > > > > ....
> > > > > ...
> > > > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > > > <f:facet name="layout">
> > > > > <tc:gridLayout rows="*" columns="*" margin="2px" />
> > > > > </f:facet>
> > > > > <tc:selectOneListbox value="#{orderPanelController.order}"
> > > > >
> > > > >
> > >
> valueChangeListener="#{orderPanelController.showInDetail}"
> > > > >
> > > > >
> > >
> validator="#{orderPanelController.validateListSelection}">
> > > > > <f:selectItems value="#{orderPanelController.orders}" />
> > > > > <f:converter converterId="deviceOrderId" />
> > > > >
> > > > > <f:facet name="click">
> > > > > <tc:command
> action="#{orderPanelController.returnNull}">
> > > > > <tc:attribute value=":cdbmainpage:orderPanel"
> > > > > name="renderedPartially" />
> > > > > </tc:command>
> > > > > </f:facet>
> > > > > <%-- I tired the same command with 'change' facet' also %>
> > > > > </tc:selectOneListbox>
> > > > >
> > > > > </tc:box>
> > > > >
> > > > > <tc:panel id="orderDetailPanel">
> > > > > ....
> > > > > ..
> > > > >
> > > > > OrderPanelController:
> > > > > public void showInDetail(ValueChangeEvent valChangeEvent) {
> > > > > UISelectOne select =
> > > > > (UISelectOne)valChangeEvent.getComponent();
> > > > > if(select.getValue() == null){
> > > > > LOG.finer("Value is null");
> > > > > return;
> > > > > }
> > > > > order = (DeviceOrder) select.getValue();
> > > > > LOG.finer("Selected Order: "+select.getValue());
> > > > > return;
> > > > > }
> > > > >
> > > > > public void validateListSelection(FacesContext
> context,
> > > > > UIComponent component, Object value) throws ValidatorException {
> > > > > if (value == null) {
> > > > > System.out.println("List validation:Came here : Value is
> > > null");
> > > > > return;
> > > > > }
> > > > > order = (DeviceOrder) value;
> > > > > LOG.finer("Selected order in validation: "+order);
> > > > > }
> > > > >
> > > > > Appreciate your help!
> > > > >
> > > > > --
> > > > > Thanks,
> > > > >
> > > > > Raj .G. Narasimhan
> > > >
> > > >
> > > > --
> > > > inexso - information exchange solutions GmbH
> > > > Bismarckstraße 13 | 26122 Oldenburg
> > > > Tel.: +49 441 4082 356 |
> > > > FAX: +49 441 4082 355 | www.inexso.de
> > > >
> > >
> > >
> > >
> > > --
> > > Thanks,
> > >
> > > Raj .G. Narasimhan
> >
> >
> > --
> >
> >
> >
> > inexso - information exchange solutions GmbH
> > Bismarckstraße 13 | 26122 Oldenburg
> > Tel.: +49 441 4082 356 |
> > FAX: +49 441 4082 355 | www.inexso.de
> >
>
>
>
> --
> Thanks,
>
> Raj .G. Narasimhan
--
inexso - information exchange solutions GmbH
Bismarckstraße 13 | 26122 Oldenburg
Tel.: +49 441 4082 356 |
FAX: +49 441 4082 355 | www.inexso.de
Re: [tobago] :Issue with ValueChangeEvent & Validator
Posted by "Raj .G. Narasimhan" <go...@gmail.com>.
Yes, I did....Volker... But, there is none...
thanks,
-R
On Thu, Feb 21, 2008 at 9:59 AM, Volker Weber <v....@inexso.de> wrote:
> than it should work!
>
> can you add a tc:messages tag inside the orderPanel to ensure there
> are no conversion/validation errors.
>
> 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > Thanks Volker, for the reply!
> >
> > The SelectOneListBox with the facet, is within the rendered panel
> > (orderPanel which encloses both this selectListOneBox component, as well
> as
> > the 'orderDetailPanel'). Hence, I expected the value of
> SelectOneListBox,
> > to be processed. And, it's not.
> >
> > I will try with the other two options....
> >
> > Appreciate it!
> >
> > tx,
> > -R
> >
> >
> >
> > <tc:panel id="orderPanel">
> > ....
> > ...
> > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > <f:facet name="layout">
> > <tc:gridLayout rows="*" columns="*" margin="2px" />
> > </f:facet>
> > <tc:selectOneListbox value="#{orderPanelController.order}"
> >
> > valueChangeListener="#{orderPanelController.showInDetail}"
> >
> > validator="#{orderPanelController.validateListSelection}">
> > <f:selectItems value="#{orderPanelController.orders}" />
> > <f:converter converterId="deviceOrderId" />
> >
> > <f:facet name="click">
> > <tc:command action="#{orderPanelController.returnNull}">
> > <tc:attribute value=":cdbmainpage:orderPanel"
> > name="renderedPartially" />
> > </tc:command>
> > </f:facet>
> > <%-- I tired the same command with 'change' facet' also %>
> > </tc:selectOneListbox>
> >
> > </tc:box>
> >
> > <tc:panel id="orderDetailPanel">
> >
> >
> > On Thu, Feb 21, 2008 at 3:22 AM, Volker Weber <v....@inexso.de>
> wrote:
> > > Hi Raj,
> > >
> > > if i interpret your code snippet correct,
> > >
> > > the selectOneListbox with the click/change facet is NOT inside the
> > > partially rendered panel. This is the problem, only the content of the
> > > partiallyRendered component is processed on the server.
> > >
> > > you have two(tree) choices:
> > > 1. include the listbox into the renderedPartially scope.
> > > 2. invoke the processing of listbox lifecycle in your action.
> > > UIComponent listbox = facesContext.getViewRoot().findComponent(<id
> > > of listbox>);
> > > listbox.processDecodes(facesContect);
> > > listbox.processValidations(facesContect);
> > > listbox.processUpdates(facesContect);
> > >
> > > 3.(experimental) use 1.1-SNAPSHOT version.
> > > you can declare full page to be submitted (and processed) partially
> and
> > > in your action method remove the page and add orderPanel from/to the
> > > partially
> > > component list.
> > >
> > >
> > > Regards,
> > > Volker
> > >
> > > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > >
> > >
> > >
> > > > I am trying to show the details of 'SelectItem' object of
> > SelectOneListBox
> > > > on a set of Input fields. Problem that I am facing is, whenever the
> page
> > is
> > > > rendered partially, it always returns the 'value' of
> SelectOneListBox as
> > > > null. I have tried using both 'change' and 'click' facets, and both
> of
> > them
> > > > are not giving the desired results.
> > > >
> > > > Here's the scenario, in little detail:
> > > >
> > > > When I use, 'click' facet, and tried to select different list items:
> > > >
> > > > ** In the valueChangeEvent, everytime it's retaining the initially
> set
> > value
> > > > (First item of List box, which I set when I render the panel for the
> > first
> > > > time) .
> > > >
> > > > ** getValue() of the source component in the valueChange event, is
> > > > supposedly returning the binding value, if the current value is
> null.
> > And, I
> > > > guess, this is the reason, it retains the old value, if the current
> > > > localvalue is null.
> > > >
> > > > ** After this listerner call, it tries to set the value of the
> > > > SelectOneListBox's bound value as null, and this results in
> NPException,
> > as
> > > > the 'DetailPanel's fields are this object's properties.
> > > >
> > > > ** I tried intercepting with a Validator - Surprisingly, this is
> not
> > called
> > > > at all...
> > > >
> > > >
> > > > When I use "Change" facet and tried to select different list items:
> > > > ** ValueChangeEvent does not occur at all
> > > > **Agreeably, 'change' facet's command is also not called
> > > > **No validator call is made
> > > >
> > > > Here's the code snippet:
> > > > <tc:panel id="orderPanel">
> > > > ....
> > > > ...
> > > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > > <f:facet name="layout">
> > > > <tc:gridLayout rows="*" columns="*" margin="2px" />
> > > > </f:facet>
> > > > <tc:selectOneListbox value="#{orderPanelController.order}"
> > > >
> > > >
> > valueChangeListener="#{orderPanelController.showInDetail}"
> > > >
> > > >
> > validator="#{orderPanelController.validateListSelection}">
> > > > <f:selectItems value="#{orderPanelController.orders}" />
> > > > <f:converter converterId="deviceOrderId" />
> > > >
> > > > <f:facet name="click">
> > > > <tc:command action="#{
> orderPanelController.returnNull}">
> > > > <tc:attribute value=":cdbmainpage:orderPanel"
> > > > name="renderedPartially" />
> > > > </tc:command>
> > > > </f:facet>
> > > > <%-- I tired the same command with 'change' facet' also %>
> > > > </tc:selectOneListbox>
> > > >
> > > > </tc:box>
> > > >
> > > > <tc:panel id="orderDetailPanel">
> > > > ....
> > > > ..
> > > >
> > > > OrderPanelController:
> > > > public void showInDetail(ValueChangeEvent valChangeEvent) {
> > > > UISelectOne select =
> > > > (UISelectOne)valChangeEvent.getComponent();
> > > > if(select.getValue() == null){
> > > > LOG.finer("Value is null");
> > > > return;
> > > > }
> > > > order = (DeviceOrder) select.getValue();
> > > > LOG.finer("Selected Order: "+select.getValue());
> > > > return;
> > > > }
> > > >
> > > > public void validateListSelection(FacesContext context,
> > > > UIComponent component, Object value) throws ValidatorException {
> > > > if (value == null) {
> > > > System.out.println("List validation:Came here : Value is
> > null");
> > > > return;
> > > > }
> > > > order = (DeviceOrder) value;
> > > > LOG.finer("Selected order in validation: "+order);
> > > > }
> > > >
> > > > Appreciate your help!
> > > >
> > > > --
> > > > Thanks,
> > > >
> > > > Raj .G. Narasimhan
> > >
> > >
> > > --
> > > inexso - information exchange solutions GmbH
> > > Bismarckstraße 13 | 26122 Oldenburg
> > > Tel.: +49 441 4082 356 |
> > > FAX: +49 441 4082 355 | www.inexso.de
> > >
> >
> >
> >
> > --
> > Thanks,
> >
> > Raj .G. Narasimhan
>
>
> --
> inexso - information exchange solutions GmbH
> Bismarckstraße 13 | 26122 Oldenburg
> Tel.: +49 441 4082 356 |
> FAX: +49 441 4082 355 | www.inexso.de
>
--
Thanks,
Raj .G. Narasimhan
Re: [tobago] :Issue with ValueChangeEvent & Validator
Posted by Volker Weber <v....@inexso.de>.
than it should work!
can you add a tc:messages tag inside the orderPanel to ensure there
are no conversion/validation errors.
2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> Thanks Volker, for the reply!
>
> The SelectOneListBox with the facet, is within the rendered panel
> (orderPanel which encloses both this selectListOneBox component, as well as
> the 'orderDetailPanel'). Hence, I expected the value of SelectOneListBox,
> to be processed. And, it's not.
>
> I will try with the other two options....
>
> Appreciate it!
>
> tx,
> -R
>
>
>
> <tc:panel id="orderPanel">
> ....
> ...
> <tc:box label="#{rsrcBundle.order_orderListLabel}">
> <f:facet name="layout">
> <tc:gridLayout rows="*" columns="*" margin="2px" />
> </f:facet>
> <tc:selectOneListbox value="#{orderPanelController.order}"
>
> valueChangeListener="#{orderPanelController.showInDetail}"
>
> validator="#{orderPanelController.validateListSelection}">
> <f:selectItems value="#{orderPanelController.orders}" />
> <f:converter converterId="deviceOrderId" />
>
> <f:facet name="click">
> <tc:command action="#{orderPanelController.returnNull}">
> <tc:attribute value=":cdbmainpage:orderPanel"
> name="renderedPartially" />
> </tc:command>
> </f:facet>
> <%-- I tired the same command with 'change' facet' also %>
> </tc:selectOneListbox>
>
> </tc:box>
>
> <tc:panel id="orderDetailPanel">
>
>
> On Thu, Feb 21, 2008 at 3:22 AM, Volker Weber <v....@inexso.de> wrote:
> > Hi Raj,
> >
> > if i interpret your code snippet correct,
> >
> > the selectOneListbox with the click/change facet is NOT inside the
> > partially rendered panel. This is the problem, only the content of the
> > partiallyRendered component is processed on the server.
> >
> > you have two(tree) choices:
> > 1. include the listbox into the renderedPartially scope.
> > 2. invoke the processing of listbox lifecycle in your action.
> > UIComponent listbox = facesContext.getViewRoot().findComponent(<id
> > of listbox>);
> > listbox.processDecodes(facesContect);
> > listbox.processValidations(facesContect);
> > listbox.processUpdates(facesContect);
> >
> > 3.(experimental) use 1.1-SNAPSHOT version.
> > you can declare full page to be submitted (and processed) partially and
> > in your action method remove the page and add orderPanel from/to the
> > partially
> > component list.
> >
> >
> > Regards,
> > Volker
> >
> > 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> >
> >
> >
> > > I am trying to show the details of 'SelectItem' object of
> SelectOneListBox
> > > on a set of Input fields. Problem that I am facing is, whenever the page
> is
> > > rendered partially, it always returns the 'value' of SelectOneListBox as
> > > null. I have tried using both 'change' and 'click' facets, and both of
> them
> > > are not giving the desired results.
> > >
> > > Here's the scenario, in little detail:
> > >
> > > When I use, 'click' facet, and tried to select different list items:
> > >
> > > ** In the valueChangeEvent, everytime it's retaining the initially set
> value
> > > (First item of List box, which I set when I render the panel for the
> first
> > > time) .
> > >
> > > ** getValue() of the source component in the valueChange event, is
> > > supposedly returning the binding value, if the current value is null.
> And, I
> > > guess, this is the reason, it retains the old value, if the current
> > > localvalue is null.
> > >
> > > ** After this listerner call, it tries to set the value of the
> > > SelectOneListBox's bound value as null, and this results in NPException,
> as
> > > the 'DetailPanel's fields are this object's properties.
> > >
> > > ** I tried intercepting with a Validator - Surprisingly, this is not
> called
> > > at all...
> > >
> > >
> > > When I use "Change" facet and tried to select different list items:
> > > ** ValueChangeEvent does not occur at all
> > > **Agreeably, 'change' facet's command is also not called
> > > **No validator call is made
> > >
> > > Here's the code snippet:
> > > <tc:panel id="orderPanel">
> > > ....
> > > ...
> > > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > > <f:facet name="layout">
> > > <tc:gridLayout rows="*" columns="*" margin="2px" />
> > > </f:facet>
> > > <tc:selectOneListbox value="#{orderPanelController.order}"
> > >
> > >
> valueChangeListener="#{orderPanelController.showInDetail}"
> > >
> > >
> validator="#{orderPanelController.validateListSelection}">
> > > <f:selectItems value="#{orderPanelController.orders}" />
> > > <f:converter converterId="deviceOrderId" />
> > >
> > > <f:facet name="click">
> > > <tc:command action="#{orderPanelController.returnNull}">
> > > <tc:attribute value=":cdbmainpage:orderPanel"
> > > name="renderedPartially" />
> > > </tc:command>
> > > </f:facet>
> > > <%-- I tired the same command with 'change' facet' also %>
> > > </tc:selectOneListbox>
> > >
> > > </tc:box>
> > >
> > > <tc:panel id="orderDetailPanel">
> > > ....
> > > ..
> > >
> > > OrderPanelController:
> > > public void showInDetail(ValueChangeEvent valChangeEvent) {
> > > UISelectOne select =
> > > (UISelectOne)valChangeEvent.getComponent();
> > > if(select.getValue() == null){
> > > LOG.finer("Value is null");
> > > return;
> > > }
> > > order = (DeviceOrder) select.getValue();
> > > LOG.finer("Selected Order: "+select.getValue());
> > > return;
> > > }
> > >
> > > public void validateListSelection(FacesContext context,
> > > UIComponent component, Object value) throws ValidatorException {
> > > if (value == null) {
> > > System.out.println("List validation:Came here : Value is
> null");
> > > return;
> > > }
> > > order = (DeviceOrder) value;
> > > LOG.finer("Selected order in validation: "+order);
> > > }
> > >
> > > Appreciate your help!
> > >
> > > --
> > > Thanks,
> > >
> > > Raj .G. Narasimhan
> >
> >
> > --
> > inexso - information exchange solutions GmbH
> > Bismarckstraße 13 | 26122 Oldenburg
> > Tel.: +49 441 4082 356 |
> > FAX: +49 441 4082 355 | www.inexso.de
> >
>
>
>
> --
> Thanks,
>
> Raj .G. Narasimhan
--
inexso - information exchange solutions GmbH
Bismarckstraße 13 | 26122 Oldenburg
Tel.: +49 441 4082 356 |
FAX: +49 441 4082 355 | www.inexso.de
Re: [tobago] :Issue with ValueChangeEvent & Validator
Posted by "Raj .G. Narasimhan" <go...@gmail.com>.
Thanks Volker, for the reply!
The SelectOneListBox with the facet, is within the rendered panel
(orderPanel which encloses both this selectListOneBox component, as well as
the 'orderDetailPanel'). Hence, I expected the value of SelectOneListBox,
to be processed. And, it's not.
I will try with the other two options....
Appreciate it!
tx,
-R
*<tc:panel id="orderPanel">
....
...
<tc:box label="#{rsrcBundle.order_orderListLabel}">
<f:facet name="layout">
<tc:gridLayout rows="*" columns="*" margin="2px" />
</f:facet>
<tc:selectOneListbox value="#{orderPanelController.order}"
valueChangeListener="#{orderPanelController.showInDetail}"
validator="#{orderPanelController.validateListSelection}">
<f:selectItems value="#{orderPanelController.orders}" />
<f:converter converterId="deviceOrderId" />
<f:facet name="click">
<tc:command action="#{orderPanelController.returnNull}">
<tc:attribute value=":cdbmainpage:orderPanel"
name="renderedPartially" />
</tc:command>
</f:facet>
<%-- I tired the same command with 'change' facet' also %>
</tc:selectOneListbox>
</tc:box>
<tc:panel id="orderDetailPanel">*
On Thu, Feb 21, 2008 at 3:22 AM, Volker Weber <v....@inexso.de> wrote:
> Hi Raj,
>
> if i interpret your code snippet correct,
>
> the selectOneListbox with the click/change facet is NOT inside the
> partially rendered panel. This is the problem, only the content of the
> partiallyRendered component is processed on the server.
>
> you have two(tree) choices:
> 1. include the listbox into the renderedPartially scope.
> 2. invoke the processing of listbox lifecycle in your action.
> UIComponent listbox = facesContext.getViewRoot().findComponent(<id
> of listbox>);
> listbox.processDecodes(facesContect);
> listbox.processValidations(facesContect);
> listbox.processUpdates(facesContect);
>
> 3.(experimental) use 1.1-SNAPSHOT version.
> you can declare full page to be submitted (and processed) partially and
> in your action method remove the page and add orderPanel from/to the
> partially
> component list.
>
>
> Regards,
> Volker
>
> 2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> > I am trying to show the details of 'SelectItem' object of
> SelectOneListBox
> > on a set of Input fields. Problem that I am facing is, whenever the page
> is
> > rendered partially, it always returns the 'value' of SelectOneListBox as
> > null. I have tried using both 'change' and 'click' facets, and both of
> them
> > are not giving the desired results.
> >
> > Here's the scenario, in little detail:
> >
> > When I use, 'click' facet, and tried to select different list items:
> >
> > ** In the valueChangeEvent, everytime it's retaining the initially set
> value
> > (First item of List box, which I set when I render the panel for the
> first
> > time) .
> >
> > ** getValue() of the source component in the valueChange event, is
> > supposedly returning the binding value, if the current value is null.
> And, I
> > guess, this is the reason, it retains the old value, if the current
> > localvalue is null.
> >
> > ** After this listerner call, it tries to set the value of the
> > SelectOneListBox's bound value as null, and this results in NPException,
> as
> > the 'DetailPanel's fields are this object's properties.
> >
> > ** I tried intercepting with a Validator - Surprisingly, this is not
> called
> > at all...
> >
> >
> > When I use "Change" facet and tried to select different list items:
> > ** ValueChangeEvent does not occur at all
> > **Agreeably, 'change' facet's command is also not called
> > **No validator call is made
> >
> > Here's the code snippet:
> > <tc:panel id="orderPanel">
> > ....
> > ...
> > <tc:box label="#{rsrcBundle.order_orderListLabel}">
> > <f:facet name="layout">
> > <tc:gridLayout rows="*" columns="*" margin="2px" />
> > </f:facet>
> > <tc:selectOneListbox value="#{orderPanelController.order}"
> >
> > valueChangeListener="#{orderPanelController.showInDetail}"
> >
> > validator="#{orderPanelController.validateListSelection}">
> > <f:selectItems value="#{orderPanelController.orders}" />
> > <f:converter converterId="deviceOrderId" />
> >
> > <f:facet name="click">
> > <tc:command action="#{orderPanelController.returnNull}">
> > <tc:attribute value=":cdbmainpage:orderPanel"
> > name="renderedPartially" />
> > </tc:command>
> > </f:facet>
> > <%-- I tired the same command with 'change' facet' also %>
> > </tc:selectOneListbox>
> >
> > </tc:box>
> >
> > <tc:panel id="orderDetailPanel">
> > ....
> > ..
> >
> > OrderPanelController:
> > public void showInDetail(ValueChangeEvent valChangeEvent) {
> > UISelectOne select =
> > (UISelectOne)valChangeEvent.getComponent();
> > if(select.getValue() == null){
> > LOG.finer("Value is null");
> > return;
> > }
> > order = (DeviceOrder) select.getValue();
> > LOG.finer("Selected Order: "+select.getValue());
> > return;
> > }
> >
> > public void validateListSelection(FacesContext context,
> > UIComponent component, Object value) throws ValidatorException {
> > if (value == null) {
> > System.out.println("List validation:Came here : Value is
> null");
> > return;
> > }
> > order = (DeviceOrder) value;
> > LOG.finer("Selected order in validation: "+order);
> > }
> >
> > Appreciate your help!
> >
> > --
> > Thanks,
> >
> > Raj .G. Narasimhan
>
>
> --
> inexso - information exchange solutions GmbH
> Bismarckstraße 13 | 26122 Oldenburg
> Tel.: +49 441 4082 356 |
> FAX: +49 441 4082 355 | www.inexso.de
>
--
Thanks,
Raj .G. Narasimhan
Re: [tobago] :Issue with ValueChangeEvent & Validator
Posted by Volker Weber <v....@inexso.de>.
Hi Raj,
if i interpret your code snippet correct,
the selectOneListbox with the click/change facet is NOT inside the
partially rendered panel. This is the problem, only the content of the
partiallyRendered component is processed on the server.
you have two(tree) choices:
1. include the listbox into the renderedPartially scope.
2. invoke the processing of listbox lifecycle in your action.
UIComponent listbox = facesContext.getViewRoot().findComponent(<id
of listbox>);
listbox.processDecodes(facesContect);
listbox.processValidations(facesContect);
listbox.processUpdates(facesContect);
3.(experimental) use 1.1-SNAPSHOT version.
you can declare full page to be submitted (and processed) partially and
in your action method remove the page and add orderPanel from/to the
partially
component list.
Regards,
Volker
2008/2/21, Raj .G. Narasimhan <go...@gmail.com>:
> I am trying to show the details of 'SelectItem' object of SelectOneListBox
> on a set of Input fields. Problem that I am facing is, whenever the page is
> rendered partially, it always returns the 'value' of SelectOneListBox as
> null. I have tried using both 'change' and 'click' facets, and both of them
> are not giving the desired results.
>
> Here's the scenario, in little detail:
>
> When I use, 'click' facet, and tried to select different list items:
>
> ** In the valueChangeEvent, everytime it's retaining the initially set value
> (First item of List box, which I set when I render the panel for the first
> time) .
>
> ** getValue() of the source component in the valueChange event, is
> supposedly returning the binding value, if the current value is null. And, I
> guess, this is the reason, it retains the old value, if the current
> localvalue is null.
>
> ** After this listerner call, it tries to set the value of the
> SelectOneListBox's bound value as null, and this results in NPException, as
> the 'DetailPanel's fields are this object's properties.
>
> ** I tried intercepting with a Validator - Surprisingly, this is not called
> at all...
>
>
> When I use "Change" facet and tried to select different list items:
> ** ValueChangeEvent does not occur at all
> **Agreeably, 'change' facet's command is also not called
> **No validator call is made
>
> Here's the code snippet:
> <tc:panel id="orderPanel">
> ....
> ...
> <tc:box label="#{rsrcBundle.order_orderListLabel}">
> <f:facet name="layout">
> <tc:gridLayout rows="*" columns="*" margin="2px" />
> </f:facet>
> <tc:selectOneListbox value="#{orderPanelController.order}"
>
> valueChangeListener="#{orderPanelController.showInDetail}"
>
> validator="#{orderPanelController.validateListSelection}">
> <f:selectItems value="#{orderPanelController.orders}" />
> <f:converter converterId="deviceOrderId" />
>
> <f:facet name="click">
> <tc:command action="#{orderPanelController.returnNull}">
> <tc:attribute value=":cdbmainpage:orderPanel"
> name="renderedPartially" />
> </tc:command>
> </f:facet>
> <%-- I tired the same command with 'change' facet' also %>
> </tc:selectOneListbox>
>
> </tc:box>
>
> <tc:panel id="orderDetailPanel">
> ....
> ..
>
> OrderPanelController:
> public void showInDetail(ValueChangeEvent valChangeEvent) {
> UISelectOne select =
> (UISelectOne)valChangeEvent.getComponent();
> if(select.getValue() == null){
> LOG.finer("Value is null");
> return;
> }
> order = (DeviceOrder) select.getValue();
> LOG.finer("Selected Order: "+select.getValue());
> return;
> }
>
> public void validateListSelection(FacesContext context,
> UIComponent component, Object value) throws ValidatorException {
> if (value == null) {
> System.out.println("List validation:Came here : Value is null");
> return;
> }
> order = (DeviceOrder) value;
> LOG.finer("Selected order in validation: "+order);
> }
>
> Appreciate your help!
>
> --
> Thanks,
>
> Raj .G. Narasimhan
--
inexso - information exchange solutions GmbH
Bismarckstraße 13 | 26122 Oldenburg
Tel.: +49 441 4082 356 |
FAX: +49 441 4082 355 | www.inexso.de