You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Sylvain Vieujot <sv...@apache.org> on 2005/02/07 04:11:52 UTC

Strange problem with h:selectBooleanCheckbox

I've been trying to find why the h:selectBooleanCheckbox looses it's
submit value.

I've found that the decode seems to work fine. The following
modification in HtmlCheckBoxRendererBase prints the proper submitted
value.
But somehow, in the rendering phase, the submitted value has been set to
null again.

If someone has any idea, it would help !

    public void decode(FacesContext facesContext, UIComponent
uiComponent) {
        RendererUtils.checkParamValidity(facesContext, uiComponent,
null);
        if (uiComponent instanceof UISelectBoolean) {
System.out.print("Going for decode ... ");
            HtmlRendererUtils.decodeUISelectBoolean(facesContext,
uiComponent);
System.out.println(((UISelectBoolean)uiComponent).getSubmittedValue());
        } else if (uiComponent instanceof UISelectMany) {
            HtmlRendererUtils.decodeUISelectMany(facesContext,
uiComponent);
        } else {
            throw new IllegalArgumentException("Unsupported component
class "
                    + uiComponent.getClass().getName());
        }
    }

Thanks,

Sylvain.

Re: Strange problem with h:selectBooleanCheckbox

Posted by Heath Borders <he...@gmail.com>.
I'm not too familiar with how the panelTabbedPane works, so I don't
think I can be of much more help.  Sorry.


On Mon, 07 Feb 2005 08:11:20 -0400, Sylvain Vieujot <sv...@apache.org> wrote:
> Sure, but in this case, the check box is in a tab from an x:panelTabbedPane,
> and the submitted value is set to null even when you click on another tab.
> That is even when the validation phase hasn't been called.
> 
> 
> On Sun, 2005-02-06 at 21:18 -0600, Heath Borders wrote: 
> As long as the input validates, all of the submittedValues will be
> cleared.


On Sun, 06 Feb 2005 23:11:52 -0400, Sylvain Vieujot
> <sv...@apache.org> wrote:
> I've been trying to find why the
> h:selectBooleanCheckbox looses it's submit
> value.
> 
> I've found that the
> decode seems to work fine. The following modification
> in
> HtmlCheckBoxRendererBase prints the proper submitted value.
> But somehow,
> in the rendering phase, the submitted value has been set to
> null again.
>
> 
> If someone has any idea, it would help !
> 
> public void
> decode(FacesContext facesContext, UIComponent uiComponent)
> {
>
> RendererUtils.checkParamValidity(facesContext, uiComponent, null);
> if
> (uiComponent instanceof UISelectBoolean) {
> System.out.print("Going for
> decode ... ");
> HtmlRendererUtils.decodeUISelectBoolean(facesContext,
>
> uiComponent);
>
> System.out.println(((UISelectBoolean)uiComponent).getSubmittedValue());
> }
> else if (uiComponent instanceof UISelectMany) {
>
> HtmlRendererUtils.decodeUISelectMany(facesContext,
> uiComponent);
> } else
> {
> throw new IllegalArgumentException("Unsupported component class
> "
> +
> uiComponent.getClass().getName());
> }
> }
> 
> Thanks,
> 
> Sylvain. 




-- 
-Heath Borders-Wing
hborders@mail.win.org

Re: Strange problem with h:selectBooleanCheckbox

Posted by Heath Borders <he...@gmail.com>.
As long as the input validates, all of the submittedValues will be cleared.


On Sun, 06 Feb 2005 23:11:52 -0400, Sylvain Vieujot <sv...@apache.org> wrote:
>  I've been trying to find why the h:selectBooleanCheckbox looses it's submit
> value.
>  
>  I've found that the decode seems to work fine. The following modification
> in HtmlCheckBoxRendererBase prints the proper submitted value.
>  But somehow, in the rendering phase, the submitted value has been set to
> null again.
>  
>  If someone has any idea, it would help !
>  
>      public void decode(FacesContext facesContext, UIComponent uiComponent)
> {
>          RendererUtils.checkParamValidity(facesContext, uiComponent, null);
>          if (uiComponent instanceof UISelectBoolean) {
>  System.out.print("Going for decode ... ");
>              HtmlRendererUtils.decodeUISelectBoolean(facesContext,
> uiComponent);
>  System.out.println(((UISelectBoolean)uiComponent).getSubmittedValue());
>          } else if (uiComponent instanceof UISelectMany) {
>              HtmlRendererUtils.decodeUISelectMany(facesContext,
> uiComponent);
>          } else {
>              throw new IllegalArgumentException("Unsupported component class
> "
>                      + uiComponent.getClass().getName());
>          }
>      }
>  
>  Thanks,
>  
>  Sylvain. 


-- 
-Heath Borders-Wing
hborders@mail.win.org