cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with navigation->set parameter

Former Member
0 Kudos

Hello!

It's me again with a second problem. I habe problem with a handing over of data. Maybe it's the best, if I post the code and then try to explain the problem:

Layout (only a part of it)


<tr>
<td class="bspTbvHdrAlt">Customer Nr<td>
<td class="bspTbvCellAlt">


<%
  page->write( cnr ).
%>

</td>
</tr>
<tr>
<td class="bspTbvHdrAlt">First Name</td>
<td class="bspTbvCellAlt">
<%
  page->write( cfname ).
%>
</td>
</tr>
<tr>
<td class="bspTbvHdrAlt">Lastname</td>
<td class="bspTbvCellAlt">
<%
  page->write( cname ).
%>
</td>
</tr>


</table>
</form>


<table>

<tr>
<p class="bspH2">

<td>
<form method="post" action="">
<input class="submit" type="submit" name="OnInputProcessing(nextpg)" value="Next page to continue">
</td>
</tr>
</form>

</table>

OnInitialization

SELECT CUNOMAX INTO CNUMBER FROM ZMGKDMAX.

ENDSELECT.


CNUMBER = CNUMBER + 1.
cnr = CNUMBER.

OnInputProcessing

CASE event_id.
When 'nextpg'.
 NAVIGATION->SET_PARAMETER( 'cnr' ).
 navigation->goto_page('page3.htm').
ENDCASE.

CNR is a counting number. The problem with cnr is, that there is no value on OnInutProcessing. But there is a value for cnr at OnInitialization and at the layout.

For example, cnr has a value of '123'. If I start the application I can read this number on the screen (and also if I use the debugger). But at that moment when I go to OnInputProcessing cnr has no value.

Do you have an idea what the problem may be?

(Sorry for my english! But I hope you understand the problem. If not, ask me and I try to explain again).

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks again, Ravikiran!

First my problem was, that the value of 'cnr' was not submited to OnInputProcessing while it was possible with every other attribute like f.e. 'cname' or 'cfname'.

Then I inserted the your code line (runtime->keep_context = 1.) to make it stateful (I didn't find an option for stateless/statefull in the preferences of the page!!! WAS 6.20) and I can see the value at OnInputProcessing of 'cnr' if I use the debugger.

But now there is the problem that I am not sure if the value is really submited to page3.htm. Because I can't read 'cnr' in this page

Page attributes for cnr are in both pages the same (cnr type string).

athavanraja
Active Contributor
0 Kudos

use

NAVIGATION->SET_PARAMETER( name ='cnr'

value = cnr ).

you can set whole application to stateful from the BSP application properties.

Regards

Raja

Former Member
0 Kudos

Thank you very much!!! Now it's working

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Michael,

You need to make your application stateful to retain the value of an attribute from OnInitialization event. You can make your application stateful by checking stateful from the properties tab or using this code:

runtime->keep_context = 1.

Hope this helps,

Regards,

Ravikiran.

Former Member
0 Kudos

Thank you very much! You're right! Now it's working

But I still don't understand why it was possible to use other attributes like 'cname' or 'cfname'. The mistake was only when I used the attribute 'cnr'.

Former Member
0 Kudos

Hi Michael,

But pls be sure what are the consequences when you make your application stateful. Go through this thread for your information:

And more thing, where are these parameters cname and cfname are initialized. Unless the page is stateful, the values of the attributes cannot be retained after successive requests. To remove the confusions between stateful and statelss mode you can refer to this link:

/people/mark.finnern/blog/2003/09/24/bsp-in-depth-confusion-between-stateless-stateful-and-authentication

Hope this helps you.

Regards,

Ravikiran.