[Chandler-dev] Multiline text field not correctly displayed

Bryan Stearns stearns at osafoundation.org
Wed Aug 9 08:31:40 PDT 2006


Hi Ernesto,

I'm not sure what's going on, but maybe some of this will help...

The makeEditor function makes an AEBlock, a block that hosts an 
attribute editor. Attribute editors are picked at runtime based on the 
type of the value in the configured attribute; in your case, you're 
telling it to edit the 'rawVCard' attribute. I don't know what the 
declared type of the 'rawVCard' attribute is, but I'm guessing  it's 
schema.Text, like ContentItem's 'body'.

The picking mechanism also uses the presentationStyle.format attribute, 
if present, to influence the picking process. You're saying that the 
format is 'contactRawVCardField', so it's going to look first for an 
attribute editor registered to handle 'Text+contactRawVCardField'. I'm 
assuming that you didn't write a custom attribute editor, so it's not 
going to find one - it will fall back and look for one for just 'Text', 
and will find StringAttributeEditor (which is what gets used for the 
Note body as well).

StringAttributeEditor should do the right thing and build a multiline 
text area since you've given it that lineStyleEnum 'MultiLine' value. 
I'm not sure why it's not, or what you mean by "it works if the block is 
moved outside childrenBlocks" - where are you moving it to that it's 
still appearing?

(If you did write a custom attribute editor that you've registered to 
handle Text+contactRawVCardField, it'd need the same logic in its 
createControl method as StringAttributeEditor has - you can see that 
it's a matter of passing a different style value to the control being 
created. I'm not saying you _should_ create a custom attribute editor, 
especially right before your demo -- I'm just trying to explain what 
happens if you have.)

I wouldn't be surprised if specifying the height didn't work at all, no 
matter where you say "height=...". Our only use case for the multiline 
editor is for the note body, to have it take up "the rest of the space" 
(that is, they stretch to take up the rest of the detail view after all 
the smaller fields are laid out. I think the certificate detail view 
shows more than one multiline text field, and they all share that space 
- you might ask Heikki about that.

...Bryan

Ernesto Rivera wrote:
>
> Hi,
>
> I am doing some last changes to contacts' code before tomorrow's 
> presentations.
>
> I have this annoying issue with this 'RawVCard' that is displayed 
> "squeezed" as text field instead of a text area (multiline text):
>
> contactPersonRootBlocks = [...
>
> *detail.**makeArea*(
>             parcel, "RawVCardArea",
>             baseClass=RawVCardAreaBlock, # this makes the area 
> conditionally visible
>             height = 200,    # <-- didn't expanded the detail area either
>             childrenBlocks=[
>                 *detail.makeEditor(  # displays as a text field 
> instead of as a text area*
>                     parcel, 'RawVCard',
>                     viewAttribute=u'rawVCard',
>                     presentationStyle={
>                         *'lineStyleEnum': 'MultiLine',  #<-- this 
> works the block is moved outside childrenBlocks*
>                         'format': 'contactRawVCardField'
>                     },
>                     height = 200 # doesn't seem to work
>                 )
>             ],
>             position=0.951
>         ).install(parcel),
>
>
> The problem occurs on both alpha2 and 3. Also the the field displays 
> correctly when *outside the detail.makeArea*, so the issue is only for 
> text areas declared as childrenBlocks.
>
> Any ideas?
>
> Thanks,
>
>
> Ernesto
>
>
>
>
> ------------------------------------------------------------------------
>
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> Open Source Applications Foundation "chandler-dev" mailing list
> http://lists.osafoundation.org/mailman/listinfo/chandler-dev
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/chandler-dev/attachments/20060809/946a40e3/attachment.htm


More information about the chandler-dev mailing list