This blog is obsolete.
Check new posts at ADF How To! !!

Friday, June 12, 2009

A different way...

Hi all
J

We were very interested in Resource Bundle files problem. And in a past few days we discovered that there are at least 3 workarounds:

  1. commenting SET tags (current solution)
    pros: easy to implement, no low memory problem cons: no labels on page, cannot add/remove/change labels
  2. using SET tags with one additional backing bean (our solution)
    pros: labels visible on a page, using the same SET tag, can add/remove/change labels (not trough wizard), no low memory problem cons: not so easy to implement
  3. using LOADBUNDLE tag (solution we found on web, not ours L)
    pros: easy to implement, labels visible on a page, can add/remove/change labels (not trough wizard), no low memory problem cons: not using SET tag (in our opinion not a problem at all)

As much as it hurts us to admit, we think that third solution is the best. Pls let us know if it works for u as it works for us. If u need us to explain it in details how to implement (which is just one more line in page J), pls don’t hesitate to ask.

Hope u like it J

Milos Rebic (milos.rebic@gmail.com) & Spiros Dougeridis

P.S. Details: First comment all SET tags. LOADBUNDLE tag is JSF core library tag. When u drag&drop it on a page u should just specify the same things as for SET tag (copy/paste J).

SET tag: = "#{adfBundle['com.mni.mednext.view.messages.frame_titles']}"/> -->

LOADBUNDLE tag:

PS2: Example:



*important*important*important*

USE SAME VARS FOR SAME BUNDLES !!!!!!!!!!!!

Don’t use wizard for adding new labels (it will again create SET tag, and u don’t want that J), do it manualy

*important*important*important*

Easy, isn’t it J And all tags are visible on page. When u finish with development, erase LOADBUNDLE tags, and uncomment SET tags.

3 comments:

  1. Hi guys, :)

    I think I have a 4th solution with neither SET nor LOADBUNDLE.

    In the faces-config.xml I have
    <faces-config ...>
    <application>
    ...
    <resource-bundle>
    <base-name>pt.memosis.sisvendas.resources.ViewControllerBundle</base-name>
    <var>bundle</var>
    </resource-bundle>
    ...
    </application>
    ...
    </faces-config>

    And then in any jspx page I just mention "#{bundle.[menu.records.menuName]}", no SET nor LOADBUNDLE, just use it!

    You con even use the Expression Builder of the Property Inspector choosing the "Faces' Resource Budles" node.

    Hope this helps :)

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Hi, Pablo;)))

    Like ur solution very much!!!!!

    I'll just stick to solution nbr.3 :) because I'm foolishly optimistic and I hope that Oracle will fix SET tag in next patch :))))))

    Thnx again for contributing, hope in future we will not need to find so many workarounds:)))))

    ReplyDelete