AW: simple question
AW: simple question
- Subject: AW: simple question
- From: Helge Staedtler <email@hidden>
- Date: Sun, 25 Sep 2005 22:28:36 +0200
hmm, seems like some nasty we-have-some-identical-project-somewhere,
wo-does-not-even-recognize-you-edited-the-component-error because it works
with files on the other end of your drive.
I would try to eliminate all projects which carry the same name as the name
of this project on your harddisk. or at least zip'em all. leave only this
one project open. and try again (erase build-folder and so on).
if that does not help, I would create a new project with a different name
and copy only the component in question over to the new project (if your
project isnt too large). this nearly always helped me. try to isolate the
error in a new project. do not stick with the old project to find the error.
sometimes also a restart of the machine helps you. because all possibly
hung'up java-apps (perhaps some which still are in a while-loop) and
crashed-WOBuilder-zombies are erased from the RAM.
regards
helge
Am 25.09.2005 19:07 Uhr schrieb "Michael Engelhart" unter
<email@hidden>:
> Thanks helge -
>
> I've tried your suggestions and still get the same error. The
> problem is that WebObjects isn't finding the instance variable for
> some reason but it's finding the component??!
>
> Mike
>
> On 9/25/05, Helge Staedtler <email@hidden> wrote:
>> hi.
>>
>> your method for reading the var should usually be named
>>
>> public String queryString() {
>> return queryString;
>> }
>>
>> instead of
>>
>> public String getQueryString() {
>> return queryString;
>> }
>>
>> this is widespread convention in webobjects-apps.
>>
>> you can also try to eliminate these methods completely and make the var
>> "queryString" public. this should work immediately!
>>
>> so define e.g. the var as follows:
>>
>> public String queryString = null;
>>
>> regards,
>> helge
>>
>>
>>
>>
>> Am 25.09.2005 16:12 Uhr schrieb "Michael Engelhart" unter
>> <email@hidden>:
>>
>>> Hi -
>>>
>>> I'm sorry to bug everyone with this probably dumb question but I'm not
>>> sure what I'm doing wrong. I have Tiger running with WO 5.3 and
>>> XCode 2.1. I've tried deleting my build directory and rebuildilng
>>> and running so I don't think the problem is a corrupted build
>>> directory. I think I'm just forgetting some basic tenet of
>>> WebObjects but I can't figure out what.
>>>
>>> So, I create a new project with a single component called
>>> CitySearchForm which is defined in code like this:
>>>
>>> import com.webobjects.foundation.*;
>>> import com.webobjects.appserver.*;
>>> import com.webobjects.eocontrol.*;
>>> import com.webobjects.eoaccess.*;
>>>
>>> public class CitySearchForm extends WOComponent {
>>>
>>> protected String queryString;
>>>
>>> public CitySearchForm(WOContext context) {
>>> super(context);
>>> }
>>>
>>> public String getQueryString() {
>>> return queryString;
>>> }
>>>
>>> public void setQueryString(String newQueryString) {
>>> queryString = newQueryString;
>>> }
>>>
>>> public WOComponent doCitySearch() {
>>> System.out.println(queryString);
>>> return null;
>>> }
>>>
>>> }
>>>
>>> The .wod looks like this:
>>> CITY_SEARCH_FORM: WOForm {
>>> }
>>>
>>> CITY_SEARCH_SUBMIT_BUTTON: WOSubmitButton {
>>> action = doCitySearch;
>>> }
>>>
>>> QUERY_STRING_TEXT_FIELD: WOTextField {
>>> value = queryString;
>>> }
>>>
>>>
>>> I then add this component to my Main.wo in WOBuilder using the add
>>> Custom element menu selection. But now when I run the application I
>>> get this error:
>>>
>>> Error: com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException:
>>> [ valueForKey()]: lookup of unknown key: 'queryString'. This
>>> WOComponent does not have an instance variable of the name queryString
>>> or _queryString, nor a method of the name queryString, _queryString,
>>> getQueryString, or _getQueryString
>>>
>>> Reason: [<com.webobjects.appserver.WOComponent name: CitySearchForm
>>> subcomponents: null > valueForKey()]: lookup of unknown key:
>>> 'queryString'. This WOComponent does not have an instance variable of
>>> the name queryString or _queryString, nor a method of the name
>>> queryString, _queryString, getQueryString, or _getQueryString
>>>
>>> Now I know I've been away from WO for a while but I know I've done
>>> this before and it just worked out of the box. Did something change
>>> in the 5.3 release or am I just forgetting some basic thing.
>>>
>>> Thanks for any help.
>>>
>>>
>>> Mike
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>>
>>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden