Expression Language (EL) not working for id tag

Wondering why assigning a variable to an id tag does not work, although you can assign the variable to the for or value attribute without any problems?

The reason is that expression evaluation on the id attribute is explicitly disallowed (maybe for some security reasons). So you cannot generate dynamic ids using EL as in the code below.

<ui:repeat value="#{bean.elements}" var="e">
<h:outputlabel value="#{e.label}" for="#{e.id}">
<h:inputtext id="#{e.id}" value="#{bean[e.variable]}">
</h:inputtext></h:outputlabel></ui:repeat>

You will likely get an Illegal Argument Exception.

But you can simply write the code as follows, JSF will automatically assign an iteration number to the id myid and the final id will be the same for outputLabel and inputText.

<ui:repeat value="#{bean.elements}" var="e">
<h:outputlabel value="#{e.label}" for="myid">
<h:inputtext id="myid" value="#{bean[e.variable]}">
</h:inputtext></h:outputlabel></ui:repeat>

You can verify this by checking the ids in FireBug.

Firebug results:

<label for="bean:j_id53:0:myid" ...="">
<input id="bean:j_id53:0:myid" ...="">
<label for="bean:j_id53:1:myid" ...="">
<input id="bean:j_id53:1:myid" ...="">
<label for="bean:j_id53:2:myid" ...="">
<input id="bean:j_id53:2:myid" ...="">

Seam Authenticator.authenticate if-outcome

Maybe you are wondering why the following navigation rule in your pages.xml does not work, although your authenticate() method returns „true“ for successful login:

<page view-id="/login.xhtml">
  <navigation>
    <rule if-outcome="true">
      <redirect view-id="/anotherpage.xhtml">
    </redirect></rule>
  </navigation>
</page>

If you are using Seam’s Identity.login() method…

<h:commandbutton action="#{identity.login}">

…your authenticate() is called/wrapped by Identity.login(). Thus the return value „true“ is swallowed by Identity.login() which in turn terminates with the outcome „loggedIn“ and not „true“! So the following code should do the trick:

<page view-id="/login.xhtml">
  <navigation>
    <rule if-outcome="loggedIn">
      <redirect view-id="/anotherpage.xhtml">
    </redirect></rule>
  </navigation>
</page>

Tresor aka Tresen

Als gebürtiger Berliner und bekennender Electroholiker möchte ich an dieser Stelle eine Empfehlung für den weltweit bekannten Berliner electro Club Tresor abgeben. Er befindet sich in einer einmaligen Location in einem ehemaligen Heizkraftwerk. Hier ein paar private Aufnahmen aus 2007:

Tresor

Hier noch ein kurzer Abriß der Geschichte des einstigen underground Clubs.

Changing rich:separator color using CSS

To change the color of your RichFaces separator…

<rich:separator linetype="solid" height="1px">

…you likely have tried the following in your CSS:

.rich-separator {
background-color: red;
}

But it did not work, huh? So you tried this:

.rich-separator {
background-color: red;
background-image: none;
}

Oh man still not working, right? The reason is that there is already a background-image value defined (maybe with !important declaration in the user style sheet) or your own author style sheet definition is overridden by a succeeding definition.

In this case you have to mark your definition with !important.

.rich-separator {
background-color: red;
background-image: none !important;
}