on 08-12-2004 9:29 AM
Hi @all,
can somebody help me?
My Problem is the following:
On my BSP I have a group of two radiobutton (Yes and No).
In the layout the 'checked' button is depending of one field.
This field is filled in the Eventhandler 'OnInputProcessing'.
Two of my test-codings:
Layout-Coding
1. test:
<%
if zomopportline-zmynrisk eq YES.
%>
<htmlb:radioButtonGroup id = "zmynrisk"
columnCount = "2"
width = "90" >
<htmlb:radioButton id = "riskno"
text = "Risk No">
</htmlb:radioButton>
<htmlb:radioButton id = "riskyes"
text = "Risk Yes"
checked = "TRUE" >
</htmlb:radioButton>
</htmlb:radioButtonGroup>
<%
else.
%>
<htmlb:radioButtonGroup id = "zmynrisk"
columnCount = "2"
width = "90" >
<htmlb:radioButton id = "riskno"
text = "Risk No"
checked = "TRUE" >
</htmlb:radioButton>
<htmlb:radioButton id = "riskyes"
text = "Risk Yes" >
</htmlb:radioButton>
</htmlb:radioButtonGroup>
<%
endif.
%>
2. test:
<%
if zomopportline-zmynrisk eq YES.
%>
<htmlb:radioButtonGroup id = "zmynrisk"
columnCount = "2"
width = "90" >
<htmlb:radioButton id = "riskno"
text = "Risk No"
checked = "" >
</htmlb:radioButton>
<htmlb:radioButton id = "riskyes"
text = "Risk Yes"
checked = TRUE >
</htmlb:radioButton>
</htmlb:radioButtonGroup>
<%
else.
%>
<htmlb:radioButtonGroup id = "zmynrisk"
columnCount = "2"
width = "90" >
<htmlb:radioButton id = "riskno"
text = "Risk No"
checked = "TRUE" >
</htmlb:radioButton>
<htmlb:radioButton id = "riskyes"
text = "Risk Yes"
checked = >
</htmlb:radioButton>
</htmlb:radioButtonGroup>
<%
endif.
%>
By the first processing of the BSP, the marked radiobutton is 'NO'. That is correct.
After the processing of the Eventhandler 'OnInputProcessing' the same BSP is called again. Now the marked radiobutton is 'NO' and 'YES'.
Correct is just 'YES'.
Does anybody know about this problem.
Thanks for any advice or path for more information.
Kind Regards
Petra
<htmlb:radioButtonGroup id = "zmynrisk"
columnCount = "2"
width = "90" >
<htmlb:radioButton id = "riskno"
text = "Risk No"
checked = "TRUE" >
</htmlb:radioButton>
<htmlb:radioButton id = "riskyes"
text = "Risk Yes"
checked = >
</htmlb:radioButton>
</htmlb:radioButtonGroup>
Just for starters you should be saying checked = "FALSE" > you can't leave it as blank or you get a compile error.
However I would suggest you check out the BSP Application "SBSPEXT_HTMLB" under SE80 and look at the example page "RadioButtonGroup.bsp" it's a great example and I think after a little bit of looking you'll see the way to solve your problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Craig,
thanks for your info.
One of my other test was:
<%
if zomopportline-zmynrisk eq YES.
%>
<htmlb:radioButtonGroup id = "zmynrisk"
columnCount = "2"
width = "90" >
<htmlb:radioButton id = "riskno"
text = "Risk No"
checked = "FALSE" >
</htmlb:radioButton>
<htmlb:radioButton id = "riskyes"
text = "Risk Yes"
checked = TRUE >
</htmlb:radioButton>
</htmlb:radioButtonGroup>
<%
else.
%>
<htmlb:radioButtonGroup id = "zmynrisk"
columnCount = "2"
width = "90" >
<htmlb:radioButton id = "riskno"
text = "Risk No"
checked = "TRUE" >
</htmlb:radioButton>
<htmlb:radioButton id = "riskyes"
text = "Risk Yes"
checked = FALSE>
</htmlb:radioButton>
</htmlb:radioButtonGroup>
<%
endif.
%>
And this test also got the same problem.
Kinds regards,
Petra
From that example I mentioned:
<u><b>BSP Page Attribute:</b></u>
myRisk TYPE STRING
<u><b>BSP Page Layout:</b></u>
<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>
<htmlb:content design="design2003">
<htmlb:page title = " ">
<htmlb:form>
<htmlb:radioButtonGroup id = "zmynrisk"
columnCount = "2"
width = "90"
selection = "<%= myRisk %>" >
<htmlb:radioButton id = "riskno"
text = "Risk No"
onClick ="radioButton" />
<htmlb:radioButton id = "riskyes"
text = "Risk Yes"
onClick ="radioButton" />
</htmlb:radioButtonGroup>
</htmlb:form>
</htmlb:page>
</htmlb:content>
<u><b>BSP Event OnInputProcessing:</b></u>
* event handler for checking and processing user input and
* for defining navigation
DATA: rbg TYPE REF TO CL_HTMLB_RADIOBUTTONGROUP.
rbg ?= CL_HTMLB_MANAGER=>GET_DATA(
request = request
id = 'zmynrisk'
name = 'radioButtonGroup' ).
IF rbg IS NOT INITIAL.
myRisk = rbg->selection.
ELSE.
myRisk = ''.
ENDIF.
You should really take a look at that example as it will open up a whole lot of options for you.
Another question for you.
<%
if zomopportline-zmynrisk eq YES.
%>
Where's that coming from a DB field? Are you displaying a table of records? If so you shuld check these links out for how to use the tableView and a Iterator will make the handling of the checkbox and the general output so much easier.
<a href="https://answers.sap.com/people/brian.mckellar/blog/2004/06/11/bsp-trouble-shooting-getting-help">BSP Trouble Shooting: Getting Help</a>
<a href="https://answers.sap.com/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator">BSP Programming: HTMLB TableView Iterator</a>
PS. for future reference when you want to show code you can use the command code goes here ... without the underline
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.