Jabba Laci | 4 Feb 2009 22:39
Picon
Gravatar

warning if a required field is left empty


Hi,

I have an xform with several required fields. If the user leaves one
of them blank and presses the submit button, nothing happens. How
could I add a warning message saying "You didn't fill all the required
fields." ? I don't want to detail which fields are missing, I just
want a general warning.

Thanks,

Laszlo

Mark Birbeck | 4 Feb 2009 22:56
Gravatar

Re: warning if a required field is left empty


Hi Laszlo,

Easiest thing is to add an xf:message handler on the
"xforms-submit-error" event.

Regards,

Mark

On Wed, Feb 4, 2009 at 9:39 PM, Jabba Laci <jabba.laci <at> gmail.com> wrote:
>
> Hi,
>
> I have an xform with several required fields. If the user leaves one
> of them blank and presses the submit button, nothing happens. How
> could I add a warning message saying "You didn't fill all the required
> fields." ? I don't want to detail which fields are missing, I just
> want a general warning.
>
> Thanks,
>
> Laszlo
>
>

--

-- 
Mark Birbeck, webBackplane

mark.birbeck <at> webBackplane.com
(Continue reading)

Charles F Wiecha | 4 Feb 2009 23:01
Picon
Favicon

Re: warning if a required field is left empty

