Sorry it's taken so long to get back to you -- I'm very far behind on my email.

It sounds like you've created a custom component.

The main cause of a custom component working the first request, and
then having all values reset to null on further requests is forgetting
to implement StateHolder (or alternatively, Serializable).

Thus, when your component is restored on decode, the component values
are all cleared.   This sounds like what is happening in your
situation.


On 2/11/06, Ali Raza <[EMAIL PROTECTED]> wrote:
> Greetings again Mike,
>
>  I figured out what was causing the problem but still cant fix it.
>
>  I encode a couple o components in my encode begin method and i set their
> respective client Ids in class level ( component class level ) variables.
>  the correct vlue i.e the client id is set in the encode begin method.
>  but when the form is submitted and decode method is called all the members
> that were set in the encode method are now null for no apparent reason ...
> as ridiculous as this may sound ( coz the values set are class level
> variables and should not be changed unless explicitly done by me :p), its
> true.
>  so now im completely stumped and would really appreciate your help.
>
>  Thanx
>  Ali
>
>
> On 2/11/06, Ali Raza <[EMAIL PROTECTED]> wrote:
> > Thanx Martin,
> >
> > my rendered page code is as follows:
> > The current problem happens only when i encode submit type
> HtmlCommandButton to submit the form... and not when i encode buttpon
> type...
> >
> > thanx for your help
> > Ali
> >
> >
> > <html>
> > <head>
> > <script language="javascript"
> src="jscalendar/popcalendar.js"></script>
> > <script language="javascript"
> src="scripts/JSUtils.js"></script>
> >
> > <link rel="stylesheet" type="text/css"
> >     href="jscalendar/jscalendar-DB/theme.css" />
> > <link rel="stylesheet" type="text/css"
> >     href="jscalendar/jscalendar-WH/theme.css" />
> >
> > <style>
> > .header
> > {
> >     color: blue
> > }
> >       .boldLabel
> >         {
> >             font-weight: bold;
> >         }
> >         .rowEven
> >         {
> >             color: silver;
> >         }
> >         .rowOdd
> >         {
> >             color: grey;
> >         }
> >         .error
> >         {
> >             color: red;
> >         }
> > </style>
> > </head>
> >
> > <body>
> >
> > <form id="_id0" name="_id0" method="post"
> >
> action="/dmts/pages/testDeletePage.jsf;jsessionid=8B19832903C94EA03109122645412E29"
> >
> enctype="application/x-www-form-urlencoded"><iac:listenerBean
> >     beanName="saveTMBean" /> <!--Start Of Component-->
> > <table border="1">
> >     <tbody>
> >         <tr>
> >             <td></td>
> >         </tr>
> >         <tr>
> >             <td></td>
> >         </tr>
> >         <tr>
> >             <td></td>
> >         </tr>
> >         <tr>
> >             <td><input type="hidden"
> id="_id0:TMcommentInputHiddenId"
> >                 name="_id0:TMcommentInputHiddenId"
> value="" /></td>
> >         </tr>
> >         <tr>
> >             <td>Comments: <input id="_id0:TMcommentFieldId"
> >                 name="_id0:TMcommentFieldId" type="text" value="" /><input
> >                 id="_id0:TMjscriptButtonId" name="_id0:TMjscriptButtonId"
> >                 type="button" value="&lt;&lt;"
> >
> onclick="javascript:setTMCommentText('_id0:TMexistingCommentsId','_id0:TMcommentFieldId');clear__5Fid0();document.forms['_id0'].elements['autoScroll'].value=getScrolling();"
> /><select
> >                 id="_id0:TMexistingCommentsId"
> name="_id0:TMexistingCommentsId"
> >                 size="1">
> >                 <option
> value="Comment1">Comment1</option>
> >                 <option
> value="Comment2">Comment2</option>
> >                 <option
> value="Comment3">Comment3</option>
> >                 <option
> value="Comment4">Comment4</option>
> >             </select></td>
> >         </tr>
> >         <tr>
> >             <td>Sections: <select id="_id0:TMsectionMenuId"
> >                 name="_id0:TMsectionMenuId" size="1">
> >                 <option
> value="Section1">Section1</option>
> >                 <option
> value="Section2">Section2</option>
> >                 <option
> value="Section3">Section3</option>
> >                 <option
> value="Section4">Section4</option>
> >             </select></td>
> >         </tr>
> >         <tr>
> >             <td>Mark To: <select id="_id0:TMmarkToMenuId"
> >                 name="_id0:TMmarkToMenuId" size="1">
> >                 <option value="Mark To1">Mark To1</option>
> >                 <option value="Mark To2">Mark To2</option>
> >                 <option value="Mark To3">Mark To3</option>
> >                 <option value="Mark To4">Mark To4</option>
> >             </select></td>
> >         </tr>
> >         <tr>
> >             <td>Action Date: <input id="_id0:TMaddCommentButtonId"
> >                 name="_id0:TMaddCommentButtonId"
> type="submit" value="AddComment"
> >
> onclick="clear__5Fid0();document.forms['_id0'].elements['autoScroll'].value=getScrolling();"
> /></td>
> >         </tr>
> >         <tr>
> >             <td>
> >             <table id="_id0:CommentsPanelGridId" border="1">
> >                 <tbody>
> >                     <tr>
> >                         <td>XCommentSectionMark ToAction DateType</td>
> >                     </tr>
> >                     <tr>
> >                         <td><input id="_id0:_id50" name="_id0:_id50"
> type="image"
> >
> src="images/delete.jpg;jsessionid=8B19832903C94EA03109122645412E29"
> >
> onclick="javascript:setCommentId('TMdeleteImageId_0','TMcommentInputHiddenId');clear__5Fid0();document.forms['_id0'].elements['autoScroll'].value=getScrolling();"
> />Comment1Comment1Comment111
> >                         Feb 2006</td>
> >                     </tr>
> >                     <tr>
> >                         <td><input id="_id0:_id61" name="_id0:_id61"
> type="image"
> >
> src="images/delete.jpg;jsessionid=8B19832903C94EA03109122645412E29"
> >
> onclick="javascript:setCommentId('TMdeleteImageId_1','TMcommentInputHiddenId');clear__5Fid0();document.forms['_id0'].elements['autoScroll'].value=getScrolling();"
> />Comment1Comment1Comment111
> >                         Feb 2006</td>
> >                     </tr>
> >                     <tr>
> >                         <td><input id="_id0:_id72" name="_id0:_id72"
> type="image"
> >
> src="images/delete.jpg;jsessionid=8B19832903C94EA03109122645412E29"
> >
> onclick="javascript:setCommentId('TMdeleteImageId_2','TMcommentInputHiddenId');clear__5Fid0();document.forms['_id0'].elements['autoScroll'].value=getScrolling();"
> />Comment1Comment1Comment111
> >                         Feb 2006</td>
> >                     </tr>
> >                     <tr>
> >                         <td><input id="_id0:_id83" name="_id0:_id83"
> type="image"
> >
> src="images/delete.jpg;jsessionid=8B19832903C94EA03109122645412E29"
> >
> onclick="javascript:setCommentId('TMdeleteImageId_3','TMcommentInputHiddenId');clear__5Fid0();document.forms['_id0'].elements['autoScroll'].value=getScrolling();"
> />Comment1Comment1Comment111
> >                         Feb 2006</td>
> >                     </tr>
> >                 </tbody>
> >             </table>
> >             </td>
> >         </tr>
> >         <tr>
> >             <td><input id="_id0:TMsaveCommentButtonId"
> >                 name="_id0:TMsaveCommentButtonId"
> type="submit"
> >                 value="Save Comments"
> >
> onclick="clear__5Fid0();document.forms['_id0'].elements['autoScroll'].value=getScrolling();"
> /></td>
> >         </tr>
> >     </tbody>
> > </table>
> > <input type="hidden" name="_id0_SUBMIT" value="1" /><input
> >     type="hidden" name="autoScroll" /><input type="hidden"
> >     name="_id0:_link_hidden_" /><script type="text/javascript"><!--
> > function clear__5Fid0() {
> >   var f = document.forms['_id0'];
> >   f.elements['_id0:_link_hidden_'].value='';
> >   f.target='';
> > }
> > clear__5Fid0();
> > //--></script></form>
> > <script type="text/javascript"><!--
> > function getScrolling() {
> >     var x = 0; var y = 0;
> >     if (self.pageXOffset ) {
> >         x = self.pageXOffset;
> >         y = self.pageYOffset;
> >     } else if (document.documentElement &&
> document.documentElement.scrollLeft) {
> >         x = document.documentElement.scrollLeft;
> >         y = document.documentElement.scrollTop;
> >     } else if (document.body) {
> >         x = document.body.scrollLeft;
> >         y = document.body.scrollTop;
> >     }
> >     return x + "," + y;
> > }
> >
> > //--></script>
> >
> > </body>
> > </html>
> >
> >
> >
> >
> >
> >
> > On 2/10/06, Mike Kienenberger < [EMAIL PROTECTED]> wrote:
> > > Can you post your page code?   The rendered html is typical for a
> > > command-button.   It's exactly what you should see.   The html doesn't
> > > control what page is displayed next, so it's not really relevent.
> > > That's controlled by the name of the button, the current component
> > > tree state, and your navigation rules.
> > >
> > > On 2/10/06, Ali Raza < [EMAIL PROTECTED]> wrote:
> > > > Greetings,
> > > >
> > > > I am trying to add an object of HtmlCommandButton to my parent
> component as
> > > > a submit type button. but for some reason when the button is encoded
> the
> > > > onclick attribute is also encoded hence instead of the form being
> submit i
> > > > get redirected to my index page ... any idea why ???
> > > >
> > > > this is what gets encoded:
> > > >  <input id="_id0:TMaddCommentButtonId"
> > > > name="_id0:TMaddCommentButtonId" type="submit"
> > > > value="AddComment"
> > > >
> onclick="clear__5Fid0();document.forms['_id0'].elements['autoScroll'].value=getScrolling();"
> > > >
> > > >
> > > > thanx for your time,
> > > > Ali
> > > >
> > > > --
> > > > "A sixteenth century inventor called Wan Hu designed a
> rocket-propelled
> > > > chair on which he planned to ascend into heaven. He built an open
> cabin, to
> > > > which he fitted 47 rockets underneath and above, and two kites to keep
> him
> > > > aloft. Wan Hu disappeared in flame and smoke and was never seen again.
> A
> > > > crater on the moon is now named after him, so in one sense he made it
> to the
> > > > heavens after all. This is the first recorded design of something
> > > > approximating to a manned space rocket."
> > > >
> > > > The Chinese Space Programme.
> > > > From Conception to Future Capabilities.
> > > > Brian Harvey
> > >
> >
> >
> >
> > --
> >
> > "A sixteenth century inventor called Wan Hu designed a rocket-propelled
> chair on which he planned to ascend into heaven. He built an open cabin, to
> which he fitted 47 rockets underneath and above, and two kites to keep him
> aloft. Wan Hu disappeared in flame and smoke and was never seen again. A
> crater on the moon is now named after him, so in one sense he made it to the
> heavens after all. This is the first recorded design of something
> approximating to a manned space rocket."
> >
> > The Chinese Space Programme.
> > From Conception to Future Capabilities.
> > Brian Harvey
>
>
>
> --
>
> "A sixteenth century inventor called Wan Hu designed a rocket-propelled
> chair on which he planned to ascend into heaven. He built an open cabin, to
> which he fitted 47 rockets underneath and above, and two kites to keep him
> aloft. Wan Hu disappeared in flame and smoke and was never seen again. A
> crater on the moon is now named after him, so in one sense he made it to the
> heavens after all. This is the first recorded design of something
> approximating to a manned space rocket."
>
> The Chinese Space Programme.
> From Conception to Future Capabilities.
> Brian Harvey

Reply via email to