Hi again, Gilles,

I've added the information I sent you to the WO WikiBook for later reference. You can find it at:

http://en.wikibooks.org/wiki/Programming:WebObjects/Web_Applications/ Development/ General_Best_Practices#Avoid_Changing_WOComponent_Structure_Before_It_Is _Used

Regards,
Jerry

Begin forwarded message:

From: "Jerry W. Walker" <[EMAIL PROTECTED]>
Date: September 15, 2006 6:07:47 PM EDT
To: Gilles MATHURIN <[EMAIL PROTECTED]>
Cc: webobjects-dev Development <[email protected]>
Subject: Re: WOConditionnal strange behavior

Hi, Gilles,

I think Ken and David have pegged the source of your problem. For a more succinct explanation, go to:

http://www.wodeveloper.com/omniLists/webobjects-dev/2005/April/ msg00023.html

To really understand what's going on, pay attention to the links in that message, follow them, and read them.

Good luck.

Regards,
Jerry


On Sep 15, 2006, at 10:12 AM, Gilles MATHURIN wrote:

Sorry to disturb you, but my english is not that good, so i have some difficulties to understand your workaround …
What I typically do is have the controls affect flags/objects that are not used in conditionals.
i don't really understand what that means… may u (or anyone else who understand) give me a little more explanation please, if u have time.

Thanks you.

GM.

Le 15 sept. 06 à 09:56, Ken Anderson a écrit :

Yes.

What I typically do is have the controls affect flags/objects that are not used in conditionals. Then, in appendToResponse, I set the flags that control the conditionals from those temporary variables. This way, when the form post comes back, the page still has the original structure, but it gets 'fixed' before appendToResponse generates the new page.

Ken


On Sep 15, 2006, at 9:50 AM, Gilles MATHURIN wrote:

Hello,

this two WOConditionnals aren't in a Form, but the following WOFileUpload is. Plus, more generally, my page is composed of several forms and/or part that show and hide depending on buttons the user click, so, i think that yes the structure of the page is affected.

illustration :

=====

Button 1 when clicked, show Form1 (which is in a WOCond) and hide others (if others were showed) Button 2 wen clicked show Form2 a (which is in a WOCond) and hide others Button 3 when clicked show Part 3 whith a Fom all in another WOCond and hide others … etc …

=====

So i guess that this behavior is what u called "To affect the structure of the page" …

Any workaround ?

Regards

GM.

Le 15 sept. 06 à 09:38, Ken Anderson a écrit :

In my experience, weird behavior like this usually stems from the object graph of the page changing from when the page was rendered to when a form post comes back. Is this inside a form? Are you modifying any state that would affect the structure of the page?

On Sep 15, 2006, at 8:34 AM, Gilles MATHURIN wrote:

Hello List,

i have a strange behavior with my WOConditionnal, it seems to do not work as it should.
Explanation:
I have a WOCond within another WOCond. Each is bind to a different boolean.

WOCond n°1 : works great, it appears when his boolean resolves to true.
But WOCond n°2 doesn't. It is set like that :

======= Code =====

public WOComponent editPhotos()
    {
// afficher le formulaire d'édition des photos et masque les formulaires au dessus
                boolPhoto = true;
                boolBiog = false;
                boolActu = false;
                // recupérer le contexte d'édition de l'artiste
                EOEditingContext ec = artiste.editingContext();
                
                // récupère l'Array (tableau) de photos de l'artiste.
NSMutableArray photosArtist = artiste.artistephotos ().mutableClone();

// Display the option to Add a new photo, if there are already ones (boolAjouterUnePhoto)
                if (photosArtist.count() > 0) {                      
                        boolAjouterUnePhoto = true;
                }
else { // If there aren't any existing photos, just create a new one withour displaying the Add action possibility.
                        boolAjouterUnePhoto = false;
ArtistePhoto newPhoto = (ArtistePhoto) EOUtilities.createAndInsertInstance(ec,"ArtistePhoto");
                        // Passe newPhoto à photoForm
                        setPhotoForm(newPhoto);
                
                }
// afficher le formulaire d'édition des photos et masque les formulaires au dessus
                
                return null;
    }

==== End of Code ====

Any idea of why it doesn't work ?

Thanks for your support.

GM _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/lists% 40anderhome.com

This email sent to [EMAIL PROTECTED]




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/jerrywwalker% 40gmail.com

This email sent to [EMAIL PROTECTED]


--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems

    [EMAIL PROTECTED]
    203 278-4085        office





--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems

    [EMAIL PROTECTED]
    203 278-4085        office



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to