You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by mitroiasi <mi...@yahoo.com> on 2009/04/27 15:36:33 UTC

disable a component in bean


Hi,

I have this code:

<h:panelGroup>
  <h:selectBooleanCheckbox
      id="quarterChose"
      onclick="changeCheckBox();"
      value="#{user.quarterChose}">
  </h:selectBooleanCheckbox>
</h:panelGroup>
<h:panelGroup>
  <t:selectOneMenu id="quarterDropDownId" 
      value="#{user.selectedQuarter}">
      <f:selectItems
	value="#{user.quarters}" />
  </t:selectOneMenu>
</h:panelGroup>

in javascript when the checkbox is deselected the select field is disabled.
But when the select fiedl is disabled and the form is processed server-side
an error message is shown. I think the field's value is not sent anymore.

I want to try to implement this behavior server-side in the bean code with
the help of the f:valueChangeListener.
Can someone provide me some code which shows me how can I change the
appeareace of one component (e.g. from disabled="false" to disabled="true").

 
-- 
View this message in context: http://www.nabble.com/disable-a-component-in-bean-tp23256426p23256426.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: disable a component in bean

Posted by mitroiasi <mi...@yahoo.com>.

Hi Cagatay,

The following error message is shown:
Exception setting property selectedQuarter of base with class
com.app.UiUser, Bean: com.app.UiUser, property: selectedQuarter, null

-- 
View this message in context: http://www.nabble.com/disable-a-component-in-bean-tp23256426p23256631.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: disable a component in bean

Posted by Cagatay Civici <ca...@gmail.com>.
What's the error message you're getting from server?

On Mon, Apr 27, 2009 at 2:36 PM, mitroiasi <mi...@yahoo.com> wrote:

>
>
> Hi,
>
> I have this code:
>
> <h:panelGroup>
>  <h:selectBooleanCheckbox
>      id="quarterChose"
>      onclick="changeCheckBox();"
>      value="#{user.quarterChose}">
>  </h:selectBooleanCheckbox>
> </h:panelGroup>
> <h:panelGroup>
>  <t:selectOneMenu id="quarterDropDownId"
>      value="#{user.selectedQuarter}">
>      <f:selectItems
>        value="#{user.quarters}" />
>  </t:selectOneMenu>
> </h:panelGroup>
>
> in javascript when the checkbox is deselected the select field is disabled.
> But when the select fiedl is disabled and the form is processed server-side
> an error message is shown. I think the field's value is not sent anymore.
>
> I want to try to implement this behavior server-side in the bean code with
> the help of the f:valueChangeListener.
> Can someone provide me some code which shows me how can I change the
> appeareace of one component (e.g. from disabled="false" to
> disabled="true").
>
>
> --
> View this message in context:
> http://www.nabble.com/disable-a-component-in-bean-tp23256426p23256426.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>