0

I am in the process of upgrading an old JSF 1 web application to JSF 2 (specifically from MyFaces 1.1 to MyFaces 2.2.12). The old application used JSP which I am right now replacing with Facelets. I am mainly using Migrating from JSF 1.2 to JSF 2.0 as a guide.

There are a few component libraries used in the old version of the web application that seemingly aren't supported in Facelets for which I need to find suitable replacements.

One of those are the "EasySi" tags from the JSF-Comp project. We use the "selectItems" tag from that library, but according to the last answer in this thread on the PrimeFaces forum, EasySi indeed only supports JSP by default.

According to the JSF 2.2/Facelets documention of selectItems, the selectItems tag in the core library specifically supports the itemValue and itemLabel attributes (among others) since version 2. These are the attributes we used with the EasySi version of selectItems in our old JSP templates.

So, my question is:

Does the selectItems from the JSF 2 core tag library has the exact same functionality as the selectItems from the JSF 1 component library EasySi? In other words, can I replace something like

<%@ taglib uri="http://sourceforge.net/projects/jsf-comp/easysi" prefix="si" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>

    ...

    <t:selectOneMenu>
        <si:selectItems value="#{someExpression}" var="item" itemLabel="#{item}" itemValue="#{item}"/>
    </t:selectOneMenu>

in a JSF 1 JSP template with something like

<!DOCTYPE html>
<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://xmlns.jcp.org/jsf/core"
    xmlns:t="http://myfaces.apache.org/tomahawk">

    ...

    <t:selectOneMenu>
        <f:selectItems value="#{someExpression}" var="item" itemLabel="#{item}" itemValue="#{item}"/>
    </t:selectOneMenu>

in my Facelet and expect the same behavior as before?

Community
  • 1
  • 1
scholt
  • 147
  • 2
  • 16
  • sorry to maybe sound a little blunt, but... 'try' would be my answer... With a small addition/question... What is the advantage of using Tomahawk? The built-in user/role stuff... If only that, I'd try to implement that differently with e.g. a `` around tags... Tomahawk is not the best maintained library anymore... – Kukeltje May 04 '17 at 08:48
  • @Kukeltje thanks for taking the time to read my question. I would have just tried whether replacing the tag would keep the intended behaviour, but since I am in the middle of the migration and a lot of stuff doesn't work right now, it's kind of difficult to verify it via testing right now. I would also have liked an answer explaining whether the updated JSF 2 tag indeed added the attributes whose omission in JSF 1 led to the creation of something like JSF-Comp and EasySi. – scholt May 04 '17 at 09:40
  • Keep in mind that we are busy to, very busy... and that your work is most likely paid and or help to you is unpaid. And since the library you used is old, jsf 1.x is to and the combination is even rarer, the chance of getting an answer is low, certainly in the way you post your question (see my 'try'). And since you have the code, I would think trying is less work than creating this question.... Help from me unfortunately stops here, since I just do not know the answer. – Kukeltje May 04 '17 at 09:46
  • I understand what you are saying and tried to replace the tag with the equivalent from the core library in one Facelet that already works, and it seems - as far as I can tell - that `f:selectItems` in JSF 2 indeed has the same behaviour as `si:selectItems`, at least the resulting ` – scholt May 04 '17 at 10:55

0 Answers0