tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr." <smithh032...@gmail.com>
Subject Re: Entity cant be refreshed with new list values
Date Sat, 19 Oct 2013 20:24:53 GMT
responses below...

On Sat, Oct 19, 2013 at 3:46 PM, Mark Struberg <struberg@yahoo.de> wrote:

> be careful with immediate=true. You get all sorts of nasty side effects.
>
> see page 92 in
> http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20pitfalls%20in%20EE.pdf
>
>
I definitely agree and understand about immediate=true, and guess what, i
found it very useful to disable validation as instructed on page 92 of the
PDF file.

clarification of my use/understanding:

i am 'not' using immediate=true, when i user is to select a row on
datatable, and then click commandbutton/link/menuitem, which does a POST of
the selected row on the datatable, and bean uses the selected row to
prepare the UI for the next view that is 'rendered' via
ui:include=#{bean.page}. see below and keep reading, please.

    <p:menuitem value="Add" icon="ui-icon ui-icon-circle-plus"

actionListener="#{pf_pointOfContactController.prepareCreate()}"
                update="#{pf_pointOfContactController.getAjaxUpdate()}"/>
    <p:menuitem value="Edit" icon="ui-icon ui-icon-pencil"

actionListener="#{pf_pointOfContactController.prepareEdit()}"
                update="#{pf_pointOfContactController.getAjaxUpdate()}"/>
    <p:menuitem value="View" icon="ui-icon-folder-open"

actionListener="#{pf_pointOfContactController.prepareView()}"
                update="#{pf_pointOfContactController.getAjaxUpdate()}"/>
    <p:separator/>
    <p:menuitem value="Copy to Ordered By" icon="ui-icon ui-icon-newwin"

actionListener="#{pf_pointOfContactController.copySelectedRows()}"
                update="#{pf_pointOfContactController.getAjaxUpdate()}"/>
    <p:menuitem value="Delete" icon="ui-icon ui-icon-trash"

actionListener="#{pf_pointOfContactController.confirmDeleteSelectedRows()}"
                update="#{pf_pointOfContactController.getAjaxUpdate()}"/>

but, for a readonly page that has commandbutton/links to render a new view,
based on the current @Entity that is held in the JSF controller/bean class,
i use immediate=true without issue and I think it fits/meets the
occasion/requirement, because there is no need to do validation phase or
update model values. see below. :)

    <p:commandButton value="Browse" icon="ui-icon-search" immediate="true"
update="#{pf_pointOfContactController.getAjaxUpdate()}"

 actionListener="#{pf_pointOfContactController.prepareList()}"/>
    <p:commandButton value="Delete" icon="ui-icon ui-icon-trash"
immediate="true" update="#{pf_pointOfContactController.getAjaxUpdate()}"

 actionListener="#{pf_pointOfContactController.confirmDelete()}"/>
    <p:commandButton value="Edit" icon="ui-icon ui-icon-pencil"
immediate="true" update="#{pf_pointOfContactController.getAjaxUpdate()}"

 actionListener="#{pf_pointOfContactController.prepareEdit()}"/>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message