Mailing List Archive

Re: [8522] Hide the copy button for fields that have a min and max
On Mar 27, 2009, at 4:35 PM, brewt@bricolage.cc wrote:

> Hide the copy button for fields that have a min and max occurrence
> of 1 since it won't be possible to paste that field anywhere.

We don't support pasting into another document? If not, we should also
prevent pasting when the max number already exists.

Best,

Davikd
Re: [8522] Hide the copy button for fields that have a min and max [ In reply to ]
David E. Wheeler wrote:
> On Mar 27, 2009, at 4:35 PM, brewt@bricolage.cc wrote:
>
>> Hide the copy button for fields that have a min and max occurrence of
>> 1 since it won't be possible to paste that field anywhere.
>
> We don't support pasting into another document? If not, we should also
> prevent pasting when the max number already exists.

We do, but if the field has a minimum occurrence of 1 (and max of 1),
then you can't paste it anywhere because when you create the element the
field is automatically created.

You already can't paste when the max number already exists. It looks at
what element/field types can already be inserted into the element and
compares that to the element type that's in the copy buffer.

Adrian
Re: [8522] Hide the copy button for fields that have a min and max [ In reply to ]
On Mar 27, 2009, at 2:18 PM, Adrian Yee wrote:

> We do, but if the field has a minimum occurrence of 1 (and max of
> 1), then you can't paste it anywhere because when you create the
> element the field is automatically created.

Right, but you could potentially paste it into another document, no?

> You already can't paste when the max number already exists. It
> looks at what element/field types can already be inserted into the
> element and compares that to the element type that's in the copy
> buffer.

Excellent, thanks!

David
Re: [8522] Hide the copy button for fields that have a min and max [ In reply to ]
On Sun, 29 Mar 2009, David E. Wheeler wrote:
> On Mar 27, 2009, at 2:18 PM, Adrian Yee wrote:
>> We do, but if the field has a minimum occurrence of 1 (and max of 1), then
>> you can't paste it anywhere because when you create the element the field
>> is automatically created.
>
> Right, but you could potentially paste it into another document, no?

Since the min occurrence is 1, it will be automatically created already.
I think paste currently only implies adding a child element,
not updating/overwriting an element.
I think it actually applies not just to min==1 && max==1
but to all min>=max .
Re: [8522] Hide the copy button for fields that have a min and max [ In reply to ]
On Mar 29, 2009, at 10:17 AM, Scott Lanning wrote:

> Since the min occurrence is 1, it will be automatically created
> already.
> I think paste currently only implies adding a child element,
> not updating/overwriting an element.
> I think it actually applies not just to min==1 && max==1
> but to all min>=max .

What if it's another document type that uses the same subelement but
with different min and max?

Best,

David
Re: [8522] Hide the copy button for fields that have a min and max [ In reply to ]
On Sun, 29 Mar 2009, David E. Wheeler wrote:
> On Mar 29, 2009, at 10:17 AM, Scott Lanning wrote:
>> Since the min occurrence is 1, it will be automatically created already.
>> I think paste currently only implies adding a child element,
>> not updating/overwriting an element.
>> I think it actually applies not just to min==1 && max==1
>> but to all min>=max .
>
> What if it's another document type that uses the same subelement but with
> different min and max?

Ah, that's true.
Re: [8522] Hide the copy button for fields that have a min and max [ In reply to ]
On Sun, 29 Mar 2009 11:59:59 -0700
"David E. Wheeler" <david@kineticode.com> wrote:
> On Mar 29, 2009, at 10:17 AM, Scott Lanning wrote:
>
> > Since the min occurrence is 1, it will be automatically created
> > already.
> > I think paste currently only implies adding a child element,
> > not updating/overwriting an element.
> > I think it actually applies not just to min==1 && max==1
> > but to all min>=max .
>
> What if it's another document type that uses the same subelement but
> with different min and max?

That's true, but the check is only done on fields, not containers. Scott's
suggestion is correct though.

Adrian