You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Francisco Mardones <fr...@mardonet.com> on 2009/10/01 00:38:16 UTC

Re: [trinidad] problem submitting forms in limited mobile browsers

The version described in Trinidad jar's Manifest is 1.2.11.1-SNAPSHOT  (I'm
using the version bundled in Jdeveloper 11.1.1.1.0).

I intercepted the html generated for the Survey Demo application (
http://www.irian.at/trinidad-demo/faces/surveydemo/surveyStart.jspx) sending
BlackBerry's User Agent v4.1 and got the html below. Something strange: the
form is invoking a function called "submitForm" on click, but this in not
defined or included in the whole page. Also, notice the code isn't xhtml...

¿What do you think? ¿Could be a bug?

Thanks a lot
Francisco

-----------------------------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><!--Start<http://www.w3.org/TR/html4/loose.dtd%22%3E%3C!--Start>:
org.apache.myfaces.trinidad.Document["_idJsp0"]--><html dir="ltr" lang="en">
  <head>
    <title>Survey</title>

    <meta name="generator" content="Apache MyFaces Trinidad">

    <link rel="stylesheet" charset="UTF-8" type="text/css"
href="/trinidad-demo/adf/styles/cache/minimal-pda-nhib3y-en-ltr-blackberry-blackberry-cmp.css">
  </head>
  <!--Start: org.apache.myfaces.trinidad.Document["_idJsp0"]-->
  <body onload="_checkLoadNoPPR()"><a name="top"></a>
    <noscript>This page uses JavaScript and requires a JavaScript enabled
browser.Your browser is not JavaScript enabled.</noscript>
    <!--Start: org.apache.myfaces.trinidad.Form["_idJsp1"]-->
    <form id="_idJsp1" name="_idJsp1" style="margin:0px" method="POST"
action="/trinidad-demo/faces/surveydemo/surveyStart.jspx"><!--Start:
org.apache.myfaces.trinidad.Panel["_idJsp2"]--><div></div><!--Start:
org.apache.myfaces.trinidad.Panel["_idJsp2"]-->
  <hr size="2">
          <!--Start:
org.apache.myfaces.trinidad.Panel["_idJsp2"]--><!--Start:
org.apache.myfaces.trinidad.Panel["_idJsp5"]--><div>
              <h1 class="x6u">Welcome to the Survey Demo</h1>
              <!--Start:
org.apache.myfaces.trinidad.Output["_idJsp6"]--><span class="x0">Test your
knowledge of California Driving Laws</span><!--Start:
org.apache.myfaces.trinidad.Object["_idJsp7"]--><div
style="margin-top:20px"></div><!--Start:
org.apache.myfaces.trinidad.Command["_idJsp8"]--><input type="submit"
onclick="submitForm('_idJsp1',1,{source:'_idJsp8'});return false;"
class="x7i" value="begin survey"></div><!--Start:
org.apache.myfaces.trinidad.Panel["_idJsp2"]-->
          <hr size="2">
          <!--Start: org.apache.myfaces.trinidad.Panel["_idJsp2"]--><table
width="100%" summary=""><tr>
              <td align="center"><!--Start:
org.apache.myfaces.trinidad.NavigationLevel["_idJsp3"]--><div
class="af_navigationPane"><span class="x42"><span class="x43"><!--Start:
org.apache.myfaces.trinidad.Command["_idJsp4"]--><a id="_idJsp3:_idJsp4"
name="_idJsp3:_idJsp4" href="#"
onclick="submitForm('_idJsp1',0,{source:'_idJsp3:_idJsp4'});return
false;">Return to Index</a></span></span></div></td>
            </tr><!--Start:
org.apache.myfaces.trinidad.Panel["_idJsp2"]--><tr>
              <td class="x5x" align="center"></td>
            </tr><!--Start:
org.apache.myfaces.trinidad.Panel["_idJsp2"]--><tr>
              <td class="x5y" align="center"></td>
            </tr><!--Start:
org.apache.myfaces.trinidad.Panel["_idJsp2"]--><tr>
              <td class="x5z" align="center"></td>
            </tr></table>
   <input type="hidden" name="org.apache.myfaces.trinidad.faces.FORM"
value="_idJsp1">
   <input type="hidden" name="org.apache.myfaces.trinidad.faces.STATE"
value="!400864fa">
   <input type="hidden" name="source" value="a">
   <input type="hidden" name="event" value="a">
 </form>
  </body>
  <!--Created by Apache Trinidad (Apache MyFaces Trinidad API -
1.0.10/Apache MyFaces Trinidad Impl - 1.0.10), skin:minimal.pda--></html>
-----------------------------------------------------------------------------------------------------
On Wed, Sep 30, 2009 at 15:38, Mamallan Uthaman <mamallan.uthaman@oracle.com
> wrote:

> Hi Francisco,
>
> The best way to best detect whether JavaScript is being used or not is to
> intercepting your HTTP response using web-debugger like fiddler. You can
> download it from the link below:
> http://www.fiddler2.com/fiddler2/
>
> In your case, I believe it could have happened that though Trinidad doesn't
> use JavaScript, some components might still use some redundant JavaScript
> calls - could be a minor bug.
>
> Could you please tell me the version of Trinidad jars you are using?
>
> Also, Please find my answers for your questions inline.
>
> Thanks
> Mamallan
>
> Francisco Mardones wrote:
>
> Hi,
>
> I'm facing problems to post forms in Basic XHTML browsers (modern
> blackberries and desktop browsers work fine).
>
> I noticed form submission invokes a javascript function, even though
> according the docs I should NOT get any javascript:
>
> -----------start snippet-----------------
> "...it supports mobile browsers that support Basic XHTML or XHTML Mobile
> Profile. WAP 2.0 phone browsers are included in this category. Because of
> the hardware performance limitation, Trinidad does not download or use
> JavaScript library on such devices.
>
> The following list shows the examples of Basic XHTML mobile browsers.
>
> (snip)
>
>    - RIM BlackBerry Browser 4.2 ~ 4.5"
>
> -----------end snippet-----------------
>
> I can see the generated code isn't xhtml, and also I see a lot of
> javascript (and particularly to submit the form, using "onclick" event), so
> I'm suspecting Trinidad is not detecting properly which browser is
> accessing. The User Agent for the mobile is "BlackBerry7100i/4.1.0
> Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/103"
>
> My questions are:
> 1) How I can debug which browser is detecting?
>
> Use following EL:
> #{requestContext.agent.agentName}
> #{requestContext.agent.agentVersion}
> #{requestContext.agent.platformName}
>
> 2) Is there any way to enforce code generation to basic xhtml?
>
> No, Trinidad has predefine rules which is not configurable.
>
> 3) Can I extend and/or add a new 'renderer' profile in Trinidad? (notice my
> browser is 4.1, and the doc says at least support 4.2 and above, so maybe is
> defaulting wrongly given mine is older...) (as you can imagine after long
> tests now I'm facing the "wild guessing" phase :P )
>
> No
>
> Many Thanks
> Francisco
>
>

Re: [trinidad] problem submitting forms in limited mobile browsers

Posted by Francisco Mardones <fr...@mardonet.com>.
ups...you're right.

The rendering works fine using the latest version in BlackBerry browser
v4.1.0. Tested.

Thanks a lot!
Francisco

On Wed, Sep 30, 2009 at 18:57, Mamallan Uthaman <mamallan.uthaman@oracle.com
> wrote:

>  Hi Francisco,
>
> Doesn't seems like a bug. After seeing the code below, I can conclude that
> the Survey Demo uses Trinidad 1.x., and is old enough not to have
> mobile-related changes. Many mobile features and fixes are available in
> Trinidad 1.2.x only. Please try creating a simple page and test it using
> Trinidad 1.2.x.
>
> *"<!--Created by Apache Trinidad (Apache MyFaces Trinidad API -
> 1.0.10/Apache MyFaces Trinidad Impl - 1.0.10), skin:minimal.pda-->"  --
> taken from Survey Demo's HTML code *
>
> Thanks
> Mamallan
>
> Francisco Mardones wrote:
>
> The version described in Trinidad jar's Manifest is 1.2.11.1-SNAPSHOT  (I'm
> using the version bundled in Jdeveloper 11.1.1.1.0).
>
> I intercepted the html generated for the Survey Demo application (
> http://www.irian.at/trinidad-demo/faces/surveydemo/surveyStart.jspx)
> sending BlackBerry's User Agent v4.1 and got the html below. Something
> strange: the form is invoking a function called "submitForm" on click, but
> this in not defined or included in the whole page. Also, notice the code
> isn't xhtml...
> ¿What do you think? ¿Could be a bug?
>
> Thanks a lot
> Francisco
>
>
> -----------------------------------------------------------------------------------------------------
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
> http://www.w3.org/TR/html4/loose.dtd"><!--Start<http://www.w3.org/TR/html4/loose.dtd%22%3E%3C%21--Start>:
> org.apache.myfaces.trinidad.Document["_idJsp0"]--><html dir="ltr" lang="en">
>   <head>
>     <title>Survey</title>
>
>     <meta name="generator" content="Apache MyFaces Trinidad">
>
>     <link rel="stylesheet" charset="UTF-8" type="text/css"
> href="/trinidad-demo/adf/styles/cache/minimal-pda-nhib3y-en-ltr-blackberry-blackberry-cmp.css">
>   </head>
>   <!--Start: org.apache.myfaces.trinidad.Document["_idJsp0"]-->
>   <body onload="_checkLoadNoPPR()"><a name="top"></a>
>     <noscript>This page uses JavaScript and requires a JavaScript enabled
> browser.Your browser is not JavaScript enabled.</noscript>
>     <!--Start: org.apache.myfaces.trinidad.Form["_idJsp1"]-->
>     <form id="_idJsp1" name="_idJsp1" style="margin:0px" method="POST"
> action="/trinidad-demo/faces/surveydemo/surveyStart.jspx"><!--Start:
> org.apache.myfaces.trinidad.Panel["_idJsp2"]--><div></div><!--Start:
> org.apache.myfaces.trinidad.Panel["_idJsp2"]-->
>   <hr size="2">
>           <!--Start:
> org.apache.myfaces.trinidad.Panel["_idJsp2"]--><!--Start:
> org.apache.myfaces.trinidad.Panel["_idJsp5"]--><div>
>               <h1 class="x6u">Welcome to the Survey Demo</h1>
>               <!--Start:
> org.apache.myfaces.trinidad.Output["_idJsp6"]--><span class="x0">Test your
> knowledge of California Driving Laws</span><!--Start:
> org.apache.myfaces.trinidad.Object["_idJsp7"]--><div
> style="margin-top:20px"></div><!--Start:
> org.apache.myfaces.trinidad.Command["_idJsp8"]--><input type="submit"
> onclick="submitForm('_idJsp1',1,{source:'_idJsp8'});return false;"
> class="x7i" value="begin survey"></div><!--Start:
> org.apache.myfaces.trinidad.Panel["_idJsp2"]-->
>           <hr size="2">
>           <!--Start: org.apache.myfaces.trinidad.Panel["_idJsp2"]--><table
> width="100%" summary=""><tr>
>               <td align="center"><!--Start:
> org.apache.myfaces.trinidad.NavigationLevel["_idJsp3"]--><div
> class="af_navigationPane"><span class="x42"><span class="x43"><!--Start:
> org.apache.myfaces.trinidad.Command["_idJsp4"]--><a id="_idJsp3:_idJsp4"
> name="_idJsp3:_idJsp4" href="#"
> onclick="submitForm('_idJsp1',0,{source:'_idJsp3:_idJsp4'});return
> false;">Return to Index</a></span></span></div></td>
>             </tr><!--Start:
> org.apache.myfaces.trinidad.Panel["_idJsp2"]--><tr>
>               <td class="x5x" align="center"></td>
>             </tr><!--Start:
> org.apache.myfaces.trinidad.Panel["_idJsp2"]--><tr>
>               <td class="x5y" align="center"></td>
>             </tr><!--Start:
> org.apache.myfaces.trinidad.Panel["_idJsp2"]--><tr>
>               <td class="x5z" align="center"></td>
>             </tr></table>
>    <input type="hidden" name="org.apache.myfaces.trinidad.faces.FORM"
> value="_idJsp1">
>    <input type="hidden" name="org.apache.myfaces.trinidad.faces.STATE"
> value="!400864fa">
>    <input type="hidden" name="source" value="a">
>    <input type="hidden" name="event" value="a">
>  </form>
>   </body>
>   <!--Created by Apache Trinidad (Apache MyFaces Trinidad API -
> 1.0.10/Apache MyFaces Trinidad Impl - 1.0.10), skin:minimal.pda--></html>
>
> -----------------------------------------------------------------------------------------------------
> On Wed, Sep 30, 2009 at 15:38, Mamallan Uthaman <
> mamallan.uthaman@oracle.com> wrote:
>
>> Hi Francisco,
>>
>> The best way to best detect whether JavaScript is being used or not is to
>> intercepting your HTTP response using web-debugger like fiddler. You can
>> download it from the link below:
>> http://www.fiddler2.com/fiddler2/
>>
>> In your case, I believe it could have happened that though Trinidad
>> doesn't use JavaScript, some components might still use some redundant
>> JavaScript calls - could be a minor bug.
>>
>> Could you please tell me the version of Trinidad jars you are using?
>>
>> Also, Please find my answers for your questions inline.
>>
>> Thanks
>> Mamallan
>>
>> Francisco Mardones wrote:
>>
>> Hi,
>>
>> I'm facing problems to post forms in Basic XHTML browsers (modern
>> blackberries and desktop browsers work fine).
>>
>> I noticed form submission invokes a javascript function, even though
>> according the docs I should NOT get any javascript:
>>
>> -----------start snippet-----------------
>> "...it supports mobile browsers that support Basic XHTML or XHTML Mobile
>> Profile. WAP 2.0 phone browsers are included in this category. Because of
>> the hardware performance limitation, Trinidad does not download or use
>> JavaScript library on such devices.
>>
>> The following list shows the examples of Basic XHTML mobile browsers.
>>
>> (snip)
>>
>>    - RIM BlackBerry Browser 4.2 ~ 4.5"
>>
>> -----------end snippet-----------------
>>
>> I can see the generated code isn't xhtml, and also I see a lot of
>> javascript (and particularly to submit the form, using "onclick" event), so
>> I'm suspecting Trinidad is not detecting properly which browser is
>> accessing. The User Agent for the mobile is "BlackBerry7100i/4.1.0
>> Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/103"
>>
>> My questions are:
>> 1) How I can debug which browser is detecting?
>>
>>  Use following EL:
>> #{requestContext.agent.agentName}
>> #{requestContext.agent.agentVersion}
>> #{requestContext.agent.platformName}
>>
>> 2) Is there any way to enforce code generation to basic xhtml?
>>
>>  No, Trinidad has predefine rules which is not configurable.
>>
>> 3) Can I extend and/or add a new 'renderer' profile in Trinidad? (notice
>> my browser is 4.1, and the doc says at least support 4.2 and above, so maybe
>> is defaulting wrongly given mine is older...) (as you can imagine after long
>> tests now I'm facing the "wild guessing" phase :P )
>>
>>  No
>>
>> Many Thanks
>> Francisco
>>
>>
>

Re: [trinidad] problem submitting forms in limited mobile browsers

Posted by Mamallan Uthaman <ma...@oracle.com>.
Hi Francisco,

Doesn't seems like a bug. After seeing the code below, I can conclude 
that the Survey Demo uses Trinidad 1.x., and is old enough not to have 
mobile-related changes. Many mobile features and fixes are available in 
Trinidad 1.2.x only. Please try creating a simple page and test it using 
Trinidad 1.2.x.

*"<!--Created by Apache Trinidad (Apache MyFaces Trinidad API - 
1.0.10/Apache MyFaces Trinidad Impl - 1.0.10), skin:minimal.pda-->"  -- 
taken from Survey Demo's HTML code *

