W3C home > Mailing lists > Public > www-forms@w3.org > May 2007

form control to select a folder

From: Iņaki Salinas Bueno <inksalinas@gmail.com>
Date: Wed, 9 May 2007 00:01:12 +0200
Message-ID: <cd3c31800705081501h55e47264y2548ab92b3231ff8@mail.gmail.com>
To: www-forms <www-forms@w3.org>
Hi all,

I want to suggest include the option of select a folder using upload form
control (or another form control).

My scenario is:
- The user had a java.policy defined. This policy allows applets signed by X
to write/read in a particular folder (choosed by the user).
- The signing applet (signed by X) must know this folder to be able to store
the documents in the user's PC.
- In the XForms+applet application, the user should enter the destination
folder with other critical information and then call the applet sending it
this parameters.

I have to use the input control and do copy&paste of the folder's path
because the upload control isn't able to select a folder. I understand a
folder as an URI, so I suppose a folder is included in the xsd:anyURI type
definition, and the upload control is the manager of this type... reading
the spec I don't see anything wrong in including folder selection in the
upload control (well, avoiding filename, and maybe mediatype and size).

Aaron Reed explained me some problems on knowing if the user wants to select
a folder or wants to select a file. I don't know how to solve this problem.

My use case:

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>

<html    xmlns="http://www.w3.org/1999/xhtml"


    <title>Test - Select a folder as input</title>

    <script language="javascript">
        function sign() {
            //get the instance
            var model = document.getElementById("model");
            var instance = model.getInstanceDocument("data");

            //get parameter
            var keystore = instance.getElementsByTagName("keystore");
            var password = instance.getElementsByTagName("password");
            var folder = instance.getElementsByTagName("folder");

            //call the applet
password[0].firstChild.nodeValue, folder[0].firstChild.nodeValue);

    <xforms:model id="model">

        <xforms:instance id="data" xmlns="">
                <keystore filename="" mediatype="" size="" />
                <password />
                <folder filename="" mediatype="" size="" />
        <xforms:bind nodeset="instance('data')/keystore" type="xsd:anyURI"/>
        <xforms:bind nodeset="instance('data')/password" id="password"
        <xforms:bind nodeset="instance('data')/folder" type="xsd:anyURI"/>



    <h1>Signing test</h1>

    <h2>Key Access</h2>
        <xforms:upload ref="instance('data')/keystore">
            <xforms:label>Select your KeyStore</xforms:label>
            <xforms:filename ref="@filename"/>
            <xforms:mediatype ref="@mediatype"/>
            <xforms:size ref="@size"/>
    <h2>Destination folder</h2>
        <xforms:upload ref="instance('data')/folder">
            <xforms:filename ref="@filename"/>
            <xforms:mediatype ref="@mediatype"/>
            <xforms:size ref="@size"/>

            <xforms:action ev:event="DOMActivate">
                <xforms:load resource="javascript:sign()"/>

    <!--* APPLET FIRMA *-->
    <applet    code="signing.Sign.class"
            width="200" height="200" id="theapplet">
        Signing no se ha podido cargar
    <!-- -->




Received on Tuesday, 8 May 2007 22:01:26 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:37:56 UTC