JSF2.0 Composite Component actionListener

Мне нужна помощь, чтобы заставить мой составной компонент вести себя.Я все еще изучаю основы JSF, поэтому, пожалуйста, извините за любое незнание, которое может быть отображено в этом посте.

Итак, я работаю с JSF 2.0 и решил создать составной компонент, чтобы сделать этот конкретный фрагмент кода многоразовым. Компонент отображает все отлично, но не будет вести себя при попытке добавить actionListener.

Вот код для моего компонента

<ui:composition
    xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:h="http://java.sun.com/jsf/html"  
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:composite="http://java.sun.com/jsf/composite">

    <composite:interface displayName="columnUpdate">
        <composite:attribute name="id" 
            required="true" 
            displayName="id"
            shortDescription="Id to apply to this control and its child components">
        </composite:attribute>
        <composite:attribute 
            name="value" 
            displayName="value"
            required="true" 
            shortDescription="Field that will hold the new updated value.">
        </composite:attribute>

        <composite:attribute 
            name="columnName" 
            displayName="columnName"
            required="true" 
            shortDescription="Value that will be applied as the column header">
        </composite:attribute>
        <composite:attribute 
            name="text"
            displayName="text"
            shortDescription="Text to be displayed above the field">
        </composite:attribute>

        <composite:actionSource name="actionEvent" targets="saveEvent"></composite:actionSource>
    </composite:interface>

    <composite:implementation>
        <h:outputLabel value="#{cc.attrs.columnName}" onclick="showWindow('#{cc.attrs.id}')"></h:outputLabel>

        <div id="#{cc.attrs.id}" class="ccColumnUpdate">
        <div id="windowClose" onclick="closeWindow('#{cc.attrs.id}');" style="top: -10px;" title="Close this window">CLOSE</div>
            <div>
                <h:outputLabel id="lblTitle" value="#{cc.attrs.text}"></h:outputLabel>
            </div>
            <div>
                <h:inputText id="txtValue" value="#{cc.attrs.value}"></h:inputText>
            </div>
            <div style="text-align:right;">
                <h:commandButton id="saveEvent" value="Save"></h:commandButton>
            </div>
        </div>
    </composite:implementation>
</ui:composition>

Вот код на моей странице, который использует компонент:

<al:columnUpdate id="cuExpenseAmount" value="#{expense.columnValue}" columnName="Expense Amount" text="Set Expense Amount to:">
  <f:actionListener for="actionEvent" binding="#{expense.updateColumnValue}">
    <f:ajax execute="@form"></f:ajax>
  </f:actionListener>
</al:columnUpdate>

и вот мой код на Backing Bean:

public void updateColumnValue(ActionEvent event) throws ParseException{
    //Got HERE

}

Я не получаю никаких ошибок и не нажимаю точки останова, которые я установил на компоненте поддержки. Любая помощь или указатели в правильном направлении будут оценены.

С уважением,

Майк

5
задан Tom 25 April 2013 в 09:12
поделиться