cancel
Showing results for 
Search instead for 
Did you mean: 

BSP - radio buttons and range

Former Member
0 Kudos

Hello folks,

I got an issue about radio buttons:

I'm requested to add a date range in a radio button selection option.

<htmlb:radioButtonGroup id = "radiobuttongroup"

columnCount = "1"

disabled = "false"

mode = "LAYOUT_GROUPING"

selection = "<%= selected %>"

tooltip = "My RadioButton Group"

width = "500" >

<htmlb:radioButton id = "rad1"

key = "r1"

disabled = "false"

text = "Receipts (Date Range) "

checked = "true" />

<htmlb:radioButton id = "rad2"

key = "r2"

text = "Usages (Date Range)"

checked = "false" />

How do I handle this?

Thanks in advance.

Rewards to best answer will be given!

Ol Pom.

Accepted Solutions (0)

Answers (3)

Answers (3)

raja_thangamani
Active Contributor
0 Kudos

Here you go..

<b>In Layout:</b>


From:<htmlb:InputField id = "frm_date" 
                          name = "From Date"
	          type = "date"
                          value = "<%= YourVariable1 %>"/>

To:<htmlb:InputField id = "to_date" 
                          name = "To Date"
	          type = "date"
                          value = "<%= YourVariable2 %>"/>

To retain all the Form field value after the server enent, you need to call the below <b>method in onInput Processing</b>

* Page Attribure or Application class Attribute:
 
DATA: i_formfields   TYPE TIHTTPNVP.
 
* Determine HTTP request parameters
CALL METHOD request->get_form_fields
        CHANGING
          fields = i_formfields.
 
You will get the values of all the form fields in the variable "i_formfields".
 
Then for each inputfield which you have in the Layout, you need to read the i_formfields with the each element id:
 
For example: lets name your input field Id as "frm_date".
 
READ TABLE i_formfields INTO wa_formfields WITH KEY name = 'frm_date'.
      YouVariable1 = wa_formfields-value.

Hope this helps you...

Let me know if you need any more detail..

<b>*Reward each useful answer</b>

Raja T

raja_thangamani
Active Contributor
0 Kudos

adding more on Eddys response:

As eddy mentioned, you can handle it Oninputprocess.

Just provide the one date Range (From & To). Disable the date field till user selectes the Radio button.

Once user selects the Radio button enable the Datefields...

Based on Radiobutton selection, consider the date as "Receipt date rnage" or "Ussage Date range".

Hope this is clear....If not explain to us about ur issue..

<i>*Reward each useful answer</i>

Raja T

Former Member
0 Kudos

Hello folks, thanks for the responses...However...

I'm not really sure how to implement that logic in my piece of code given above.

Any suggestions?

eddy_declercq
Active Contributor
raja_thangamani
Active Contributor
0 Kudos

If your issue is resolved Reward & close the thread..

Raja T

eddy_declercq
Active Contributor
0 Kudos

Hi,

What about adding two dates in the way described in

Since it's a readio button you need to ask for the 2 dates only once and handle them in the oninputprocessing

Eddy

-


PS. Reward useful answers and earn points yourself