W3C home > Mailing lists > Public > www-forms@w3.org > December 2002

Re: switching between cases in X-Smiles

From: Guillermo Menéndez <gmcorral@terra.es>
Date: Tue, 10 Dec 2002 21:03:30 +0100
Message-ID: <006b01c2a087$369356d0$0200a8c0@amd1700>
To: "Roman Huditsch" <roman.huditsch@hico.com>, <www-forms@w3.org>

Hello Roman,

I think your problem is due to an X-Smiles bug, because I´m having problems
too with switch elements, at least when I use repeat structures inside some
of the cases.
My X-Forms document has two triggers used to display separate parts of the
form, in order to make it clearer, and one of the parts consists of a repeat
element.
The problem I have is the following : when new nodes are inserted within the
repeat structure, the toggle action stops working properly, because the
controls inside the repeat (inputs and textareas) stay in the screen when
you press the trigger to display the other part of the document.
Another thing that doesn't seem to work properly is when you put more than
one textarea inside a repeat element. The program doesn't let you to place
the cursor or write inside them.

Here is the source code, maybe the problem is because it has any errors :

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--Guillermo Menéndez Corral 10/12/2002 -->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms/cr"
xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:sch="www.sch.es">

<head>
<link rel="stylesheet" type="text/css" href="historial.css" />
<xforms:model id="modelHist">
<xforms:submission id="submit1" method2="postxml" replace="all"
localfile="temp.xml" target2="www.sch.es/forms" />

<xforms:instance id="instHist" >
<historial xmlns="www.sch.es">
<cabecera>
<paciente>
<dni>566686Y</dni>
<nombre>Pepe</nombre>
<apellido1>Pérez</apellido1>
<apellido2>Peláez</apellido2>
<sexo>V</sexo>
<grupoSanguineo>A</grupoSanguineo>
<factorRhesus>+</factorRhesus>
<estadoCivil>soltero</estadoCivil>
<ocupacion>fontanero</ocupacion>
</paciente>
</cabecera>
<cuerpo>
<revisiones>
<revision>
<fechaRev>11-11-91</fechaRev>
<constantes>
<pulso>72</pulso>
<tension>128/80</tension>
</constantes>
<exploraciones>
<piel />
<respiratoria />
<digestiva />
<cardiovascular />
<genitourinaria />
<neurologica />
</exploraciones>
<resultadoRev>Se recomienda dejar de fumar</resultadoRev>
</revision>
</revisiones>
</cuerpo>
</historial>
</xforms:instance>

</xforms:model>
</head>

<body>
<p class="titulo">CREACIÓN / MODIFICACIÓN DE UN HISTORIAL</p>
<p class="cabecera">
<xforms:trigger>
<xforms:label>Datos</xforms:label>
<xforms:hint>Datos del paciente</xforms:hint>
<xforms:toggle case="datosPac" ev:event="xforms-activate" />
</xforms:trigger>
<xforms:trigger>
<xforms:label>Revisiones</xforms:label>
<xforms:hint>Revisiones del paciente</xforms:hint>
<xforms:toggle case="revPac" ev:event="xforms-activate" />
</xforms:trigger>
</p>

<xforms:switch>
<xforms:case id="datosPac" selected="true">
<p class="titulo">Datos del Paciente</p>
<xforms:input ref="sch:historial/sch:cabecera/sch:paciente/sch:dni">
<xforms:label>DNI : </xforms:label>
<xforms:hint>DNI del paciente</xforms:hint>
</xforms:input>
<xforms:input ref="sch:historial/sch:cabecera/sch:paciente/sch:nombre">
<xforms:label>Nombre : </xforms:label>
<xforms:hint>Nombre del paciente</xforms:hint>
</xforms:input>
<xforms:input ref="sch:historial/sch:cabecera/sch:paciente/sch:apellido1">
<xforms:label>Primer apellido : </xforms:label>
<xforms:hint>Primer apellido del paciente</xforms:hint>
</xforms:input>
<xforms:input ref="sch:historial/sch:cabecera/sch:paciente/sch:apellido2">
<xforms:label>Segundo apellido : </xforms:label>
<xforms:hint>Segundo apellido del paciente</xforms:hint>
</xforms:input>
<xforms:select1 ref="sch:historial/sch:cabecera/sch:paciente/sch:sexo"
appearance="full">
<xforms:label>Sexo : </xforms:label>
<xforms:hint>Sexo del paciente</xforms:hint>
<xforms:choices>
<xforms:item>
<xforms:value>V</xforms:value>
<xforms:label>Varón</xforms:label>
</xforms:item>
<xforms:item>
<xforms:value>M</xforms:value>
<xforms:label>Mujer</xforms:label>
</xforms:item>
</xforms:choices>
</xforms:select1>
</xforms:case>

