Matthias Wessendorf’s Weblog

Entries from March 2008

New Facesgoodies download

March 28, 2008 · Leave a Comment

Today I added a new download for my little Facesgoodies project. This kickstart template is JSF 1.1 based and contains the latest greates Trinidad release (1.0.7) and some more things, such as Facelet components, based on Dojo Toolkit, which I demonstrated at AjaxWorld New York. On the business layer I did no modification, I am still happy with Orchestra 1.1 :-)

This extra download is just for convenience, since some told me they want an extra download instead of getting the stuff via SVN.

Hope that helps!

Categories: ajax · apache · dojo · facelets · java · javascript · jsf · myfaces · orchestra · trinidad

AjaxWorld East 2008 (in New York City)

March 26, 2008 · 3 Comments

Last week I was attending the AjaxWorld East conference to speak about Apache MyFaces Trinidad and how to integrate it with some other open source projects, such as Facelets, Dojo or Yahoo! UI. I think the talk went very well and I uploaded the slides today. The demo is not downloadable (yet), but you can get the source (via SVN). Simple do a checkout of my Facesgoodies project and you’ll get everything that I was demonstrating in NYC.

Have fun

Categories: ajax · apache · dojo · facelets · jQuery · java · javascript · jsf · myfaces · trinidad · web²

Steve Bug playing in New York

March 14, 2008 · Leave a Comment

Ha! Doing some “researches” for my tomorrow trip to New York (b/c of AjaxWorld conference) I figured out that Steve Bug is playing on 20th of March in New York City (at Cielo).

I just printed the ticket! Since my plane is leaving kind of late afternoon on 21st I bet it will be a very good final of my trip to NYC 8-)

Categories: lifestyle

JSFDays 2008 in Vienna

March 14, 2008 · 2 Comments

The JSFDays conference was a very good conference! It was (to my opinion) perfectly organized! Credits to Martin, Thomas and team. The conference was really an international conference, since it had visitors from Europe (Austria, Germany, Netherlands and Switzerland) and from the US.

Very interesting sessions and good discussions afterwards and during the coffee/lunch breaks. Everywhere you heard words like “Seam”, “Orchestra” or “Facelets” from all the geeks ;-) . Which is indeed a very good sign!

It is also very funny to mention, that Ed Burns is really good in speaking German! He obviously enjoyed talking German on the breaks and the evening events.

I am really really looking forward for the next JSFDays conference in Vienna!

Categories: jsf

Dynamic tables and Orchestra’s conversation scope

March 11, 2008 · 1 Comment

Very very often you have to have tables that display data based on a search result (like customers by city or similar). In one (or more) of the entries you are interested in continuing your work. In Trinidad you can use the inputListOfValues component to trigger a dialog, that contains the search engine:

<tr:inputListOfValues label="customer id"
   action="dialog:search" windowHeight="300"
windowWidth="400"/>

A click on the “search” icon (provided by the component) will launch a dialog, that contains the mentioned search engine. The search page may look like:

<tr:form defaultCommand="search">
  <tr:panelFormLayout>
    <tr:inputText label="Name:" value="#{search.query}" />
    <tr:commandButton id="search" text="Search..."
       action="#{search.search}"/>
  </tr:panelFormLayout>

  <tr:panelPage rendered="#{not empty search.result}" >
    <tr:table id="results" rowSelection="single"
        value="#{search.result}" var="customer">
      <tr:column>
        <f:facet name="header">
          <tr:outputText value="Name"/>
        </f:facet>
        <tr:outputText value="#{customer.name}"/>
      </tr:column>
      ...
    </tr:table>
    <tr:panelButtonBar>
      <tr:commandButton text="Cancel" immediate="true"
                        action="#{search.cancel}"/>
      <tr:commandButton text="Select"
                        action="#{search.select}"/>
    </tr:panelButtonBar>
  </tr:panelPage>
</tr:form>

The big problem here is the search bean. What scope to use for that bean?

Request scope?

Doesn’t work. When doing the query, you get a list of results (when query was successfully…) but next action (the selection of a customer) you’ll notice, that the underlying selection data (in Trinidad done with table.getSelectedRowKeys()) is not present.

Session scope?

Well… the selection now of course works, but when you launch the dialog again, the previews result is still visible… You can work around that by doing some (bogus) clean ups… well, are you really interested in doing that ?

The solution?

A scope that is between request and session and this is what MyFaces Orchestra provides with its Conversation Scope Features. Using such a scope simply gives you the clean solution that you want. No bogus clean-ups / workarounds are needed. Just declare the scope of the bean like:

<bean id="search"
    class="net.wessendorf...SearchController"
    scope="conversation.access"
    p:dao-ref="myDaoImpl" />

Now you are good to go! The SearchController bean is straight forward. No extra annotations, interfaces or abstracts classes are required. It just works! An other cool feature of Orchestra is the “ConversationBindingListener” interface. When you implement it, your bean get’s notified when it was added to the new scope (or removed). But this is totally optional.Even if you don’t need all bits of Orchestra at least I strongly recommend to use the new additional scopes since they really make the life of a web application developer more easy!

Well… I also have one rant… Orchestra shouldn’t have to offer such a extra scope. It should be part of the JavaEE specs. Not only for JSF this scope is useful. It should be part of the Servlet Spec. Perhaps Servlet 3.0 will address this ? But until that happens, Orchestra is a good friend!

Have fun!

Categories: java · jsf · myfaces · orchestra · trinidad