Hi -- In XForms 1.0 you can listen for the xforms-submit-error event, dispatched on the relevant <submission> element. This event is used to signal, among other things, required but missing data. See section 11.1 of the spec (http://www.w3.org/TR/xforms/#submit).

In XForms 1.1 the xforms-submit-error is augmented with context information that allows you to test specifically for this condition vs. other possible causes of a failed submission.

Charlie Wiecha


Jabba Laci ---02/04/2009 04:43:45 PM---Hi, I have an xform with several required fields. If the user leaves one


From:

Jabba Laci <jabba.laci <at> gmail.com>

To:

xforms <www-forms <at> w3.org>

Date:

02/04/2009 04:43 PM

Subject:

warning if a required field is left empty

Sent by:

www-forms-request <at> w3.org




Hi,

I have an xform with several required fields. If the user leaves one
of them blank and presses the submit button, nothing happens. How
could I add a warning message saying "You didn't fill all the required
fields." ? I don't want to detail which fields are missing, I just
want a general warning.

Thanks,

Laszlo



Jabba Laci | 4 Feb 2009 23:05
Picon
Gravatar

Re: treating (multiple) attached images


>> (2) When visualizing an instance with attached images, how to present
>> the images? Instead of the image URL, is it possible to show the
>> image? Or a thumbnail...
>
> With some implementations, this will work to display the image:
>
>  <xforms:output mediatype="image/*" ref="..."/>

Hi,

Is it possible to resize an image when visualizing it? I want to
upload photos, and they might be really big. An optimal solution would
be to show just a thumbnail, and when the user clicks on it, show the
image in full size.

Thanks,

Laszlo

Erik Bruchez | 5 Feb 2009 04:51
Favicon
Gravatar

Re: treating (multiple) attached images


> Is it possible to resize an image when visualizing it? I want to
> upload photos, and they might be really big. An optimal solution would
> be to show just a thumbnail, and when the user clicks on it, show the
> image in full size.

Not in standard XForms, AFAIK.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/

Jabba Laci | 5 Feb 2009 05:54
Picon
Gravatar

Re: treating (multiple) attached images


>> Is it possible to resize an image when visualizing it? I want to
>> upload photos, and they might be really big. An optimal solution would
>> be to show just a thumbnail, and when the user clicks on it, show the
>> image in full size.
>
>
> Not in standard XForms, AFAIK.

Hi,

Then I must find an alternative solution. What do you think of this one?

For producing xforms, I use Java Server Pages. The instance that I
want to visualize is loaded from a database. If it's not possible in
XForms, then I should replace the image visualization part with normal
XHTML. The problem is that I cannot get the image URLs from the XML
instance with "ref" in XHTML, I guess. So should I write a JSP code
(or bean) to extract the URLs from the XML instance, and use these
URLs to produce the image visualization with thumbnails?

If you have a better idea, plase let me know.

Thanks,

Laszlo

COUTHURES Alain | 5 Feb 2009 08:41
Favicon
Gravatar

Output notation for attributes


Hello,

<xf:output> can be used to dynamically output text, binary content or 
elements but there is no notation for attributes...

I think it wouldn't be very difficult to add something like 
attr="{xpath_expr}" just like in XSLT !?

What do you think about that ?

Alain COUTHURES
<agenceXML>
XSLTForms: http://www.agencexml.com/xsltforms/
Bordeaux, France

Erik Bruchez a écrit :
>
>> Is it possible to resize an image when visualizing it? I want to
>> upload photos, and they might be really big. An optimal solution would
>> be to show just a thumbnail, and when the user clicks on it, show the
>> image in full size.
>
>
> Not in standard XForms, AFAIK.
>
> -Erik
>
> -- 
> Orbeon Forms - Web Forms for the Enterprise Done the Right Way
> http://www.orbeon.com/
>
>
>

Mark Birbeck | 5 Feb 2009 11:13
Gravatar

Re: treating (multiple) attached images


Hi Jabba,

You could resize the output with CSS, couldn't you?

Regards,

Mark

On Thu, Feb 5, 2009 at 4:54 AM, Jabba Laci <jabba.laci <at> gmail.com> wrote:
>
>>> Is it possible to resize an image when visualizing it? I want to
>>> upload photos, and they might be really big. An optimal solution would
>>> be to show just a thumbnail, and when the user clicks on it, show the
>>> image in full size.
>>
>>
>> Not in standard XForms, AFAIK.
>
> Hi,
>
> Then I must find an alternative solution. What do you think of this one?
>
> For producing xforms, I use Java Server Pages. The instance that I
> want to visualize is loaded from a database. If it's not possible in
> XForms, then I should replace the image visualization part with normal
> XHTML. The problem is that I cannot get the image URLs from the XML
> instance with "ref" in XHTML, I guess. So should I write a JSP code
> (or bean) to extract the URLs from the XML instance, and use these
> URLs to produce the image visualization with thumbnails?
>
> If you have a better idea, plase let me know.
>
> Thanks,
>
> Laszlo
>
>

--

-- 
Mark Birbeck, webBackplane

mark.birbeck <at> webBackplane.com

http://webBackplane.com/mark-birbeck

webBackplane is a trading name of Backplane Ltd. (company number
05972288, registered office: 2nd Floor, 69/85 Tabernacle Street,
London, EC2A 4RR)

Erik Bruchez | 5 Feb 2009 14:25
Favicon
Gravatar

Re: Output notation for attributes


Some implementations, in particular Orbeon Forms, support such  
Attribute Value Template (AVT) notation.

Yes, that's invaluable ;-)

-Erik

On Feb 5, 2009, at 2:41 AM, COUTHURES Alain wrote:

>
> Hello,
>
> <xf:output> can be used to dynamically output text, binary content  
> or elements but there is no notation for attributes...
>
> I think it wouldn't be very difficult to add something like  
> attr="{xpath_expr}" just like in XSLT !?
>
> What do you think about that ?
>
> Alain COUTHURES
> <agenceXML>
> XSLTForms: http://www.agencexml.com/xsltforms/
> Bordeaux, France
>
> Erik Bruchez a écrit :
>>
>>> Is it possible to resize an image when visualizing it? I want to
>>> upload photos, and they might be really big. An optimal solution  
>>> would
>>> be to show just a thumbnail, and when the user clicks on it, show  
>>> the
>>> image in full size.
>>
>>
>> Not in standard XForms, AFAIK.
>>
>> -Erik
>>
>> -- 
>> Orbeon Forms - Web Forms for the Enterprise Done the Right Way
>> http://www.orbeon.com/
>>
>>
>>
>
>

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/

Steven Pemberton | 5 Feb 2009 14:48
Picon
Picon
Favicon

Re: Output notation for attributes


On Thu, 05 Feb 2009 08:41:18 +0100, COUTHURES Alain  
<alain.couthures <at> agencexml.com> wrote:

>
> Hello,
>
> <xf:output> can be used to dynamically output text, binary content or  
> elements but there is no notation for attributes...
>
> I think it wouldn't be very difficult to add something like  
> attr="{xpath_expr}" just like in XSLT !?
>
> What do you think about that ?

My problem is that XForms is a hosted language, and you aren't really  
allowed to define the content of other languages' attributes.

Another way of achieving the same result (which would be allowed) would be  
to have a special instance that represented the current document:

     <body class="default">
     ...
	<select1 ref="document()/body <at> class">
	<label>Style:</label>
	   <item>
	      <label>Default</label><value>default</value>
	   </item>
	   <item>
	      <label>Night</label><value>night</value>
	   </item>
	   <item>
	      <label>Black/White</label><value>monochrome</value>
	   </item>
	   <item>
	      <label>Big fonts</label><value>big</value>
	   </item>
	</select1>

Steven

>
> Alain COUTHURES
> <agenceXML>
> XSLTForms: http://www.agencexml.com/xsltforms/
> Bordeaux, France
>
> Erik Bruchez a écrit :
>>
>>> Is it possible to resize an image when visualizing it? I want to
>>> upload photos, and they might be really big. An optimal solution would
>>> be to show just a thumbnail, and when the user clicks on it, show the
>>> image in full size.
>>
>>
>> Not in standard XForms, AFAIK.
>>
>> -Erik
>>
>> -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way
>> http://www.orbeon.com/
>>
>>
>>
>
>


Gmane