Re: WOForms
Re: WOForms
- Subject: Re: WOForms
- From: Dev WO <email@hidden>
- Date: Tue, 17 Feb 2004 15:01:49 +0100
OK,
So I finally was able to setup the first 2 states of the page (there
are 3 states: forms/review/thank you), and I was able to not erase the
different fields when going from "review" back to "forms" (via the
"modify" action).
There are still 2 things that doesn't work:
-sending the email (server side)
-displaying the "thank you" content of my page (3rd state)
Regarding the "send email" thing, I created an action linked to the
"submit" button with this in my Contact.java file:
public WOComponent sendCommentaire()
{
WOMailDelivery wom = WOMailDelivery.sharedInstance();
String myMessage = "nom:" + personName + personLast + "\n" + "email:"
+ personEmail + "\n" + "adresse:" + personPostal + "\n" + personPostal2
+ "\n" + personZIP + personCity + "-" + personCountry + "\n" +
"fonction:" + personFonction + "-" + "entreprise:" + personCompany +
"\n" + "subject:" + personSubject + "\n" + "commentaires:" +
personComment;
NSMutableArray destinataires = new NSMutableArray();
destinataires.addObject("email@hidden");
wom.composePlainTextEmail("email@hidden", destinataires, null,
"Commentaires depuis le site", myMessage, true);
isSent = true;
return null;
}
But it doesn't work, it doesn't send any email (I deployed the app to
try of course)
and doesn't even display the "thank you" part of the page (which should
work if "isSent" was set to "true", and it appears it's not the case.
"isSent" is initialized to "false", and if I initialize it to "true", I
got the "thank you" message so it appears the conditional stuff aren't
responsible for the problem).
So I tried to focus on only one part, the "thank you" message, and I
reduce the action to:
public WOComponent sendCommentaire()
{
entryIncomplete = false;
isSent = true;
return null;
}
But it still doesn't work?! it acts exactly like the "Modify" button
and displays the forms?!
Even with the "entryIncomplete=false", which should display the
"review" page, it goes back to the "form" state!
Anyone understand why I got this?
Thanks
Xavier
> Thank you Robert,
> I didn't have that much time to look into it for these days, but it
> doesn't work on my computer. When I try to validate the form for the
> first time I get an error:
> -------
> Application:
> DemoApp
>
> Error:
> java.lang.IllegalArgumentException: Attempt to insert null into an
> NSArray
>
> Reason:
> Attempt to insert null into an NSArray
>
> Stack trace:
> ------
> I may be able to correct it myself, and it may help me understand and
> find a solution to my problem.
>
> I'll keep you posted most probably on monday (I'd like to finish this
> form;))
>
> Thanks for being available to help me
>
>
>> Xavier,
>>
>> I quickly put together a very basic demo application that should help
>> you understand some of these concepts.
>>
>> Download the file DemoApp.zip from here:
>>
>> http://homepage.mac.com/robertwalker1
>>
>> This is a XCode project so you can see exactly how it's built. I
>> believe this will answer most of your questions. Have fun and feel
>> free to contact me if you have further questions.
>>
>> On Feb 12, 2004, at 11:32 AM, Dev WO wrote:
>>
>>> I have created a button (GoBack), which will call an action (goBack
>>> which return null), which is in fact work correctly, I can go back to
>>> the previous step (the form/confirmation form/ thanks message are all
>>> in the same .wo, encapsulated in Conditional).
>>> But the form is completely empty!, I'd like to get my variables
>>> already entered in it, is it possible to pass the variable with the
>>> goBack action?
>>>
>>> Thanks
>>>
>>> Xavier
>>>
>>>> I've found why the browser's back button didn't work correctly. So
>>>> it may come from a bad implementation in the browser, but it can
>>>> also be because of my bad implementation of the cache in the web
>>>> app.
>>>> So is there a simple way to add a button in my form that will really
>>>> go back to the previous page by requiring it from the server?
>>>>
>>>> Thanks
>>>>
>>>> Xavier
>>>>
>>>> Le 9 fivr. 04, ` 18:57, Dev WO a icrit :
>>>>
>>>>> Hi,
>>>>> I'm actually creating a form for a web app (which is basically a
>>>>> website, without any database).
>>>>> I want to put a form to allow people to send us a report (pretty
>>>>> simple;)).
>>>>> So I followed the documentation's example (favorite food), but even
>>>>> with the exact same code, I've got some problems:
>>>>> -If one of the required field isn't filled, I got an error page
>>>>> about null exception!
>>>>> (I think I may have to initialized the key to null or something
>>>>> like that, but I couldn't figure out for now)
>>>>> -If I have all the required field OK, i go to the next step,
>>>>> displaying each field directly in HTML, but if I go back with the
>>>>> browser's button, everything I change to the form won't be
>>>>> updated...
>>>>> (I think I have to wake-up something to force rewrite the variable,
>>>>> but I don't know how to:(, but maybe I could put a "back button"
>>>>> inside the HTML that would force the session to go back...)
>>>>> -I'd like people to be able to add a commentary, actually it's a
>>>>> WOTextField, but I'd like something bigger so that they can see
>>>>> more lines (and wider), so I tried the WOBrowser, but I don't know
>>>>> which attribut are required...Maybe I should something else than a
>>>>> WOBrowser?
>>>>>
>>>>> And finally, after displaying the result of the form, I'd like to
>>>>> send it to a specific email (without requiring a client software),
>>>>> but I don't know how to do it (the server runs the mailserver and
>>>>> the domain I want to send the form to is local).
>>>>>
>>>>> Thanks a lot for your help
>>>>>
>>>>> Xavier
>>>>> _______________________________________________
>>>>> webobjects-dev mailing list | email@hidden
>>>>> Help/Unsubscribe/Archives:
>>>>> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>>>>> Do not post admin requests to the list. They will be ignored.
>>>> _______________________________________________
>>>> webobjects-dev mailing list | email@hidden
>>>> Help/Unsubscribe/Archives:
>>>> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>>>> Do not post admin requests to the list. They will be ignored.
>>> _______________________________________________
>>> webobjects-dev mailing list | email@hidden
>>> Help/Unsubscribe/Archives:
>>> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>>> Do not post admin requests to the list. They will be ignored.
>>>
>>>
>> --
>> Sincerely,
>> Robert Walker
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.