-
1. Re: EL expression for id attributes?
sergeysmirnov May 23, 2008 6:09 PM (in response to grimholtz)"grimholtz" wrote:
<a4j:commandButton id="#{fooBean.id}" />
Yes. but only if you use Facelets. However, ${fooBean.id} is possible in case of JSF 1.2 (with Facelets or not)"grimholtz" wrote:
<a4j:include viewId="#{barBean.viewId}" />
Yes -
2. Re: EL expression for id attributes?
grimholtz May 23, 2008 7:33 PM (in response to grimholtz)Hi Sergey,
I'm using Facelets and JSF 1.2, but in both examples the id resolves to null. But I know the id isn't null... If I output it with:<h:outputText value="#{fooBean.id}/>
or<h:outputText value="#{barBean.viewId}/>
the id is shown correctly (not null). Must I use ${fooBean.id} and ${barBean.viewId} for both to work with <a4j:commandButton/> and <a4j:include/> ?
Thank you. -
3. Re: EL expression for id attributes?
sergeysmirnov May 23, 2008 7:45 PM (in response to grimholtz)it is resolved to null on what JSF lifecycle phase? 2nd or 6th?
-
4. Re: EL expression for id attributes?
grimholtz May 23, 2008 10:04 PM (in response to grimholtz)"SergeySmirnov" wrote:
it is resolved to null on what JSF lifecycle phase? 2nd or 6th?
Good question. Where should I look in the a4j/richfaces logging for that information? -
5. Re: EL expression for id attributes?
sergeysmirnov May 24, 2008 2:36 AM (in response to grimholtz)You can put the phase tracker into the classpath to see it. For example, you cat take the ready-to-use one from http://www.jsftutorials.net/faces-config/phaseTracker.html
-
6. Re: EL expression for id attributes?
ziphyre May 30, 2008 4:00 PM (in response to grimholtz)Yep, same problem here
(not exactly)<div id="message_#{msg.id}_body"></div> <a4j:commandLink id="message_#{msg.id}_send" /> <h:outputLink id="message_#{msg.id}_send" />
renders to:<div id="message_45_body"></div> <a4j:commandLink id="messages:message__send" /> <h:outputLink id="message___send" />
the difference from grimholtz' is in my case <h:outputLink> ids aren't correct also...
Using richface 3.2.0.SP1
facelets with seam 2.0.2 -
7. Re: EL expression for id attributes?
grimholtz May 30, 2008 5:13 PM (in response to grimholtz)Update: I created a PhaseListener and output the EL expression in all phases. It's not obvious to me that it's null in phase 2 or 6, but I'm still investigating.
-
8. Re: EL expression for id attributes?
nbelaevski May 31, 2008 7:09 AM (in response to grimholtz)Hello,
The following code:<rich:tabPanel id="#{capitalsBean.capitalsOptions[0].value}_1" switchType="server" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class" inactiveTabClass="inactive_tab" activeTabClass="active_tab"> <rich:tab label="Usage"> <ui:include src="/richfaces/listShuttle/listShuttle.xhtml"/> </rich:tab> <ui:include src="/templates/include/tagInfo.xhtml"> <ui:param name="path" value="rich/listShuttle"/> </ui:include> </rich:tabPanel>
outputs correct id="Montgomery_1", so this feature should be working. Maybe msg.id is null or that is an issue of Facelets version you are using?
I've tried on: RichFaces 3.2.1, Facelets 1.1.14 -
9. Re: EL expression for id attributes?
ziphyre Jun 1, 2008 12:28 PM (in response to grimholtz)Hi,
I'm using richfaces 3.2.0 with facelets 1.1.14
id can't be null because this code :<div id="m_#{msg.id}"><div> <a4j:commandLink id="m_s_#{msg.id}" />
renders<div id="m_1"></div> <a4j:commandLink id="m_" />
So, it's ok for div but not for a4j:commandLink... -
10. Re: EL expression for id attributes?
grimholtz Jun 1, 2008 3:21 PM (in response to grimholtz)So, it's ok for div but not for a4j:commandLink...
But Sergey says it *should* work for a4j:commandLink ! -
11. Re: EL expression for id attributes?
grimholtz Jun 1, 2008 3:22 PM (in response to grimholtz)So, it's ok for div but not for a4j:commandLink...
But Sergey says it *should* work for a4j:commandLink ! -
12. Re: EL expression for id attributes?
ziphyre Jun 2, 2008 3:40 AM (in response to grimholtz)But it ain't...
I don't know if it's relevant but this:<a4j:commandLink id="message_#{msg.id}_title" styleClass="mClass_#{msg.id}" />
renders as:<a id="hotspotForm:messages:0:message__title" class="mClass_45" />
PS: And sorry, in my previous posts I wrote down in examples that <a4j:commandLink id="m_s_#{msg.id}"/> renders as <a4j:commandLink id="m_"/>. Although the output is obviously an <a.../>. The problem is on ids only, not the tag itself -
13. Re: EL expression for id attributes?
ziphyre Jun 2, 2008 5:18 AM (in response to grimholtz)grimholtz,
In my case, I needed these unique ids for javascript access on the browser. So I applied a (ugly) workaround using prototype library. It's specifying unique class names with #{msg.id}<a4j:commandLink styleClass="message_#{msg.id}" />
and than accessing these components with, a for example, a parent div with a unique id like:$('id_of_the_parent_div').getElementsByClassName('mClass_#{msg.id}')[0]
hope this helps.. -
14. Re: EL expression for id attributes?
ziphyre Jun 2, 2008 5:19 AM (in response to grimholtz)sorry:
$('id_of_the_parent_div').getElementsByClassName('mClass_#{msg.id}')[0]