List Info

Thread: ValueChangeListener again




ValueChangeListener again
country flaguser name
Germany
2007-10-04 09:17:34

Hi,

 

I have the following usecase:

 

A user wants to edit some content of an item (let’;s say a book). He/she changes the values of more the just one properties.

When the users decided that the operation should be cancelled and has something changed, then a warning-dialog should popup. Otherwise nothing should happen and the next page shall be a list of items.

I want to attach a valuechangelistener to each inputfield. When I do it like this:

 

..

 

<tc:in value=&quot;#{controller.currentMedia.publisher.name}&quot;

            label=&quot;#{bundle.name}" id="publisher_name"

            disabled=&quot;#{not controller.editor}&quot;

            valueChangeListener=&quot;#{controller.processEditorChange}">

            <f:facet name=&quot;change&quot;>

                  <tc:command action="editor" />

            </f:facet>

</tc:in>

 

<tc:in …

 

The page gets reloaded everytime I switch to another field and the cursor is been set in the first inputfield again, also I get a jsp-error.

 

Has anyone ever implemented such a usecase? How can I do it?

 

This is the part which checks if something has changed:

 

      <tc:button label=&quot;#{bundle.cancel}&quot; action="#{controller.cancel}"

            image=&quot;images/png/gtk/32x32/button_cancel.png&quot;

            rendered=&quot;#{controller.editor}" immediate=&quot;true&quot; id="editor_cancel">

            <c:if test="${controller.editorChanged}">

                  <f:facet name=&quot;confirmation"&gt;

                        <tc:out value=&quot;#{bundle.sureQuestion}" />

                  </f:facet>

            </c:if&gt;

      </tc:button>

 

Regards,

Mario

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )