Re: Checkbox event

2005-11-04 Thread Bruno Aranda
Maybe a variation of the method proposed in
http://wiki.apache.org/myfaces/SubmitPageOnValueChange is useful to
you.  You can have a hidden (with css) button that is clicked
automatically when you select the checkbox...

Regards,

Bruno

2005/11/4, [EMAIL PROTECTED] [EMAIL PROTECTED]:
 That was helpful. But, I would like to try some other way to utilize the power
 of JSF :).

 Is there a action event or valuechange event for checkbox. Any idea?

 Thanks.


 Quoting Simon Kitching [EMAIL PROTECTED]:

  [EMAIL PROTECTED] wrote:
   Hi,
  
   I need to display a list box when a checkbox is clicked. I guess we need
  to
   implement OnSelect event for this purpose. Please, correct me here if I am
  wrong.
   Does anybody have some examples of using onSelect in the backing  bean?.
  Any help
   is appreciated.
  
 
  onSelect is a *client side* thing only. It is a normal HTML feature that
  allows an arbitrary piece of scripting to be run in the browser. Nothing
  to do with JSF at all.
 
  You could implement what you want entirely on the client by ensuring
  your page includes the listbox, but with its style set to display:none.
  You should then be able to specify some script in the checkbox onSelect
  attribute which finds that component and sets its style to visible. This
  is really not JSF at all but that doesn't mean it's a bad solution.
 
  Alternatively, I expect you could map the checkbox value to some boolean
  value on a backing bean, and use the same value to control the
  rendered attribute of the listbox.
 h:selectBooleanCheckbox value=#{someBean.listBoxEnabled}/
 h:selectManyListbox rendered=#{someBean.listBoxEnabled} ... /
  The problem here is that you need some mechanism for submitting the
  entire form back to the server when the checkbox value is changed so the
  page can be regenerated.
 
 
  Maybe you can use tomahawk's collapsible panel control instead of the
  checkbox/listbox combination, and avoid the whole issue?
 
  Regards,
 
  Simon
 





RE: Checkbox event

2005-11-04 Thread CONNER, BRENDAN \(SBCSI\)
If you really want the checkbox to invoke a back-end action, I believe
you'd have to do a short onselect JavaScript call to automatically
click a hidden h:commandLink component that itself is defined to
invoke the action.  That's because actions are normally invoked only as
a result of clicking on a link or button.

- Brendan

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 03, 2005 11:08 PM
To: MyFaces Discussion; Simon Kitching
Cc: MyFaces Discussion
Subject: Re: Checkbox event


That was helpful. But, I would like to try some other way to utilize the
power
of JSF :).

Is there a action event or valuechange event for checkbox. Any idea?

Thanks.


Quoting Simon Kitching [EMAIL PROTECTED]:

 [EMAIL PROTECTED] wrote:
  Hi,
  
  I need to display a list box when a checkbox is clicked. I guess we
need
 to
  implement OnSelect event for this purpose. Please, correct me here
if I am
 wrong. 
  Does anybody have some examples of using onSelect in the backing
bean?.
 Any help 
  is appreciated.
  
 
 onSelect is a *client side* thing only. It is a normal HTML feature
that 
 allows an arbitrary piece of scripting to be run in the browser.
Nothing 
 to do with JSF at all.
 
 You could implement what you want entirely on the client by ensuring 
 your page includes the listbox, but with its style set to
display:none. 
 You should then be able to specify some script in the checkbox
onSelect 
 attribute which finds that component and sets its style to visible.
This 
 is really not JSF at all but that doesn't mean it's a bad solution.
 
 Alternatively, I expect you could map the checkbox value to some
boolean 
 value on a backing bean, and use the same value to control the 
 rendered attribute of the listbox.
h:selectBooleanCheckbox value=#{someBean.listBoxEnabled}/
h:selectManyListbox rendered=#{someBean.listBoxEnabled} ... /
 The problem here is that you need some mechanism for submitting the 
 entire form back to the server when the checkbox value is changed so
the 
 page can be regenerated.
 
 
 Maybe you can use tomahawk's collapsible panel control instead of the 
 checkbox/listbox combination, and avoid the whole issue?
 
 Regards,
 
 Simon
 




Re: Checkbox event

2005-11-03 Thread Simon Kitching

[EMAIL PROTECTED] wrote:

Hi,

I need to display a list box when a checkbox is clicked. I guess we need to
implement OnSelect event for this purpose. Please, correct me here if I am wrong. 
Does anybody have some examples of using onSelect in the backing  bean?. Any help 
is appreciated.




onSelect is a *client side* thing only. It is a normal HTML feature that 
allows an arbitrary piece of scripting to be run in the browser. Nothing 
to do with JSF at all.


You could implement what you want entirely on the client by ensuring 
your page includes the listbox, but with its style set to display:none. 
You should then be able to specify some script in the checkbox onSelect 
attribute which finds that component and sets its style to visible. This 
is really not JSF at all but that doesn't mean it's a bad solution.


Alternatively, I expect you could map the checkbox value to some boolean 
value on a backing bean, and use the same value to control the 
rendered attribute of the listbox.

  h:selectBooleanCheckbox value=#{someBean.listBoxEnabled}/
  h:selectManyListbox rendered=#{someBean.listBoxEnabled} ... /
The problem here is that you need some mechanism for submitting the 
entire form back to the server when the checkbox value is changed so the 
page can be regenerated.



Maybe you can use tomahawk's collapsible panel control instead of the 
checkbox/listbox combination, and avoid the whole issue?


Regards,

Simon


Re: Checkbox event

2005-11-03 Thread speriyas
That was helpful. But, I would like to try some other way to utilize the power
of JSF :).

Is there a action event or valuechange event for checkbox. Any idea?

Thanks.


Quoting Simon Kitching [EMAIL PROTECTED]:

 [EMAIL PROTECTED] wrote:
  Hi,
  
  I need to display a list box when a checkbox is clicked. I guess we need
 to
  implement OnSelect event for this purpose. Please, correct me here if I am
 wrong. 
  Does anybody have some examples of using onSelect in the backing  bean?.
 Any help 
  is appreciated.
  
 
 onSelect is a *client side* thing only. It is a normal HTML feature that 
 allows an arbitrary piece of scripting to be run in the browser. Nothing 
 to do with JSF at all.
 
 You could implement what you want entirely on the client by ensuring 
 your page includes the listbox, but with its style set to display:none. 
 You should then be able to specify some script in the checkbox onSelect 
 attribute which finds that component and sets its style to visible. This 
 is really not JSF at all but that doesn't mean it's a bad solution.
 
 Alternatively, I expect you could map the checkbox value to some boolean 
 value on a backing bean, and use the same value to control the 
 rendered attribute of the listbox.
h:selectBooleanCheckbox value=#{someBean.listBoxEnabled}/
h:selectManyListbox rendered=#{someBean.listBoxEnabled} ... /
 The problem here is that you need some mechanism for submitting the 
 entire form back to the server when the checkbox value is changed so the 
 page can be regenerated.
 
 
 Maybe you can use tomahawk's collapsible panel control instead of the 
 checkbox/listbox combination, and avoid the whole issue?
 
 Regards,
 
 Simon