You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Tender Slim <xs...@gmx.com> on 2010/02/24 01:00:00 UTC

How do I programmatically open a portlet from a JSF backing bean?

Say I have two portlets: ResultListPortlet and DetailPortlet.
ResultListPortlet contains list of (say) customers which  the user can click
to view in the DetailPortlet. I don't want the user to see  the  
DetailPortlet when the user has not selected any customer to view.
DetailPortlet will only be rendered  when the user has selected an item in
the ResultListPortlet and had clicked a 'Browse' button. Following this,
there will be two portlets displayed.  

Question:

1.Is there a way to accomplish this in a JSF backing bean ?
2.If not, is there a way to do it in a psml file i.e., render DetailPortlet
only when required ?
3.If not, any other suggestions? 

Thanks for your help.
-- 
View this message in context: http://old.nabble.com/How-do-I-programmatically-open-a-portlet-from-a-JSF-backing-bean--tp27712672p27712672.html
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: How do I programmatically open a portlet from a JSF backing bean?

Posted by David Sean Taylor <d....@onehippo.com>.
On Wed, Feb 24, 2010 at 7:51 AM, Tender Slim <xs...@gmx.com> wrote:

>
> Hello David Sean Taylor-3,
>

LOL


>
> Thanks for your response. And thanks also for the “HideDecorator” hint.
> From
> your answer, am I correct in concluding that DetailPortlet must be rendered
> even when it is empty? Ideally, I would rather not render  DetailPortlet
> unless it contains something in it. But, I suppose, to meet my “must not be
> empty” requirement, the “No application selected" message could do the
> trick. I have looked into “pam.psml” and j2-admin::RegistryApplicationsList
> and j2-admin::ApplicationDetails are similar to my ResultListPortlet and
> DetailPortlet. But is there, really, no other way?
>
> BTW I am using 2.2.0
>
>
Its up to your application to determine the 'empty' state and then render
its content. Rendering empty content is not an exceptional case. There is no
standard way to say 'my portlet is empty, dont render me'

The solution recommended in the previous email (HideDecorator), in addition
to rendering empty content (just render an empty string) should work for you
with minimal effort

I think we could try to better formalize this use case in the upcoming
release

Re: How do I programmatically open a portlet from a JSF backing bean?

Posted by Tender Slim <xs...@gmx.com>.
Hello David Sean Taylor-3,

Thanks for your response. And thanks also for the “HideDecorator” hint. From
your answer, am I correct in concluding that DetailPortlet must be rendered
even when it is empty? Ideally, I would rather not render  DetailPortlet
unless it contains something in it. But, I suppose, to meet my “must not be
empty” requirement, the “No application selected" message could do the
trick. I have looked into “pam.psml” and j2-admin::RegistryApplicationsList
and j2-admin::ApplicationDetails are similar to my ResultListPortlet and
DetailPortlet. But is there, really, no other way? 

BTW I am using 2.2.0

Thanks


David Sean Taylor-3 wrote:
> 
> On Tue, Feb 23, 2010 at 4:00 PM, Tender Slim <xs...@gmx.com> wrote:
> 
>>
>> Say I have two portlets: ResultListPortlet and DetailPortlet.
>> ResultListPortlet contains list of (say) customers which  the user can
>> click
>> to view in the DetailPortlet. I don't want the user to see  the
>> DetailPortlet when the user has not selected any customer to view.
>> DetailPortlet will only be rendered  when the user has selected an item
>> in
>> the ResultListPortlet and had clicked a 'Browse' button. Following this,
>> there will be two portlets displayed.
>>
>> Question:
>>
>> 1.Is there a way to accomplish this in a JSF backing bean ?
>> 2.If not, is there a way to do it in a psml file i.e., render
>> DetailPortlet
>> only when required ?
>> 3.If not, any other suggestions?
>>
>>
> Take a look at the Portlet Application Manager:
> 
> http://localhost:8080/jetspeed/ui/Administrative/pam.psml
> 
> In the details we display the message "No application selected." until the
> content is available, similar to what you are doing. Take a look at the
> j2-admin project for code examples
> 
> If you do not want the entire decorator to display, meaning you don't want
> to see the title bar, action icons and border, you can set the decorator
> to
> clear...
> 
> If that is still not good enough, in 2.1.x and 2.2.0 you can turn off the
> decorator from your portlet doView like this:
> 
>   getPortletRequest().setAttribute("HideDecorator", new Boolean(true))
> 
> In the trunk, we may need to add this feature back in....
> 
> Let us know how that works
> 
> 

-- 
View this message in context: http://old.nabble.com/How-do-I-programmatically-open-a-portlet-from-a-JSF-backing-bean--tp27712672p27714236.html
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: How do I programmatically open a portlet from a JSF backing bean?

Posted by David Sean Taylor <d....@onehippo.com>.
On Tue, Feb 23, 2010 at 4:00 PM, Tender Slim <xs...@gmx.com> wrote:

>
> Say I have two portlets: ResultListPortlet and DetailPortlet.
> ResultListPortlet contains list of (say) customers which  the user can
> click
> to view in the DetailPortlet. I don't want the user to see  the
> DetailPortlet when the user has not selected any customer to view.
> DetailPortlet will only be rendered  when the user has selected an item in
> the ResultListPortlet and had clicked a 'Browse' button. Following this,
> there will be two portlets displayed.
>
> Question:
>
> 1.Is there a way to accomplish this in a JSF backing bean ?
> 2.If not, is there a way to do it in a psml file i.e., render DetailPortlet
> only when required ?
> 3.If not, any other suggestions?
>
>
Take a look at the Portlet Application Manager:

http://localhost:8080/jetspeed/ui/Administrative/pam.psml

In the details we display the message "No application selected." until the
content is available, similar to what you are doing. Take a look at the
j2-admin project for code examples

If you do not want the entire decorator to display, meaning you don't want
to see the title bar, action icons and border, you can set the decorator to
clear...

If that is still not good enough, in 2.1.x and 2.2.0 you can turn off the
decorator from your portlet doView like this:

  getPortletRequest().setAttribute("HideDecorator", new Boolean(true))

In the trunk, we may need to add this feature back in....

Let us know how that works