<xforms:case id="revPac" selected="false">
<p class="titulo">Revisiones</p>
<xforms:repeat id="revisiones"
nodeset="/sch:historial/sch:cuerpo/sch:revisiones/sch:revision">
<p class="grupo2">
<xforms:input ref="sch:fechaRev">
<xforms:label>Fecha :</xforms:label>
<xforms:hint>Fecha de la revisión</xforms:hint>
</xforms:input>
<br />
<p class="subtitulo">Constantes :</p>
<br />
<xforms:input ref="sch:constantes/sch:pulso">
<xforms:label>Pulso :</xforms:label>
<xforms:hint>Pulso del paciente</xforms:hint>
</xforms:input>
<xforms:input ref="sch:constantes/sch:tension">
<xforms:label>Tensión :</xforms:label>
<xforms:hint>Tensión del paciente</xforms:hint>
</xforms:input>
<br />
<p class="subtitulo">Exploraciones :</p>
<br />
<xforms:textarea ref="sch:exploraciones/sch:piel">
<xforms:label>Piel :</xforms:label>
<xforms:hint>Notas sobre la exploración de la piel</xforms:hint>
</xforms:textarea>
<xforms:textarea ref="sch:exploraciones/sch:respiratoria">
<xforms:label>Respiratoria :</xforms:label>
<xforms:hint>Notas sobre la exploración respiratoria</xforms:hint>
</xforms:textarea>
<xforms:textarea ref="sch:exploraciones/sch:digestiva">
<xforms:label>Digestiva :</xforms:label>
<xforms:hint>Notas sobre la exploración digestiva</xforms:hint>
</xforms:textarea>
<xforms:textarea ref="sch:exploraciones/sch:cardiocvascular">
<xforms:label>Cardiovascular :</xforms:label>
<xforms:hint>Notas sobre la exploración cardiovascular</xforms:hint>
</xforms:textarea>
<xforms:textarea ref="sch:exploraciones/sch:genitourinaria">
<xforms:label>Genitourinaria :</xforms:label>
<xforms:hint>Notas sobre la exploración genitourinaria</xforms:hint>
</xforms:textarea>
<xforms:textarea ref="sch:exploraciones/sch:neurologica">
<xforms:label>Neurológica :</xforms:label>
<xforms:hint>Notas sobre la exploración neurológica</xforms:hint>
</xforms:textarea>
<br />
<p class="subtitulo" />
<br />
<xforms:textarea ref="sch:resultadoRev">
<xforms:label>Resultado :</xforms:label>
<xforms:hint>Resultado de la revisión</xforms:hint>
</xforms:textarea>
</p>
</xforms:repeat>

<p class="grupo">
<xforms:trigger>
<xforms:label>Añadir</xforms:label>
<xforms:hint>Añadir nueva revisión</xforms:hint>
<xforms:insert ev:event="xforms-activate"
ref="/sch:historial/sch:cuerpo/sch:revisiones/sch:revision "
at="xforms:index('revisiones')" position="after" />
</xforms:trigger>
<xforms:trigger>
<xforms:label>Borrar</xforms:label>
<xforms:hint>Borrar la revisión seleccionada</xforms:hint>
<xforms:delete ev:event="xforms-activate"
ref="/sch:historial/sch:cuerpo/sch:revisiones/sch:revision"
at="xforms:index('revisiones')" />
</xforms:trigger>
</p>
</xforms:case>

</xforms:switch>

<p class="titulo" />
<p class="cabecera">
<!-- control para enviar el formulario -->
<xforms:submit submission="submit1">
<xforms:label>Enviar</xforms:label>
<xforms:hint>Enviar la búsqueda</xforms:hint>
</xforms:submit>
</p>
</body>
</head>


And here is the CSS Stylesheet :

body {
 font-style: normal;
 font-weight: 500;
 background-color: rgb(90,130,170);
 color:black;
}

input {
 background-color: white;
 width: 300px;
}

textarea {
 height: 100px;
 width: 500px;
}


select1 {
 background-color: white;
 width: 300px;
}

trigger {
 background-color: rgb(90,130,170);
 width: 200px;
}

submit {
 background-color: rgb(90,130,170);
 width: 200px;
}

p.titulo {
 font-weight: bold;
 background-color:rgb(240,175,80);
 padding: 2px;
 border-style: solid;
 border-color: white;
 border-width: 2px;
}

p.subtitulo {
 font-weight: bold;
 background-color: rgb(50,90,130);
 padding: 2px;
 border-style: solid;
 border-color: white;
 border-width: 2px;
}

p.grupo2 {
 background-color: rgb(50,90,130);
 padding: 20px;
}

p.cabecera {
 padding: 20px;
}


Hope this can help

Guillermo Menéndez
Received on Tuesday, 10 December 2002 15:00:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:54 GMT