facebook

JSF validation bug

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #257175 Reply

    augustientje
    Member

    In my JSF files, the MyEclipse editor in 5.01 flags every occurance of i18n keys as a warning. The way I’m using i18n keys is straight from the book and I’m sure I didn’t make a mistake there. It’s simply a loadbundle tag like this: <f:loadBundle basename=”app.bundle.messages” var=”msg”/>.

    Everywhere msg is used in EL, a warning appears.

    When I run my web application I can see al my text. Switching between languages also works.

    So the MyEclipse editor is lying to me?

    Why?

    #257224 Reply

    Riyad Kalla
    Member

    Can you give me an example of how you are using “msg” when it’s flagged? Locally I have no flagged errors *and* I get autocomplete with the msg bundle for the keys included inside of the bundle even.

    #258535 Reply

    iddorin
    Member

    I have the same problem, I have alot of Warning messages in Eclipse related to bundle.

    Here is the code used:

    <f:view locale=”it”>
    <h:form id=”loginForm” rendered=”true”>
    <f:loadBundle basename=”com.company.ResourceBundle” var=”mesaj”/>
    <h:outputLabel rendered=”true”>
    <h:outputText value=”#{mesaj.WelcomeText}”/>
    </h:outputLabel>
    </h:form>
    </f:view>

    The warning message is (Yellow underline):
    ‘mesaj cannot be resolved’

    Appreciate any help
    Thanks

    #258536 Reply

    iddorin
    Member

    And I have another validation bug. When I use for example:

    <h:graphicImage rendered=”true” value=”/images/green02.gif” width=”100%” height=”1″ />

    I got a warning saying:
    ‘Value is not a valid integer’

    And the “100%” is underlined with the yellow line.

    #258542 Reply

    Riyad Kalla
    Member

    iddorin,
    Is this a Web Project with JSF capabilities added to it? The fastest way to check is to open your project properties, go to MyEclipse and tell me which icons are highlighted.

    #258595 Reply

    iddorin
    Member

    Yes, it is a Web Project. I created it as a Web Project, and added JSF capabilities to it.

    The other JSF features work fine (autocomplete, validations, and so on), but I only have those 2 issues with the warnings.

    It’s important to test MyEclipse well because my company is starting a new project and we might choose to work with MyEclipse and they will buy some licenes for the company if everything is fine.

    As to project properties, under the MyEclipse menu are highlighted the following:
    -Add Struts capabilities
    -Add Tapestry capabilities
    -Add JSTL capabilities
    -Remove Web Project capabilities

    The following items are already disabled (because I added those capabilities):
    -Add Hibernate capabilities
    -Add JSF capabilities
    -Add Spring capabilities
    -Add Web Project capabilities

    Thanks
    Dorin

    #258599 Reply

    Riyad Kalla
    Member

    Doring,
    This is very strange. Can you create a small test project that exhibits this same problem and email it to me at support@genuitec.com ATTN Riyad, with a link to this discussion?

    #258733 Reply

    iddorin
    Member

    I sent you a small project with all those issues.
    Before give me a final answer can you tell me at least if you got the same warnings?

    Thanks
    Dorin

    #258770 Reply

    Riyad Kalla
    Member

    Dorin,
    I sure did see the same problem, and when I renamed one of your property bundles from _en.properties to remove the extension and just callde it ResourceBundle.properties, then cleaned the project, the error went away.

    This looks like a bug to me actually, the validator is not honoring the platform encoding and looking for the respective file, it is instead looking for exactly the bundle with the givne base name. What you can do to work around the problem is to specify the exact basename you want, like ResourceBundle_it, but I realize that isn’t what you want. I think you want to keep exactly what you have and I’ll file a bug to have us look into this.

    #258824 Reply

    iddorin
    Member

    Riyad,
    Thanks for your quick answering. Do you think this issue will be solved in the next release?

    Because the application will be multilanguage. The language will be specified in view, and will be take from a bean, so will not be fixed.

    Example:
    now it is: <f:view locale=”it”>
    but in the real application it will be: <f:view locale=”#{LoginBean.userLanguage}”>

    So the load bundle should look in the general way as it is right now and not particularizated like you adviced me to do

    <f:loadBundle basename=”it.acse.crm.resource.ResourceBundle” var=”bundle”/>
    and not
    <f:loadBundle basename=”it.acse.crm.resource.ResourceBundle_it” var=”bundle”/>

    What about the percentage warning? (see details the 6’th above message in this thread)

    Thanks
    Dorin

    #258841 Reply

    Riyad Kalla
    Member

    Dorin,
    I don’t think this will get fixed in the next release just because we have an existing list of top priority items that have to get addressed first that effect more users unfortunately (prioritizing these releases to cover the most user requirements is tricky).

    As for the percentage warning, I would suggest turning off the HTML validator. I persoally leave it off as it’s a bit too pedantic for me. We are improving it with each release, but right now I still notice it flagging more unnecessary warnings than it should.

    #265849 Reply

    Craig Peters
    Member

    I’d like to add my vote for the bundle issue listed above…my code is riddled with warnings because of this issue, plus one other.

    I use a lot of data tables, and the iterator variable is also unrecognized by MyEclipse parsing

    example:

    
     
    <h:dataTable id="ManagerList" value="#{managersBean.managerList}" var="item"
            rows="20" cellpadding="4" styleClass="tableBody">
        <h:column id="LocationName">
            <f:facet name="header">
                <h:outputText value="#{bundle.worklocation}"/>
            </f:facet>
            <h:commandLink    id="EditLocMgrBtn" 
                    action="editmanager" 
                    actionListener="#{managerBean.selectLocation}">
                    <h:outputText value="#{item.workLocName}" />
                    <f:param id="locCode" name="loc" value="#{item.workLocCd}"/>
            </h:commandLink>
        </h:column>
    .
    .
    .
    
    

    Every reference to both “bundle” and “item” is flagged as a warning.

    Yikes!!

    Thanks,
    -Craig

    #265866 Reply

    ratewatch
    Member

    We have the same issue as craigrpeters. Our project is peppered with yellow underlining for both “bundle cannot be resolved” and “item cannot be resolved” issues. Every dataTable, dataList, etc, the “var” variable is underlined everywhere it is used as “cannot be resolved”.

    #265871 Reply

    Riyad Kalla
    Member

    We don’t like that the editor is creating extra noise for you guys, I”m sorry about that. This is still on our TODO list and will likely be addressed to some extent in 6.0.

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: JSF validation bug

You must be logged in to post in the forum log in