18 Apr 14:20
asComponent yields empty form
From: Jacobsen Jörg <joerg.jacobsen <at> web.de>
Subject: asComponent yields empty form
Newsgroups: gmane.comp.lang.smalltalk.smallwiki
Date: 2008-04-18 12:20:25 GMT
Subject: asComponent yields empty form
Newsgroups: gmane.comp.lang.smalltalk.smallwiki
Date: 2008-04-18 12:20:25 GMT
Hi everyone,
I'm trying to code my first Magritte-based form but it persistently refuses to display the input fields.
Here is what I did:
Instance methods on SFCalendar (subclassed from Object):
descriptionPatients
"comment stating purpose of message"
^ MAStringDescription new
selectorAccessor: #patients;
label: 'Patienten';
priority: 90;
default: 'Schnulli, Bulli';
yourself
descriptionStartDate
"comment stating purpose of message"
^ MADateDescription new selectorAccessor: #startDate;
label: 'Beginn am';
priority: 100;
default: (Date today subtractDays: (Date today dayOfMonth - 1));
yourself
and I created the mentioned accessors.
Instance method on the seaside component:
createNewCalendar
"Calendar form"
| calendar |
calendar := self call: (SFCalendar new asComponent addValidatedForm; yourself)
Sending :createNewCalendar yields:
<form accept-charset="utf-8" method="post" action="http://localhost:8090/seaside/Patientenkalender"><div><input name="1" value="Default" style="position: absolute; top: -100em" type="submit" class="submit"/><input name="2" style="position: absolute; top: -100em" type="text" class="text"/></div><table></table><div class="buttons"><input accesskey="S" value="Save" name="3" type="submit" class="submit"/><input accesskey="C" value="Cancel" name="4" type="submit" class="submit"/></div><div><input name="_s" value="upMkEUpoGnxWGUvO" type="hidden" class="hidden"/><input name="_k" value="xxCuTzvW" type="hidden" class="hidden"/></div></form>So I get some internal (?) input fields off the top of the page and an empty table (which is where I should probably get my input fields?).Help is greatly appreciated. Joerg.
_______________________________________________ SmallWiki, Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki
"Generally speaking you'll keep these descriptions on the class side
of your domain object. On occasion, you'll want some property of the
description to be dynamic and depend on the actual value of an
instance side value, so you'll move the description to the instance
side. Strictly speaking, it doesn't matter where you put them,
sometimes you'll use them to build forms when you don't even have a
domain object, but this isn't the normal case."
I think to declare description on the instance side, you need to
modify the DescriptionBuilder so as it looks in the instance side.
Another way is to declare them on the class side and then overide
description on the instance side to copy the default description and
then modify them...
>
> Thank you, Joerg.
>
>
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
>
RSS Feed