problem with multiple pages (switch/case)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with multiple pages (switch/case)

Jabba Laci
Hi,

I'm using Firefox 3 under Linux with the Mozilla Xforms plugin v0.8.6ff3.

We have a large form that we want to cut into several pages using
<xforms:switch> and <xforms:case>. The problem is that sometimes the
last page is not displayed correctly. If I refresh the page in the
browser, sometimes it works, but it is usually gone again after
another refresh.

Some more info. My xform is generated dynamically with a JSP. Inside
the JSP I have a nested JSP call like this:

<p>
    <%= bean.createSelect1Widget(parameter) %>
</p>

This call generates an <xforms:select1> widget with several choices
that are taken from a database.

As I noticed, this call causes the confusion with the multipaging. If
I remove these embedded JSP calls, the problem seems to be gone.

The problem is not present either if I only use one page, i.e. no multipaging.

Do you have any idea how to keep the nested JSP calls and the
multipaging too? To me it seems like a bug in the plugin.

Thanks,

Laszlo

Reply | Threaded
Open this post in threaded view
|

Re: problem with multiple pages (switch/case)

Aaron Reed
Hi Laszlo,

It could certainly be a bug with the plugin.  But for the moment I'd
suggest not thinking about the .jsp calls and instead verify that the
generated .xhtml file (created and returned by the jsp's) that the
plugin ends up processing looks exactly like you think it should.  If it
does, then it probably isn't a bug in your .jsp logic.  It might also be
worth your time trying the generated form in other processors and see
how they handle it.  If mozilla is the only processor with the problem,
then please simplify the form as much as possible and open a bug against us.

If you move this thread over to mozilla.dev.tech.xforms on
news.mozilla.org, we can help you more.

Thanks,
--Aaron

Jabba Laci wrote:

> Hi,
>
> I'm using Firefox 3 under Linux with the Mozilla Xforms plugin v0.8.6ff3.
>
> We have a large form that we want to cut into several pages using
> <xforms:switch>  and<xforms:case>. The problem is that sometimes the
> last page is not displayed correctly. If I refresh the page in the
> browser, sometimes it works, but it is usually gone again after
> another refresh.
>
> Some more info. My xform is generated dynamically with a JSP. Inside
> the JSP I have a nested JSP call like this:
>
> <p>
>      <%= bean.createSelect1Widget(parameter) %>
> </p>
>
> This call generates an<xforms:select1>  widget with several choices
> that are taken from a database.
>
> As I noticed, this call causes the confusion with the multipaging. If
> I remove these embedded JSP calls, the problem seems to be gone.
>
> The problem is not present either if I only use one page, i.e. no multipaging.
>
> Do you have any idea how to keep the nested JSP calls and the
> multipaging too? To me it seems like a bug in the plugin.
>
> Thanks,
>
> Laszlo
>
>




Reply | Threaded
Open this post in threaded view
|

RE: problem with multiple pages (switch/case)

Klotz, Leigh
In reply to this post by Jabba Laci
Laszlo,

I have two suggestions.  First, you might try the mailing list for the Mozilla XForms feature, which is here
  https://lists.mozilla.org/listinfo/dev-tech-xforms

Second, you might try de-coupling your JSP and XForms problems and testing them separately.  The JSP processing all happens before the XHTML+XForms page is delivered to Firefox, so either the page it produces isn't correct, or there's a bug in the Mozilla XForms feature.  Is it possible for you to "Save" the page from Firefox locally and run it locally?  You may need to convert instance initiailizations to relative references to files instead of having it go back to the server.

Leigh.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jabba Laci
Sent: Saturday, April 10, 2010 2:01 PM
To: xforms
Subject: problem with multiple pages (switch/case)

Hi,

I'm using Firefox 3 under Linux with the Mozilla Xforms plugin v0.8.6ff3.

We have a large form that we want to cut into several pages using <xforms:switch> and <xforms:case>. The problem is that sometimes the last page is not displayed correctly. If I refresh the page in the browser, sometimes it works, but it is usually gone again after another refresh.

Some more info. My xform is generated dynamically with a JSP. Inside the JSP I have a nested JSP call like this:

<p>
    <%= bean.createSelect1Widget(parameter) %> </p>

This call generates an <xforms:select1> widget with several choices that are taken from a database.

As I noticed, this call causes the confusion with the multipaging. If I remove these embedded JSP calls, the problem seems to be gone.

The problem is not present either if I only use one page, i.e. no multipaging.

Do you have any idea how to keep the nested JSP calls and the multipaging too? To me it seems like a bug in the plugin.

Thanks,

Laszlo


Reply | Threaded
Open this post in threaded view
|

Re: problem with multiple pages (switch/case)

Jabba Laci
> Second, you might try de-coupling your JSP and XForms problems and testing them separately.  The JSP processing all happens before the XHTML+XForms page is delivered to Firefox, so either the page it produces isn't correct, or there's a bug in the Mozilla XForms feature.  Is it possible for you to "Save" the page from Firefox locally and run it locally?  You may need to convert instance initiailizations to relative references to files instead of having it go back to the server.

Hi,

Thanks for the two answers. We have tried several variations, without
success. I would like to send you a problematic file, maybe someone
could help me:

http://dl.dropbox.com/u/144888/share/multipage-problem.xhtml
( the same file in .zip:
http://dl.dropbox.com/u/144888/share/multipage-problem.xhtml.zip )

[If you click on the link, most probably it will work fine, but if you
save it and open it locally with the file:// protocol, the last two
tabs are not shown.]


I took the JSP file and removed all JSP calls, so now it's just a
plain XHTML file. In our application these JSP files are generated, we
have lots of them. The problem is that sometimes the last (or the last
two) pages are not shown correctly, i.e. the part in the "case" block
is hidden.
We have two cases:

(1) The JSP page is not shown correctly, BUT after a page refresh in
the browser everything is OK.

(2) The JSP page is not shown correctly, and page refreshes in the
browser do not help.

As I noticed, small JSP files tend to fall in category (1), while
large XForms (size of the source > 100 KB) fall in (2).

I took a sample from category (2), converted it to local XHTML file
(no JSP calls), and when opened through the file:// protocol, the last
two pages are not shown. To reduce the size, "page 2" is removed. The
file is quite big, but if I remove one more tab, it seems to work.
However, we would need all tabs, and some forms are even larger.

Thanks,

Laszlo

Reply | Threaded
Open this post in threaded view
|

RE: problem with multiple pages (switch/case)

Klotz, Leigh
Laszlo,
I tested your multipage-problem.xhtml under AgenceXML XSLTForms and was able to see the buttons (and cases) for page 1,3,4,5,6.
I understand you removed page 2.

I made a few changes:

1. Remove the DTD header
The file is not XHTML, but XHTML+XForms, so DTD validation is incorrect.
Since the XHTML DTD defines the &nbsp; entity, I replaced those with &#160;
The &amp; entity is predefined in XML so it's OK.

2. Fix validation errors in XForms
Instead of
                  <xforms:output>(minimal value: 1.0 ; maximal value: 500.0)</xforms:output>
Use
                  <xforms:hint>(minimal value: 1.0 ; maximal value: 500.0)</xforms:hint>
xf:output doesn't use text inside it, and xf:output cannot appear inside other controls.

Move the xf:output elements outside of xf:upload, as xf:output cannot appear inside other form controls.

3. Change to use XSLTForms
In place of the DTD header, use this instead:
 <?xml version="1.0" encoding="utf-8"?>
 <?xml-stylesheet href="/xsltforms/xsltforms.xsl" type="text/xsl" ?>
 <?xsltforms-options css="no" debug="yes" ?>
Of course, to do this you must have a recent SVN version of XSLTForms available at the stylesheet href.

If you still have this same problem under XSLTForms, please write back.  However, if this fixes your problem, I think it means you have found a bug in Mozilla XForms and you can discuss it on the dev-tech-xforms mailing list that mozilla.org hosts.  (Of course, if you find bugs specific to XSLTForms that aren't general XForms problems, the xsltforms-support mailing list is the appropriate place to report them.)

Leigh.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jabba Laci
Sent: Tuesday, May 25, 2010 4:43 PM
To: xforms
Subject: Re: problem with multiple pages (switch/case)

> Second, you might try de-coupling your JSP and XForms problems and testing them separately.  The JSP processing all happens before the XHTML+XForms page is delivered to Firefox, so either the page it produces isn't correct, or there's a bug in the Mozilla XForms feature.  Is it possible for you to "Save" the page from Firefox locally and run it locally?  You may need to convert instance initiailizations to relative references to files instead of having it go back to the server.

Hi,

Thanks for the two answers. We have tried several variations, without success. I would like to send you a problematic file, maybe someone could help me:

http://dl.dropbox.com/u/144888/share/multipage-problem.xhtml
( the same file in .zip:
http://dl.dropbox.com/u/144888/share/multipage-problem.xhtml.zip )

[If you click on the link, most probably it will work fine, but if you save it and open it locally with the file:// protocol, the last two tabs are not shown.]


I took the JSP file and removed all JSP calls, so now it's just a plain XHTML file. In our application these JSP files are generated, we have lots of them. The problem is that sometimes the last (or the last
two) pages are not shown correctly, i.e. the part in the "case" block is hidden.
We have two cases:

(1) The JSP page is not shown correctly, BUT after a page refresh in the browser everything is OK.

(2) The JSP page is not shown correctly, and page refreshes in the browser do not help.

As I noticed, small JSP files tend to fall in category (1), while large XForms (size of the source > 100 KB) fall in (2).

I took a sample from category (2), converted it to local XHTML file (no JSP calls), and when opened through the file:// protocol, the last two pages are not shown. To reduce the size, "page 2" is removed. The file is quite big, but if I remove one more tab, it seems to work.
However, we would need all tabs, and some forms are even larger.

Thanks,

Laszlo


Reply | Threaded
Open this post in threaded view
|

RE: problem with multiple pages (switch/case)

John Boyer

Minor point.
All the essential points Leigh makes are correct, but you can in fact put an xforms:output inside of an xforms:hint.  

See the second table here: http://www.w3.org/TR/2009/REC-xforms-20091020/#controls

The content model for xforms:hint includes UIContent, which is defined to contain outputs: http://www.w3.org/TR/2009/REC-xforms-20091020/#elems-inline

The essential issue, though, is that an xforms output cannot appear directly inside other controls, but rather have to appear in these metadata elements.  Moreover, the content model of output is a label, so you could put your text in that (along with more outputs, in fact).   However, the purpose of output is not really to hold just plain text, but usually it is to use a binding or value attribute to output data to the presentation layer, since as Leigh points out you can just put plain text directly into elements like xforms hint.

Cheers,
John M. Boyer, Ph.D.
STSM, Lotus Forms
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab
E-Mail: [hidden email]  

Blog:
http://www.ibm.com/developerworks/blogs/page/JohnBoyer
Blog RSS feed:
http://www.ibm.com/developerworks/blogs/rss/JohnBoyer?flavor=rssdw




From: "Klotz, Leigh" <[hidden email]>
To: "Jabba Laci" <[hidden email]>, "xforms" <[hidden email]>
Date: 05/26/2010 01:26 PM
Subject: RE: problem with multiple pages (switch/case)





Laszlo,
I tested your multipage-problem.xhtml under AgenceXML XSLTForms and was able to see the buttons (and cases) for page 1,3,4,5,6.
I understand you removed page 2.

I made a few changes:

1. Remove the DTD header
The file is not XHTML, but XHTML+XForms, so DTD validation is incorrect.
Since the XHTML DTD defines the &nbsp; entity, I replaced those with &#160;
The &amp; entity is predefined in XML so it's OK.

2. Fix validation errors in XForms
Instead of
                 <xforms:output>(minimal value: 1.0 ; maximal value: 500.0)</xforms:output>
Use
                 <xforms:hint>(minimal value: 1.0 ; maximal value: 500.0)</xforms:hint>
xf:output doesn't use text inside it, and xf:output cannot appear inside other controls.

Move the xf:output elements outside of xf:upload, as xf:output cannot appear inside other form controls.

3. Change to use XSLTForms
In place of the DTD header, use this instead:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="/xsltforms/xsltforms.xsl" type="text/xsl" ?>
<?xsltforms-options css="no" debug="yes" ?>
Of course, to do this you must have a recent SVN version of XSLTForms available at the stylesheet href.

If you still have this same problem under XSLTForms, please write back.  However, if this fixes your problem, I think it means you have found a bug in Mozilla XForms and you can discuss it on the dev-tech-xforms mailing list that mozilla.org hosts.  (Of course, if you find bugs specific to XSLTForms that aren't general XForms problems, the xsltforms-support mailing list is the appropriate place to report them.)

Leigh.

-----Original Message-----
From: [hidden email] [
[hidden email]] On Behalf Of Jabba Laci
Sent: Tuesday, May 25, 2010 4:43 PM
To: xforms
Subject: Re: problem with multiple pages (switch/case)

> Second, you might try de-coupling your JSP and XForms problems and testing them separately.  The JSP processing all happens before the XHTML+XForms page is delivered to Firefox, so either the page it produces isn't correct, or there's a bug in the Mozilla XForms feature.  Is it possible for you to "Save" the page from Firefox locally and run it locally?  You may need to convert instance initiailizations to relative references to files instead of having it go back to the server.

Hi,

Thanks for the two answers. We have tried several variations, without success. I would like to send you a problematic file, maybe someone could help me:

http://dl.dropbox.com/u/144888/share/multipage-problem.xhtml
( the same file in .zip:
http://dl.dropbox.com/u/144888/share/multipage-problem.xhtml.zip )

[If you click on the link, most probably it will work fine, but if you save it and open it locally with the file:// protocol, the last two tabs are not shown.]


I took the JSP file and removed all JSP calls, so now it's just a plain XHTML file. In our application these JSP files are generated, we have lots of them. The problem is that sometimes the last (or the last
two) pages are not shown correctly, i.e. the part in the "case" block is hidden.
We have two cases:

(1) The JSP page is not shown correctly, BUT after a page refresh in the browser everything is OK.

(2) The JSP page is not shown correctly, and page refreshes in the browser do not help.

As I noticed, small JSP files tend to fall in category (1), while large XForms (size of the source > 100 KB) fall in (2).

I took a sample from category (2), converted it to local XHTML file (no JSP calls), and when opened through the file:// protocol, the last two pages are not shown. To reduce the size, "page 2" is removed. The file is quite big, but if I remove one more tab, it seems to work.
However, we would need all tabs, and some forms are even larger.

Thanks,

Laszlo