Re: [Zope] Selection and Lines Properties for DTML Docs

2001-01-02 Thread Andy McKay

Im not sure what you mean by "hide it from the user", it all depends upon
the rights you give your user.

If I create a lines property on my root folder called selection_list, I can
then in folder /test/ make a property test_selection, type selection, value
selection_list. The problem you
--
  Andy McKay, Developer.
  ActiveState.


- Original Message -
From: "Steve McMahon" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 02, 2001 9:36 AM
Subject: [Zope] Selection and Lines Properties for DTML Docs


 I'm new to Zope and am interested in the use of document properties
 for separating content and design in documents (i.e., using dtml-var
 prop_name in the "edit" tab to insert properties defined on
 the "properties" tab.

 I've had success with simple text properties and would like to be
 able to present the user with selection properties (choice 1, choice
 2, ...). That works well when I first define a "lines" property, then
 a "selection" property. But, what I'd really like to do is hide the
 lines property from the user. I've tried putting a lines property in
 another document, then setting the selection value
 to 'source_doc.lines_prop'. That yields an error "No select variable
 source_doc.lines_prop."

 Any ideas on the right way to do this? Please feel free to point me
 to good documentation!
 _
 Steve McMahon, SunType Publishing Systems
 [EMAIL PROTECTED]
 voice  fax: (530) 757-7682
 http://www.suntype.com


 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Selection and Lines Properties for DTML Docs

2001-01-02 Thread Andy McKay

 Im not sure what you mean by "hide it from the user", it all depends upon
 the rights you give your user.

 If I create a lines property on my root folder called selection_list, I
can
 then in folder /test/ make a property test_selection, type selection,
value
 selection_list. The problem you

may have is that you are trying to put it on another document, rather than
on a folder in the acquistion path.

 --
   Andy McKay, Developer.
   ActiveState.


 - Original Message -
 From: "Steve McMahon" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, January 02, 2001 9:36 AM
 Subject: [Zope] Selection and Lines Properties for DTML Docs


  I'm new to Zope and am interested in the use of document properties
  for separating content and design in documents (i.e., using dtml-var
  prop_name in the "edit" tab to insert properties defined on
  the "properties" tab.
 
  I've had success with simple text properties and would like to be
  able to present the user with selection properties (choice 1, choice
  2, ...). That works well when I first define a "lines" property, then
  a "selection" property. But, what I'd really like to do is hide the
  lines property from the user. I've tried putting a lines property in
  another document, then setting the selection value
  to 'source_doc.lines_prop'. That yields an error "No select variable
  source_doc.lines_prop."
 
  Any ideas on the right way to do this? Please feel free to point me
  to good documentation!
  _
  Steve McMahon, SunType Publishing Systems
  [EMAIL PROTECTED]
  voice  fax: (530) 757-7682
  http://www.suntype.com
 
 
  ___
  Zope maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
   http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope-dev )
 



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Selection and Lines Properties for DTML Docs

2001-01-02 Thread Steve McMahon

At 10:08 AM 1/2/01, Andy McKay wrote:
  Im not sure what you mean by "hide it from the user", it all depends upon
  the rights you give your user.

In this case, I just meant that it shouldn't appear in the properties list 
for the particular page. I want to give the editor of the particular page's 
properties the ability to make a selection, but not the ability to change 
the list of possible selections.

  If I create a lines property on my root folder called selection_list, I
can
  then in folder /test/ make a property test_selection, type selection,
value
  selection_list. The problem you
may have is that you are trying to put it on another document, rather than
on a folder in the acquistion path.

You're diagnosis is dead-on. I added my lines property to the containing 
folder and it worked perfectly. I'm still mystified, though, as to why I 
couldn't put the lines property in another document in the same folder and 
use the notation 'doc_id.lines_id' to refer to the lines property in the 
other document.

Thanks, Steve



  --
Andy McKay, Developer.
ActiveState.
 
 
  - Original Message -
  From: "Steve McMahon" [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, January 02, 2001 9:36 AM
  Subject: [Zope] Selection and Lines Properties for DTML Docs
 
 
   I'm new to Zope and am interested in the use of document properties
   for separating content and design in documents (i.e., using dtml-var
   prop_name in the "edit" tab to insert properties defined on
   the "properties" tab.
  
   I've had success with simple text properties and would like to be
   able to present the user with selection properties (choice 1, choice
   2, ...). That works well when I first define a "lines" property, then
   a "selection" property. But, what I'd really like to do is hide the
   lines property from the user. I've tried putting a lines property in
   another document, then setting the selection value
   to 'source_doc.lines_prop'. That yields an error "No select variable
   source_doc.lines_prop."
  
   Any ideas on the right way to do this? Please feel free to point me
   to good documentation!
   _
   Steve McMahon, SunType Publishing Systems
   [EMAIL PROTECTED]
   voice  fax: (530) 757-7682
   http://www.suntype.com
  
  
   ___
   Zope maillist  -  [EMAIL PROTECTED]
   http://lists.zope.org/mailman/listinfo/zope
   **   No cross posts or HTML encoding!  **
   (Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )
  
 

_
Steve McMahon, SunType Publishing Systems
[EMAIL PROTECTED]
voice  fax: (530) 757-7682
http://www.suntype.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Selection and Lines Properties for DTML Docs

2001-01-02 Thread Andy McKay

Because acquistion can't find it. It can find all the objects in the folder
and all the properties on a folder, but it doesn't go into each object and
look at its properties...

--
  Andy McKay, Developer.
  ActiveState.


- Original Message -
From: "Steve McMahon" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 02, 2001 10:26 AM
Subject: Re: [Zope] Selection and Lines Properties for DTML Docs


 At 10:08 AM 1/2/01, Andy McKay wrote:
   Im not sure what you mean by "hide it from the user", it all depends
upon
   the rights you give your user.

 In this case, I just meant that it shouldn't appear in the properties list
 for the particular page. I want to give the editor of the particular
page's
 properties the ability to make a selection, but not the ability to change
 the list of possible selections.

   If I create a lines property on my root folder called selection_list,
I
 can
   then in folder /test/ make a property test_selection, type selection,
 value
   selection_list. The problem you
 may have is that you are trying to put it on another document, rather
than
 on a folder in the acquistion path.

 You're diagnosis is dead-on. I added my lines property to the containing
 folder and it worked perfectly. I'm still mystified, though, as to why I
 couldn't put the lines property in another document in the same folder and
 use the notation 'doc_id.lines_id' to refer to the lines property in the
 other document.

 Thanks, Steve



   --
 Andy McKay, Developer.
 ActiveState.
  
  
   - Original Message -
   From: "Steve McMahon" [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Tuesday, January 02, 2001 9:36 AM
   Subject: [Zope] Selection and Lines Properties for DTML Docs
  
  
I'm new to Zope and am interested in the use of document properties
for separating content and design in documents (i.e., using dtml-va
r
prop_name in the "edit" tab to insert properties defined on
the "properties" tab.
   
I've had success with simple text properties and would like to be
able to present the user with selection properties (choice 1, choice
2, ...). That works well when I first define a "lines" property,
then
a "selection" property. But, what I'd really like to do is hide the
lines property from the user. I've tried putting a lines property in
another document, then setting the selection value
to 'source_doc.lines_prop'. That yields an error "No select variable
source_doc.lines_prop."
   
Any ideas on the right way to do this? Please feel free to point me
to good documentation!
_
Steve McMahon, SunType Publishing Systems
[EMAIL PROTECTED]
voice  fax: (530) 757-7682
http://www.suntype.com
   
   
___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )
   
  

 _
 Steve McMahon, SunType Publishing Systems
 [EMAIL PROTECTED]
 voice  fax: (530) 757-7682
 http://www.suntype.com


 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Selection and Lines Properties for DTML Docs

2001-01-02 Thread Tim Cook

Steve McMahon wrote:
 
 I'm new to Zope and am interested in the use of document properties
 for separating content and design in documents (i.e., using dtml-var
 prop_name in the "edit" tab to insert properties defined on
 the "properties" tab.
 
 I've had success with simple text properties and would like to be
 able to present the user with selection properties (choice 1, choice
 2, ...). That works well when I first define a "lines" property, then
 a "selection" property. But, what I'd really like to do is hide the
 lines property from the user. I've tried putting a lines property in
 another document, then setting the selection value
 to 'source_doc.lines_prop'. That yields an error "No select variable
 source_doc.lines_prop."
 
 Any ideas on the right way to do this? Please feel free to point me
 to good documentation!


In order to give users a set of configurable options throughout
the application this is what I did.

In the root folder of the application I defined a lines type
property for each option. For example, telephone number types
(home, work, cell etc.) 

The selection looks like this:
trtdPhone Type: /tdtd
SELECT name="phone_type"
  dtml-in valid_phone_types
OPTION value="dtml-var sequence-item"dtml-var
sequence-item/OPTION
   /dtml-in
/SELECT
/td/tr

The DTML Method valid_phone_types just returns a list of what it
found in the phone_types property:

dtml-call expr="REQUEST.set('the_list', [])"
  dtml-in phone_types
 dtml-let current_item=sequence-item
   dtml-call expr="the_list.append(current_item)"
 /dtml-let
   /dtml-in
dtml-return the_list





This is the form entry for the user to edit the lines property.
Note it is in a table with others but the key thing to look at is
the way the line break is in the middle of the 'dtml-var'. If you
don't do this you will end up with extra/empty lines in your
property.

tr
td valign="middle"bPhone Types:/b/td

tdtextarea name="phone_types:lines" rows="10" cols="30" 
dtml-in phone_typesdtml-let cur_item=sequence-itemdtml-var 
"_.string.strip(cur_item)"
/dtml-let/dtml-in
/textarea
/td
/tr


HTH,

-- Tim Cook, President --
Free Practice Management,Inc. | http://www.FreePM.com
Office: (901) 884-4126
Censorship: The reaction of the ignorant to freedom.

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] Selection Property

2000-09-28 Thread Roch'e Compaan

 You need to set up the "bandlist" method as the Value when adding the
 selection property, then make shure that the "bandlist" method is
 available
 from where you use the property sheet.

Been there, done that, still no luck :)

But in the dtml source for properties it says getProperty(select_variable).
If I populate a lines type property in the current folder and then do
dtml-return myProperty it works.

Roché


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Selection

2000-06-23 Thread Dieter Maurer

Dear Rogerio

Rogerio Atem de Carvalho writes:
  I have a form with a drop down box and texts fields. I 
  use a button to call a sql method that gets the drop 
  down box selection and the texts inputs as parameters 
  and insert a record in a table. The problem is how to 
  pass the DDB selected string to this sql method (as I 
  do with the text fields). Aparently the sql method is 
  not receiving the selected string.
This is really strange because the selected value
is passed in exactly the same way as the text fields.

Maybe, you have a typo in your form field name.

If you use as form action the following DTML method, you
will see exactly, what the browser (and Zope) have
put into the REQUEST object. When used without
explicite parameters, the SQL method uses
REQUEST to get its parameter values:

dtml-var standard_html_header
dtml-var REQUEST
dtml-var standard_html_footer



If this method shows you that the value comes with the
right form name, then maybe your problem results
from a bug in Zope 2.1.6. Zope 2.1.6 SQL methods
first look into their environment and only then into
the supplied arguements. There is a patch for this
bug in the collector.


Dieter


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )