On 7/6/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
== 1st Issue ==
 - if I click on a link to another page in my menu, the URL will be:
".../otherUrlEdit.action?currentFichierId=1" ... and I can't find how to
avoid it.

There is a parameter in the url building tag that will turn off this
feature.  Basically, by default, it includes as query parameters any
query parameters in the original request.

== 2nd Issue ==
 - if I submit, my values are well stored in database, I'm back to the
list, the URL is clean, but if I'm trying to create a new entry with my
"Create a Fichier" link, the form is populated according to the id that
was set in my Action because of my previous navigation. It seem logic but
the way to reset this value keeping the ability to edit is still a
mystery.

== 3rd Issue ==
The code provided is a modified version of the original because I
encoutered another problem with the prepare method (+interceptor) and the
bean retrieval from db.
My action class was :
        ...
        public void prepare() {
                super.prepare();
                if( currentFichierId==0 ) {
                        currentFichier = new Fichier();
                } else {
                        currentFichier =
theFichierService.findById(currentFichierId);
                }
        }
        public String input() {
                return INPUT;
        }
        ...

 - I was expecting the prepare method to load the populated model from
database, with values set in the form fields ... but the first time the
action is called, surprise, the prepare is called but my form is empty. My
debug string made me descovering that currentFichierId is set to 1, but
the id of my currentFichier is 0. I don't understand that comportment,

I believe the prepare method is called before the parameters are set,
but I could be wrong.  What about putting that logic into your setter?

I'd recommend spending some time with some of the more comprehensive
tutorials and showcase application.  It may help to show how some of
the Struts 2 features work.

Don

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to