> Probably. But the trouble is that I'm quite certain that I do 
> this reguraly,
> so I can hardly imagine that it doesn't work.
> 
> E.g. this:
> 
> <list role="related" destination="templates" maxoccurs="1">
>   <title xml:lang="nl">Sjabloon</title>
>   <item>
>     <fieldset>
>       <field ftype="data" name="name" />
>       <field ftype="data" name="url" />
>       <field ftype="data" name="mimetype" />
>     </fieldset>
>   </item>
>   
>   <command name="search" startnodes="nob_intranet"
> nodepath="categories,author,templates" fields="templates.name"
> orderby="templates.name" age="-1">
>     <prompt xml:lang="nl">Zoek een sjabloon</prompt>
>     <search-filter>
>       <name xml:lang="nl">Bevat</name>
>       <search-fields>templates.name|templates.url</search-fields>
>     </search-filter>
>   </command>
>   
>   
>   <action type="create">
>     <relation role="related" destinationtype="templates">
>     </relation>
>   </action>
>   
> </list>
> 
> Lets me add one existing template, and I don't have a 'new' 
> button, only a
> 'search' button. That's what you want isn't it.
> 


That's exactly what I want. I now have the following list and I
must say I do not see structural differences with your example:

<list role="posrel" destination="urls" minoccurs="0" maxoccurs="*"
      orderby="[EMAIL PROTECTED]'pos']" ordertype="number">
   <title>Link</title>
   <item>
      <field ftype="data" name="name"/>
      <field ftype="data" name="description"/>
      <field ftype="data" name="url"/>
   </item>

   <command name="search" nodepath="urls" age="-1"
fields="name,description,url,">
      <prompt>Zoek urls</prompt>
      <search-filter>
         <name>Naam bevat</name>
         <search-fields>[name]</search-fields>
      </search-filter>
      <search-filter>
         <name>Omschrijving bevat</name>
         <search-fields>[description]</search-fields>
      </search-filter>
      <search-filter>
         <name>Link bevat</name>
         <search-fields>[url]</search-fields>
      </search-filter>
   </command>

   <action type="create">
      <relation destinationtype="urls" role="posrel">
      <field name="pos">{sum(//[EMAIL PROTECTED]'posrel' and
@lastitem='true']/[EMAIL PROTECTED]'pos'])+{$pos}}</field>
      </relation>
   </action>
</list>

I still have the new button, only now clicking it results in an
exception:

org.mmbase.applications.editwizard.WizardException: Perhaps the field with
name 'name' does not exist?
   at
org.mmbase.applications.editwizard.Wizard.createPreHtmlForm(Wizard.java:955)
   at
org.mmbase.applications.editwizard.Wizard.createFormList(Wizard.java:1470)
   at
org.mmbase.applications.editwizard.Wizard.createPreHtmlForm(Wizard.java:968)
   at
org.mmbase.applications.editwizard.Wizard.createPreHtml(Wizard.java:745)
   at org.mmbase.applications.editwizard.Wizard.getPreForm(Wizard.java:249)
   at
org.mmbase.applications.editwizard.Wizard.writeHtmlForm(Wizard.java:500)
   at
org.mmbase.applications.editwizard.Wizard.writeHtmlForm(Wizard.java:477)
   at
org.apache.jsp.mmbase.edit.wizard.jsp.wizard_jsp._jspService(wizard_jsp.java
:501)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)


Ronald.

Reply via email to