Thanks
Mamallan

Francisco Mardones wrote:
> The version described in Trinidad jar's Manifest is 1.2.11.1-SNAPSHOT  
> (I'm using the version bundled in Jdeveloper 11.1.1.1.0).
>  
> I intercepted the html generated for the Survey Demo application 
> (http://www.irian.at/trinidad-demo/faces/surveydemo/surveyStart.jspx) 
> sending BlackBerry's User Agent v4.1 and got the html below. Something 
> strange: the form is invoking a function called "submitForm" on click, 
> but this in not defined or included in the whole page. Also, notice 
> the code isn't xhtml...
>  
> ¿What do you think? ¿Could be a bug?
>  
> Thanks a lot
> Francisco
>  
> -----------------------------------------------------------------------------------------------------
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
> "http://www.w3.org/TR/html4/loose.dtd"><!--Start 
> <http://www.w3.org/TR/html4/loose.dtd%22%3E%3C%21--Start>: 
> org.apache.myfaces.trinidad.Document["_idJsp0"]--><html dir="ltr" 
> lang="en">
>   <head>
>     <title>Survey</title>
>      
>     <meta name="generator" content="Apache MyFaces Trinidad">
>      
>     <link rel="stylesheet" charset="UTF-8" type="text/css" 
> href="/trinidad-demo/adf/styles/cache/minimal-pda-nhib3y-en-ltr-blackberry-blackberry-cmp.css">
>   </head>
>   <!--Start: org.apache.myfaces.trinidad.Document["_idJsp0"]-->
>   <body onload="_checkLoadNoPPR()"><a name="top"></a>
>     <noscript>This page uses JavaScript and requires a JavaScript 
> enabled browser.Your browser is not JavaScript enabled.</noscript>
>     <!--Start: org.apache.myfaces.trinidad.Form["_idJsp1"]-->
>     <form id="_idJsp1" name="_idJsp1" style="margin:0px" method="POST" 
> action="/trinidad-demo/faces/surveydemo/surveyStart.jspx"><!--Start: 
> org.apache.myfaces.trinidad.Panel["_idJsp2"]--><div></div><!--Start: 
> org.apache.myfaces.trinidad.Panel["_idJsp2"]-->
>   <hr size="2">
>           <!--Start: 
> org.apache.myfaces.trinidad.Panel["_idJsp2"]--><!--Start: 
> org.apache.myfaces.trinidad.Panel["_idJsp5"]--><div>
>               <h1 class="x6u">Welcome to the Survey Demo</h1>
>               <!--Start: 
> org.apache.myfaces.trinidad.Output["_idJsp6"]--><span class="x0">Test 
> your knowledge of California Driving Laws</span><!--Start: 
> org.apache.myfaces.trinidad.Object["_idJsp7"]--><div 
> style="margin-top:20px"></div><!--Start: 
> org.apache.myfaces.trinidad.Command["_idJsp8"]--><input type="submit" 
> onclick="submitForm('_idJsp1',1,{source:'_idJsp8'});return false;" 
> class="x7i" value="begin survey"></div><!--Start: 
> org.apache.myfaces.trinidad.Panel["_idJsp2"]-->
>           <hr size="2">
>           <!--Start: 
> org.apache.myfaces.trinidad.Panel["_idJsp2"]--><table width="100%" 
> summary=""><tr>
>               <td align="center"><!--Start: 
> org.apache.myfaces.trinidad.NavigationLevel["_idJsp3"]--><div 
> class="af_navigationPane"><span class="x42"><span 
> class="x43"><!--Start: 
> org.apache.myfaces.trinidad.Command["_idJsp4"]--><a 
> id="_idJsp3:_idJsp4" name="_idJsp3:_idJsp4" href="#" 
> onclick="submitForm('_idJsp1',0,{source:'_idJsp3:_idJsp4'});return 
> false;">Return to Index</a></span></span></div></td>
>             </tr><!--Start: 
> org.apache.myfaces.trinidad.Panel["_idJsp2"]--><tr>
>               <td class="x5x" align="center"></td>
>             </tr><!--Start: 
> org.apache.myfaces.trinidad.Panel["_idJsp2"]--><tr>
>               <td class="x5y" align="center"></td>
>             </tr><!--Start: 
> org.apache.myfaces.trinidad.Panel["_idJsp2"]--><tr>
>               <td class="x5z" align="center"></td>
>             </tr></table>
>    <input type="hidden" name="org.apache.myfaces.trinidad.faces.FORM" 
> value="_idJsp1">
>    <input type="hidden" name="org.apache.myfaces.trinidad.faces.STATE" 
> value="!400864fa">
>    <input type="hidden" name="source" value="a">
>    <input type="hidden" name="event" value="a">
>  </form>
>   </body>
>   <!--Created by Apache Trinidad (Apache MyFaces Trinidad API - 
> 1.0.10/Apache MyFaces Trinidad Impl - 1.0.10), skin:minimal.pda--></html>
> -----------------------------------------------------------------------------------------------------
> On Wed, Sep 30, 2009 at 15:38, Mamallan Uthaman 
> <mamallan.uthaman@oracle.com <ma...@oracle.com>> wrote:
>
>     Hi Francisco,
>
>     The best way to best detect whether JavaScript is being used or
>     not is to intercepting your HTTP response using web-debugger like
>     fiddler. You can download it from the link below:
>     http://www.fiddler2.com/fiddler2/
>
>     In your case, I believe it could have happened that though
>     Trinidad doesn't use JavaScript, some components might still use
>     some redundant JavaScript calls - could be a minor bug.
>
>     Could you please tell me the version of Trinidad jars you are using?
>
>     Also, Please find my answers for your questions inline.
>
>     Thanks
>     Mamallan
>
>
>     Francisco Mardones wrote:
>>     Hi,
>>
>>     I'm facing problems to post forms in Basic XHTML browsers (modern
>>     blackberries and desktop browsers work fine).
>>
>>     I noticed form submission invokes a javascript function, even
>>     though according the docs I should NOT get any javascript:
>>
>>     -----------start snippet-----------------
>>     "...it supports mobile browsers that support Basic XHTML or XHTML
>>     Mobile Profile. WAP 2.0 phone browsers are included in this
>>     category. Because of the hardware performance limitation,
>>     Trinidad does not download or use JavaScript library on such
>>     devices.
>>
>>     The following list shows the examples of Basic XHTML mobile
>>     browsers.
>>
>>     (snip)
>>
>>         * RIM BlackBerry Browser 4.2 ~ 4.5"
>>
>>     -----------end snippet-----------------
>>
>>     I can see the generated code isn't xhtml, and also I see a lot of
>>     javascript (and particularly to submit the form, using "onclick"
>>     event), so I'm suspecting Trinidad is not detecting properly
>>     which browser is accessing. The User Agent for the mobile is
>>     "BlackBerry7100i/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
>>     VendorID/103"
>>
>>     My questions are:
>>     1) How I can debug which browser is detecting?
>     Use following EL:
>     #{requestContext.agent.agentName}
>     #{requestContext.agent.agentVersion}
>     #{requestContext.agent.platformName}
>
>>     2) Is there any way to enforce code generation to basic xhtml?
>     No, Trinidad has predefine rules which is not configurable.
>
>>     3) Can I extend and/or add a new 'renderer' profile in Trinidad?
>>     (notice my browser is 4.1, and the doc says at least support 4.2
>>     and above, so maybe is defaulting wrongly given mine is older...)
>>     (as you can imagine after long tests now I'm facing the "wild
>>     guessing" phase :P )
>>
>     No
>>     Many Thanks
>>     Francisco
>
>