Skip to main content

JSF2.0.2+Spring 3.0 Issue passing parameter to ManagedBean

3 replies [Last post]
userjava1
Offline
Joined: 2009-06-03
Points: 0

Hi,

I am having issue passing parameters from my dataTable to Managed beans. Here is the snippet

(i is var="i" in datatable and i can see its value)

------------------------------------------------------

or

--------------------------------

My Bean (mybean)

public String getDa() throws Exception{
System.o.p("Inside");
}

public String getDa(final int usrId) throws Exception{
System.o.p("Inside"+usrId);

}

Question

1. It doesnot even call the method. Can you pls help me how to fix this?

Thanks,
User

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Ed Burns

On 2/25/10 6:21 PM, webtier@javadesktop.org wrote:
> Hi,
>
> I am having issue passing parameters from my dataTable to Managed beans. Here is the snippet
>
> (i is var="i" in datatable and i can see its value)
>
> ------------------------------------------------------
>
>
>

> or
>

I understand that this is not the most intuitive thing in the world, but
the "action" attribute is special. It's value is a MethodExpression
that points to a method that takes no arguments and returns an Object
whose toString method will be passed into the navigation system to
decide where to go next.

So, in your case it would be .

Now, it looks like you're doing Master/Detail or similar here. This
excellent blog entry from my esteemed colleague Jason Lee has what you
need, and more. In fact the challenge may be in extracting just what you
need from the and more.

http://blogs.steeplesoft.com/2009/10/jsf-2-hdatatable-and-ajax-updates/

I hope this helps.

Ed

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

userjava1
Offline
Joined: 2009-06-03
Points: 0

Thanks Ed.

Is that the only way? I thought JSF2.0 had better EL support.

In general is there no way to call a method with parameter directly?

Thanks,
User.

Ed Burns

On 2/25/10 9:58 PM, webtier@javadesktop.org wrote:
> Thanks Ed.
>
> Is that the only way? I thought JSF2.0 had better EL support.
>
> In general is there no way to call a method with parameter directly?

Oh sure, there is. This is an example from chapter 5 of my book:


The text after the colon comes from the invocation of
a method via the EL:
#{model.generateSentance(param.word1, param.word2)}


Ed

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net