cancel
Showing results for 
Search instead for 
Did you mean: 

simple bsp page problem

Former Member
0 Kudos

hi

I am trying to show the increament of a variable on bsp page by clicking a button. I am increamenting my variable in OnInputProcess() the code is :

<code>

data: in type I.

in = navigation->get_parameter( name = 'index').

in = in + 1.

navigation->set_parameter( name = 'index' value = in ).

</code>

I have defined 'index' as auto page attribute of type 'I'.

but I could not see the changed value of the valriable in browser on clicking the button.

can you please help me on this.

regards

Ashutosh

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member181879
Active Contributor
0 Kudos

<html><body><form>
 <% DATA: counter TYPE STRING.
    counter = request->get_form_field( 'counter' ) + 1. %>
 <input type="submit" name="counter" value="<%=counter%>">
</form></body></html>
Former Member
0 Kudos

Hi,

Pl. try this code. Make two pages and in first page code this in onInputprocessing.

data: in type I.

in = index + 1.

navigation->set_parameter( name = 'index' value = in ).

navigation->next_page( 'TOFIRSTPAGE' ).

The value that you get in the page described as destination in navigation request TOFIRSTPAGE will be changed.

regards.

vishwas arya.

thomasalexander_ritter
Active Contributor
0 Kudos

Hi,

I always use this coding to set and retrieve parameters.

<i>navigation->set_parameter( name = 'parameter name' value = XXXX ).

navigation->goto_page( 'Name of the page' )</i>

Reading a parameter

<i>Variable = request->get_form_field( 'parameter name' ). </i>

It seems you must use get_form_field( ) from the request object instead of get_parameter( ) from the navigation object. But I have never used the get_parameter( ) method before. Have you already debugged the application?

Former Member
0 Kudos

I think the problem might be in event handling of htmlb button. I am not sure , but can you tell me whether OnProcessInputting() will be exccutted even if I won't write any eventname on OnClick() method of htmlb button.

or I have to give event name and then use

<code>

event=CL_HTMLB_MANAGER=>get_event( runtime->server->request ).

then

IF event->name = 'button' AND event->event_type = 'click'.

......

.....

</code>

codes like this to trap that event.

thomasalexander_ritter
Active Contributor
0 Kudos

In my system (SP47) the button is disabled when you don't fill the onClick parameter. So yes you need to fill the parameter.

thomasalexander_ritter
Active Contributor
0 Kudos

I am not really familiar with flowlogic-pages (I always use MVC) so I created what you want to do in my system and it works. Check out the following code:

1) Your page (name test.htm) needs the page attribute <i>count</i>

2) OnRequest Method:

<i>count = request->get_form_field( 'count' ).

add 1 to count.</i>

3) OnInputProcessing Method:

<i>navigation->set_parameter( name = 'count' value = count ).

navigation->goto_page( 'test.htm' ).</i>

Have fun