You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Deady <pa...@mail.ru> on 2006/10/13 12:21:42 UTC

ViewController problem

I've read about shale and tried to use it, but got a problem.

I have 2 beans:
image$list - in request scope (previously it was normal sessionScope bean)
imageBean - in session scope

I have page with images.
In generated page there is list  of groups of image with links on each to
show images in selected: clicking on group redisplays page with image list
in group - this done by parsing parameters in prerender method 

Next, in image list I have a commandLink to show image details, which action
is like this:
<h:commandLink action="#{imageBean.showImage}" >Show Image</...>

But that method is never called. I suppose this is because when viewing
image list, url is like http://.../image/list.jsf?groupId=12, so cliking in
image (i.e. the commandLink) causes this page to redisplay the same url
(standart JSF behaivor with commandLink), and Shale catches this and do not
allow JSF to handle commandLink action correctly.

I can't rewrite imageBean in the "Shale way" 'cause this will make me to
rewrite the hole web application.

Any suggestion?
-- 
View this message in context: http://www.nabble.com/ViewController-problem-tf2436168.html#a6793183
Sent from the Shale - User mailing list archive at Nabble.com.


Re: ViewController problem

Posted by Craig McClanahan <cr...@apache.org>.
On 10/13/06, Deady <pa...@mail.ru> wrote:
>
>
> I've read about shale and tried to use it, but got a problem.
>
> I have 2 beans:
> image$list - in request scope (previously it was normal sessionScope bean)
> imageBean - in session scope
>
> I have page with images.
> In generated page there is list  of groups of image with links on each to
> show images in selected: clicking on group redisplays page with image list
> in group - this done by parsing parameters in prerender method
>
> Next, in image list I have a commandLink to show image details, which
> action
> is like this:
> <h:commandLink action="#{imageBean.showImage}" >Show Image</...>
>
> But that method is never called. I suppose this is because when viewing
> image list, url is like http://.../image/list.jsf?groupId=12, so cliking
> in
> image (i.e. the commandLink) causes this page to redisplay the same url
> (standart JSF behaivor with commandLink), and Shale catches this and do
> not
> allow JSF to handle commandLink action correctly.


Hmmm ... Shale does not block calls to your action methods (although it will
catch and log an exception if your action method throws one), so there is
probably something else going on.  A couple of things to think about:

* An <h:commandLink> component is "a hyperlink that submits a form",
  so you need to make sure it's nested inside an <h:form> component.

* You might want to look at using <h:outputLink> instead if you are
  passing request parameters to define which image to display.

Craig


I can't rewrite imageBean in the "Shale way" 'cause this will make me to
> rewrite the hole web application.
>
> Any suggestion?
> --
> View this message in context:
> http://www.nabble.com/ViewController-problem-tf2436168.html#a6793183
> Sent from the Shale - User mailing list archive at Nabble.com.
>
>