myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "daniel ccss" <>
Subject Re: Tomahawk+DataScroller+WorkingWithLargeTables
Date Sat, 07 Jul 2007 00:38:00 GMT
Ok Paul, this is the thing,

Since I´m new in this and in my work they are asking for results from the
Tomahawk investigation that i'm doing implementing a simple maintain module,
I think that I can´t impplement all that you have done, at least in this

This is what i have done until now, I changed the PagedList class from the
wiki for yours, that was the only class that Ichanged, the other change was
to put the bean in session (Vladimir idea) (by the way nice tip, you gave
for put it in session from code). Until now all works fine.

Then i made my delete, add and edit methods, they simple recived the Patient
id and call an EJB that calls to the DAOs methods to do that. They are
called from an actionlistener on the JSP. They all works fine, but I don`t
saw the changes on the DataTable, in the moment, but when I click on the
pages numbers I saw the changes.

What I need, is from code, and after call a delte/add/edit method, fetch the
data(as happen when i click on a page number) from my backing bean, and of
course always pass for the filter to do the fetch after this methods are
called, something like:

public void delete()
fetch data

I made a hardcore test ( I need to do it for test my idea :( ) I made a
properties file, and put a key call forceToFetch = false, and in the dofetch
method I get this property then in your filter (If) I add this: if(.... ||
forceToFetch). Inside the if I ask if the forceToFetch is true and put it
again in false in the properties file.Then in the backing_bean after call
the add/delete/edit methods I put the value in the properties in true, and
as I thought it wors fine, I can saw all the changes on the DataTable. Can
you give a way to do this witout use the properties file?  Can you give me
an step by step solution since I`m new in this and I still understanding all
your code.

Other thing I see a problem with this solution when I delete the last row of
a DataPage (example the last row of the second DataPage) or when I delete
the last row of the first DataPage, I recived a row index exception. How can
I fix this issue, can you explain me. If I delete the last row of dataPage 3
how can I show, from code, the dataPage2 and in the case of the last row of
the first DataPage how can I delete that last row and show the First
DataPage without data? Can you also explain me this step by step?

Paul really really sorry for all this, but I think that your are the person
that more knows of this, you are a Guru on this, and I really need help,
also thanks to you Vladimir!!

On 7/6/07, Paul Iov <> wrote:
> Vladimir Isakovich schrieb:
> > Yes, I have just one call getting through to my DB, the session scoped
> > bean with Paul's blocking method worked. The drawback with this
> > approach, we may start thinking on cleaning session off of the unused
> > objects, otherwise our app may consume too much cache on the server.
> >
> > vlad
> That's why I don't utilize the JSF backing bean facility. It's not
> flexibly enough to maintain high dynamically applications.
> I've implement own session controller and it's the only backing bean I
> have to declare in my faces-config.xml ;) The other part of magic is
> application wide controller (started with ServletContextListener) to
> maintain some global issues and, first of all the sessions, which I
> catch with HTTPSessionListener.
> Just a little hint: you can 'inject' your beans into session without
> declaring it in config.
> <managed-bean>
>       <managed-bean-name>MyBean</managed-bean-name>
>       <managed-bean-class>my.MyClass</managed-bean-class>
>       <managed-bean-scope>session</managed-bean-scope>
> </managed-bean>
> is equal to:
> FacesContext fCtx    = FacesContext.getCurrentInstance();
> ExternalContext eCtx    = _fCtx.getExternalContext();
> ServletContext srvCtx  = (ServletContext)_eCtx.getContext();
> HttpSession session = (HttpSession)_eCtx.getSession(false);
> ...
> MyClass myInstance = new MyClass();
> session.setAttribute("MyBean", myInstance);//put MBean to session

View raw message