Skip to main content

JSF2: how to set value to managed bean when clicking on table cell?

1 reply [Last post]
ericmacau
Offline
Joined: 2003-08-27

Hello,

How can I define an action or event when clicking on a table cell () to set a specific value to the managed bean property?

For example,

@ManagedBean(name="myBean")
@SessionScoped
class MyBean {
private List values = new ArrayList();

private void setValues(List vals) {
...
}

private void getValues() {

}

private void addValue(String s) {

}
}

in the index.xhtml
1

How can I set the call MyBean.addValue when clicking on the ???

Best regards,
Eric

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Lincoln Baxter, III

Not sure how to specifically attach that event to the entire TD, but... this
might help:

http://ocpsoft.com/java/jsf-java/jsfs-hdatatable-vs-uirepeat-how-to-get-...

--Lincoln

On Sun, Jan 24, 2010 at 10:46 PM, wrote:

> Hello,
>
> How can I define an action or event when clicking on a table cell (
> onclick='....'>) to set a specific value to the managed bean property?
>
> For example,
>
> @ManagedBean(name="myBean")
> @SessionScoped
> class MyBean {
> private List values = new ArrayList();
>
> private void setValues(List vals) {
> ...
> }
>
> private void getValues() {
>
> }
>
> private void addValue(String s) {
>
> }
> }
>
>
> in the index.xhtml
>
1

>
>
>
> How can I set the call MyBean.addValue when clicking on the
???
>
> Best regards,
> Eric
> [Message sent by forum member 'ericmacau' (ericmacau@gmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=382687
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
[att1.html]