|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Create form: from descriptionHi,
i have some classes for define the data to
store, with specific descriptions.
All class have the method descriptionKey
for define the key to store the instance.
Now i'm interested to create a form with textinput
based on one specific descriptionKey.
It's possibol ?
In WAComponent subclass i have the
method:
renderAddOn: html
html form:[
html
textInput callback:[ :value| self add: value].
html submitButtton
text:'add'].
Now i can render the textInput based on specific
descriptionKey ?
Any pointers would be greatly
appreciated!
Thanks Dario _______________________________________________ SmallWiki, Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
|
|
Re: Create form: from description> In WAComponent subclass i have the method:
> > renderAddOn: html > html form:[ > html textInput callback:[ :value| self add: value]. > html submitButtton text:'add']. > > Now i can render the textInput based on specific descriptionKey ? I don't quite understand what you intend to do with the textInput field. Do you want to read/write some described data? If so, use something like the following: object readUsing: description. object write: value using: description. Do you want to use different descriptions depending on some context? Use something like: self description select: [ :each | each isForContextX ] > Any pointers would be greatly appreciated! Lukas -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ SmallWiki, Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
|
|
|
|
|
Re: Create form: from descriptionOn Mar 25, 2008, at 14:15 , Dario Trussardi wrote: > Hi, Lukas > > > >> In WAComponent subclass i have the method: > >> > >> renderAddOn: html > >> html form:[ > >> html textInput callback:[ :value| self add: value]. > >> html submitButtton text:'add']. > >> > >> Now i can render the textInput based on specific descriptionKey ? > > > > I don't quite understand what you intend to do with the textInput > field. > > In other words: > > renderAddOn: html > html form:[ > anMAReferenceModel > descriptionKey ....................as ???? changeAccesor ??? > > html submitButtton text:'add']. > where anMAReferenceModel is one specific classModel for example: > MANazionalityModel with specific descriptionKey -> > MAStringDescription new ........ label: 'Nazionaliry name'; .......... > or MAPhoneModel with specific descriptionKey -> MANumberDescription > new ............label: 'Phone number'; ..... beInteger............ > or MA ..... Model with specific descriptionKey -> ........ > > > With this reference i think to have the input set to relative > descriptionKey. > > I'm clear ? No, I don't understand. I can only guess: html textInput value: (aDescription toString: (object readUsing: aDescription)); callback: [ :value | object write: (aDescription fromString: value) using: aDescription ]. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ SmallWiki, Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
|
|
|
|
|
Re: Create form: from description> >I can only guess:
> > > >html textInput > > value: (aDescription toString: (object readUsing: > aDescription)); > > callback: [ :value | object write: (aDescription fromString: > > value) using: aDescription ]. > > i work with your guess, and some thing go other no. > > I'have problem with description define using MANumberDescription > new .... If you decide to have your own interpretation of descriptions, then you need to do error handling and validation checking yourself. The Magritte-Seaside package does this all automatically for you. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ SmallWiki, Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
| Free Forum Powered by Nabble | Forum Help |