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 "Causevic, Dzenan" <dc...@navisite.com> on 2006/10/30 19:20:53 UTC

Can we use bean to specify id attribute value

I would like to specify the id attribute value with bean (like I do for actionListener, action, and selected attributes) but my browser is throwing an error message complaining about this.

   <tr:navigationPane hint="tabs">
      <tr:commandNavigationItem id="login" text="Home" actionListener="#{commandNavigationItem.navigationItemAction}" action="#{navigationTabsBean.getNavigationCase}" selected="#{navigationTabsBean.selectedLogin}"/>
      <tr:commandNavigationItem id="codeOfCond" text="Code of Conduct" actionListener="#{commandNavigationItem.navigationItemAction}" action="#{navigationTabsBean.getNavigationCase}" selected="#{navigationTabsBean.selectedCodeOfCond}"/>      
   </tr:navigationPane> 

I would like to use id attributre like following 

   <tr:navigationPane hint="tabs">
      <tr:commandNavigationItem id=""#{navigationTabsBean.loginId} text="Home" actionListener="#{commandNavigationItem.navigationItemAction}" action="#{navigationTabsBean.getNavigationCase}" selected="#{navigationTabsBean.selectedLogin}"/>
      <tr:commandNavigationItem id="#{navigationTabsBean.codeOfCondId" text="Code of Conduct" actionListener="#{commandNavigationItem.navigationItemAction}" action="#{navigationTabsBean.getNavigationCase}" selected="#{navigationTabsBean.selectedCodeOfCond}"/>      
   </tr:navigationPane> 

Is this possible or does the id attribute must be hard coded like in the code on the top?

Re: Can we use bean to specify id attribute value

Posted by Simon Lessard <si...@gmail.com>.
Yeah, hard coded is the way to go.

On 10/30/06, Olivier Lafontaine <ol...@gmail.com> wrote:
>
> EL expressions are usually not supported for the id attribute. At least,
> the
> JSF specification states that it is not supported for the standard
> component
> classes, see section 3.1.4 of the spec.
>
> So unless it is explicitly stated in the documentation of a component, I
> guess it is not supported.
>
> This makes sense considering the id must be stable throughout the
> component
> life.
>
> Olivier
>
> On 10/30/06, Causevic, Dzenan < dcausevic@navisite.com> wrote:
> >
> >
> > I would like to specify the id attribute value with bean (like I do for
> > actionListener, action, and selected attributes) but my browser is
> throwing
> > an error message complaining about this.
> >
> >    <tr:navigationPane hint="tabs">
> >       <tr:commandNavigationItem id="login" text="Home"
> actionListener="#{
> > commandNavigationItem.navigationItemAction}" action="#{
> > navigationTabsBean.getNavigationCase}" selected="#{
> > navigationTabsBean.selectedLogin}"/>
> >       <tr:commandNavigationItem id="codeOfCond" text="Code of Conduct"
> > actionListener="#{ commandNavigationItem.navigationItemAction}"
> action="#{
> > navigationTabsBean.getNavigationCase}" selected="#{
> > navigationTabsBean.selectedCodeOfCond}"/>
> >    </tr:navigationPane>
> >
> > I would like to use id attributre like following
> >
> >    <tr:navigationPane hint="tabs">
> >       <tr:commandNavigationItem id=""#{navigationTabsBean.loginId}
> > text="Home" actionListener="#{commandNavigationItem.navigationItemAction}"
> action="#{
> > navigationTabsBean.getNavigationCase}" selected="#{
> > navigationTabsBean.selectedLogin}"/>
> >       <tr:commandNavigationItem id="#{navigationTabsBean.codeOfCondId"
> > text="Code of Conduct" actionListener="#{
> > commandNavigationItem.navigationItemAction}" action="#{
> > navigationTabsBean.getNavigationCase}" selected="#{
> > navigationTabsBean.selectedCodeOfCond}"/>
> >    </tr:navigationPane>
> >
> > Is this possible or does the id attribute must be hard coded like in the
> > code on the top?
> >
> >
>
>

Re: Can we use bean to specify id attribute value

Posted by Olivier Lafontaine <ol...@gmail.com>.
EL expressions are usually not supported for the id attribute. At least, the
JSF specification states that it is not supported for the standard component
classes, see section 3.1.4 of the spec.

So unless it is explicitly stated in the documentation of a component, I
guess it is not supported.

This makes sense considering the id must be stable throughout the component
life.

Olivier

On 10/30/06, Causevic, Dzenan < dcausevic@navisite.com> wrote:
>
>
> I would like to specify the id attribute value with bean (like I do for
> actionListener, action, and selected attributes) but my browser is throwing
> an error message complaining about this.
>
>    <tr:navigationPane hint="tabs">
>       <tr:commandNavigationItem id="login" text="Home" actionListener="#{
> commandNavigationItem.navigationItemAction}" action="#{
> navigationTabsBean.getNavigationCase}" selected="#{
> navigationTabsBean.selectedLogin}"/>
>       <tr:commandNavigationItem id="codeOfCond" text="Code of Conduct"
> actionListener="#{ commandNavigationItem.navigationItemAction}" action="#{
> navigationTabsBean.getNavigationCase}" selected="#{
> navigationTabsBean.selectedCodeOfCond}"/>
>    </tr:navigationPane>
>
> I would like to use id attributre like following
>
>    <tr:navigationPane hint="tabs">
>       <tr:commandNavigationItem id=""#{navigationTabsBean.loginId}
> text="Home" actionListener="#{commandNavigationItem.navigationItemAction}" action="#{
> navigationTabsBean.getNavigationCase}" selected="#{
> navigationTabsBean.selectedLogin}"/>
>       <tr:commandNavigationItem id="#{navigationTabsBean.codeOfCondId"
> text="Code of Conduct" actionListener="#{
> commandNavigationItem.navigationItemAction}" action="#{
> navigationTabsBean.getNavigationCase}" selected="#{
> navigationTabsBean.selectedCodeOfCond}"/>
>    </tr:navigationPane>
>
> Is this possible or does the id attribute must be hard coded like in the
> code on the top?
>
>