You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by Renzo Tomaselli <re...@tecnotp.it> on 2007/01/17 18:58:11 UTC

[Trinidad] tr:commandNavigationItem with skin icon

Hi, while it's fairly elegant to have tr:icon picking up actual image contents
through skin redirection, I wonder if this can be generalized.  
Specifically, components such as tr:commandNavigationItem have an icon
attribute, but it wants the image uri straightaway.  
Is there any way to get it through EL and then from skin (css) on the java
side ?  
Thanks -- Renzo  
  


Re: [Trinidad] tr:commandNavigationItem with skin icon

Posted by Jeanne Waldman <je...@oracle.com>.
You could do something like this:
    RenderingContext rc = RenderingContext.getCurrentInstance();
    Skin skin = rc.getSkin();
    if (skin != null)
    {
        Icon icon = skin.getIcon("af|selectManyChoice::dropdown-icon");
        if (icon != null)
        {
            Object url = 
icon.getImageURI(FacesContext.getCurrentInstance(), rc);
            return url;

        }
    }

Renzo Tomaselli wrote:
> Hi, while it's fairly elegant to have tr:icon picking up actual image 
> contents through skin redirection, I wonder if this can be generalized.
> Specifically, components such as tr:commandNavigationItem have an icon 
> attribute, but it wants the image uri straightaway.
> Is there any way to get it through EL and then from skin (css) on the 
> java side ?
> Thanks -- Renzo
>

tr:inputText disabled="true" & pageFlowScope

Posted by Mark Dopheide <md...@qwizics.com>.
Guidance required on this issue...

Realizing that when using tr:inputText and pageFlowScope (or saveState) the
readOnly (or disabled) attributes do not get submitted to the backing bean
as to the model, then...

What is recommended practice when these "disabled" values are to be
persisted? For example, if I am using pageFlowScope and in my backing bean
has something like:
    User user = (User) app.getVariableResolver().resolveVariable(context,
"user");

And my web pages contains:
	<tr:inputText id="regCode"
		label="#{text['registration.candidateId']} : "
		value="#{pageFlowScope.registration.candidateId}"
		disabled="true"
		contentStyle="margin: 1em 0 0 0;color: blue" 
		required="true"/>

then this "regCode" attribute that is declared "readOnly" does not appear in
my User model in the backing bean. This is kind of a pain in the keyboard
;^)

What is recommended practice in these situations? Certainly <h:inputHidden
on the disabled attributes is possible but this seems to lack the elegance
that I would expect.

I mean when using hibernate, etc I would just like to get the model (my
POJO) back from the view and do a userManager.save(user) but when readOnly
attributes are vacant then this isn't as easy as I think it should be.
Having a view object that gets transferred to my POJO just seems like so
much unnecessary code.

Any tips or hints on best practices related to this issue would be greatly
appreciated...


Best regards to all,

Mark