[jboss-user] [JBoss Tools] - How to holding Entity Query search values when returning to page

Busssard Buss do-not-reply at jboss.com
Mon Apr 26 16:51:09 EDT 2010


Busssard Buss [http://community.jboss.org/people/bussard] created the discussion

"How to holding Entity Query search values when returning to page"

To view the discussion, visit: http://community.jboss.org/message/539626#539626

--------------------------------------------------------------
Hello All,

I created a new CRUD project using JBoss Tools. It runs very well. But one thing don't work as I expected: When returning from a xxxEdit the xxxList has its search param cleared and the list returns to the first page.

I looked in many foruns but without a direct response.

So this is what I have:

The xxxList with a rich:dataTable and the action colum

<rich:column styleClass="action">
            <f:facet name="header">Ação</f:facet>
            <s:link view="/MetasNivelamento/#{empty from ? 'Comarcas' : from}.xhtml"
                   value="#{empty from ? 'Lançar Dados' : 'Selecionar'}"
             propagation="#{empty from ? 'none' : 'default'}"
                      id="comarcasViewId">
                <f:param name="comarcasId"
                        value="#{_comarcas.id}"/>
            </s:link>
</rich:column>


The xxxEdit with the follwing returning buttom

<s:button view="/MetasNivelamento/#{empty comarcasFrom ? 'ComarcasList' : comarcasFrom}.xhtml"
                    id="done"
                 value="Return"/>


And here is my extend to EntityQuery


@SuppressWarnings("serial")
@Name("comarcasList")
public class ComarcasList extends EntityQuery<Comarcas> {
 
    private static final String EJBQL = "select comarcas from Comarcas comarcas";
 
    private static final String[] RESTRICTIONS = {
            "lower(comarcas.polo) like lower(concat(#{comarcasList.comarcas.polo},'%'))",
            "lower(comarcas.regiaoJudiciaria) like lower(concat(#{comarcasList.comarcas.regiaoJudiciaria},'%'))",
            "lower(comarcas.entrancia) like lower(concat(#{comarcasList.comarcas.entrancia},'%'))",
            "lower(translate(comarcas.comarca,'âàãáÁÂÀÃéêÉÊíÍóôõÓÔÕüúÜÚÇç','AAAAAAAAEEEEIIOOOOOOUUUUCC')) like lower(concat(translate(#{comarcasList.comarcas.comarca},'âàãáÁÂÀÃéêÉÊíÍóôõÓÔÕüúÜÚÇç','AAAAAAAAEEEEIIOOOOOOUUUUCC'),'%'))",
            "lower(translate(comarcas.varaComum,'âàãáÁÂÀÃéêÉÊíÍóôõÓÔÕüúÜÚÇç','AAAAAAAAEEEEIIOOOOOOUUUUCC')) like lower(concat('%',translate(#{comarcasList.comarcas.varaComum},'âàãáÁÂÀÃéêÉÊíÍóôõÓÔÕüúÜÚÇç','AAAAAAAAEEEEIIOOOOOOUUUUCC'),'%'))",
            "lower(comarcas.competencia) like lower(concat(#{comarcasList.comarcas.competencia},'%'))", };
 
    private Comarcas comarcas = new Comarcas();
 
    public ComarcasList() {
        setEjbql(EJBQL);
        setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
        setMaxResults(25);
    }
 
    public Comarcas getComarcas() {
        return comarcas;
    }
}


If I use the browser's back buttom (or a equivalent Ajax function ) it work as expected.

Anybody has a solution ?

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/539626#539626]

Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100426/d2957572/attachment.html 


More information about the jboss-user mailing list