[xwiki-users] Howto set Parent Value with drop down list (resolved)

Sergiu Dumitriu sergiu.dumitriu at gmail.com
Tue Jul 10 02:00:03 CEST 2007


You could post this in the Code zone:
http://www.xwiki.org/xwiki/bin/view/Code/Snippets

On 7/9/07, pbasnews-tmp at yahoo.fr <pbasnews-tmp at yahoo.fr> wrote:
> Hi,
> I was looking for a way to set Parent Value with drop down list when user edit a page... I found this solution:
> I modify  the forms "Panels: DocumentInformation" (/xwiki/bin/inline/Panels/DocumentInformation) like this:
> I replace lines:
> ****************
> <input type="text" id="xwikidocparentinput2" name="parent" value="$!tdoc.parent" size="30"/>
> ****************
> by
> ****************
> <select name="parent" class="panelselect">
>   <option value="$!tdoc.parent" selected="selected">$!tdoc.parent</option>
>     <option value="">-Empty \*-</option>
>   #foreach($subdoc in $xwiki.getSpaceDocsName("$doc.web"))
>     <option value="$subdoc">$subdoc</option>
>   #end
> </select>
> ****************
> The forms contain:
> ****************
> #set($pages = $tdoc.includedPages)
> #largepanelheader("XWiki document information")
> <dl><dt><label for="xwikidocparentinput2">$msg.get("parentfield"):</label></dt> <dd>
> <select name="parent" class="panelselect">
>   <option value="$!tdoc.parent" selected="selected">$!tdoc.parent</option>
>     <option value="">-Vide \*-</option>
>   #foreach($subdoc in $xwiki.getSpaceDocsName("$doc.web"))
>     <option value="$subdoc">$subdoc</option>
>   #end
> </select></dd>
> #if($pages.size() != 0)
> #if($pages.size() == 1)
> <dt>$xwiki.parseMessage("editincludepagemsgone"):</dt>
> #else
> <dt>$xwiki.parseMessage("editincludepagemsgmore"):</dt>
> #end
> <dd>
> <table summary="$msg.get("includeddocumentssummary")" id="xwikiincludeddocuments">
> <tbody>
> #foreach ($page in $pages)
> <tr><td><a href="$xwiki.getURL($page, "view")">$page</a></td>
> <td class="xwikibuttonlink"><a href="$xwiki.getURL($page, "edit")">$msg.get("edit")</a></td></tr>
> #end
> </tbody>
> </table></dd>
> #end
> </dl>
> #template("tagedit.vm")
> #panelfooter()
>

Sergiu
-- 
http://purl.org/net/sergiu




More information about the users mailing list