Cfdiv refreshes binding to radio buttons
Hi,
Fairly simple issue that I can't find much information about
through google (just one report of it involving a workaround for a
cfgrid rather than a cfdiv).
I have a cfdiv that is bound to a cfselect and two radio
buttons, ala:
<cfdiv
bind="url:schedule-snippet.cfm?selectAll={selectAll}&orderBy={orderBy}&startDate={startDa te}"
id="schedule">
selectAll and orderBy are both radio buttons, each of which
has two states. startDate is a cfselect.
The problem is that the cfdiv does not auto-refresh based on
whichever radio button I pass in second -- e.g. in the example
above, it will refresh based on the selectAll radio button but not
the orderBy radio button. If I bind it this way:
<cfdiv
bind="url:schedule-snippet.cfm?orderBy={orderBy}&selectAll={selectAll}&startDate={startDa te}"
id="schedule">
Then it will refresh from the orderBy but not the selectAll.
Even more interesting is that, if I put the cfselect
(startDate) AFTER the second radio button in the bind list (as
above) then it won't refresh from that, either. It just sort of
'stops' auto-refreshing once you put in a radio button value. with
anything after that value in the list.
Any ideas?
Thanks,
Sam
this is strange and must be a bug... i have reproduced your
situation
exactly.
i have ran all sorts of tests, and always the second radio
set does not
trigger cfdiv refresh.
setting the first bind param in your cfdiv to your cfselect
will make
the div refresh on change in the cfselect and the first
binded radio
group, but not the second one.
same with checkboxes instead of radio buttons - the second
binded set of
checkboxes never triggers the cfdiv refresh.
having cfdiv bind to 3 selects instead of 1 select and 2
radio/checkbox
groups works fine - cfdiv refreshes on change in any of the
selects.
furthermore, adding another cfselect and binding cfdiv to
that as well
(so 4 controls cfdiv is binded to now) starts throwing js
errors in
ajax.js file... but also makes everything work after you
ignore the
error (cfdiv refreshes on change in any of the 4 controls).
definitely a bug - you may want to submit it to adobe.
one work-around may be to cal a js function from the second
radio
group's onclick event which will get surrent values of the 3
controls
and use ColdFusion.navigate to refresh the cfdiv...
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Similar Messages
-
Global binding for radio buttons needs tweaking
When selecting global binding for a text or numeric field, its corresponding field with the same name also changes to global binding.
However when doing this for radio button exclusion groups, the other radio button groups don't automatically change to global. You have to do it manually.Found the problem in another topic:
scott sheck - 1:30am Jun 29, 07 PST (#6 of 7)
A pasted radio button is automatically added to an existing exclusion group if the last added item was a radio button. This is in the help.
I wish there was a default to turn this off because I don't want to add a temporary item just to get a new exclusion group. -
How do you bind a radio button to a row in a table
Im developing a web page that does a search given certain criteria. It displays the results in a table and dynamically allocates a radio button for each row that is created.
I then want to be able to select the radio() button and display the row that was selected by the radio button on another page.
Im doing a project in college developing a online airline ticket booking system. The user searches for flights and is displayed back with the Outgoing flights and the return flights. Each flight that is displayed is given a radio button. The problem is that I want to let the user select the a radio button that corresponds with their choice of flight and display this flight on the next page.
Can anyone help me please with some code or ideas on how to go about doing it
Thanks very much NickyI suppose you do something like this:
<sql:query var="var" scope="request">
SELECT * FROM table
WHERE something = ?
<sql:param value="${param.something}" />
Right??
When you start the page, add:
<%@ page language="java" %>
Then under that
<% int i = 0; %>
Then:
<html>
<body>
<form action="your_action" method="post">
<table>
<c:forEach items="${var.rows}" var="v">
<% i++; %>
<tr>
<td>
<input type="radio" name="yourname<%= i %>" value="yourvalue">
</td>
</tr>
</c:forEach>
<tr>
<td>
<input type="Hidden" name="i" value="<%= i %>">
<input type="Submit value="next page">
etc. etc.
Follow me so far? -
Collection binding to radio button: No command button action
Hi,
I bound a List collection to radio buttons as below.
<h:selectOneRadio disabledClass="selectOneRadio_Disabled"
styleClass="selectOneRadio" id="radio1" layout="pageDirection" value="#{param.selectedChoideId}">
<f:selectItems value="#{PollBean.choices}" />
</h:selectOneRadio>
I also added a command button to send the value of selected radio item. The item labels and values are displayed properly on run time.
But when the button is clicked, the JSF lifecycle is started but the execution thread cannot enter phase 4 called "Update Model Value" after phase 3 "Process Validations" and directly jump to phase 6 called "Render Response". By this way, navigation rule is not applied and the execution gets back to the starting page.
Is there anyone have encountered this problem ever before ? What can cause this problem ?
Regards.
UmutRRIt might be a typical problem of SelectOne/Many.
Check the types of param.selectedChoideld and PollBean.choices.
My post will help you:
http://forum.java.sun.com/thread.jspa?threadID=604798 -
Hi All,
I am a vb beginner and I was wondering how you bind a radio button to a field in a database that has choice of 2 values. For example the field in my db is CoverType and the user should be able to select Hardcover or Paperback.
Don't seem to be able to do get radio buttons to represent this on my form.
Thanks very muchHi Colin,
I'm having the same trouble, and although I work in 'Classic' HTML & Vb this might be useful for you.
I found that with Radio Buttons, you can bind each one in a group to the same DataSrc & DataFld. Since all the Radios have the same Name and ID they switch between as usual, however, each radio has a different Value which is updated into the XML.
<xml ID=ERRI>
<ROOT>
<RATE>
<RATE1></RATE1>
</RATE>
</ROOT>
</xml>
<Table DataSrc=#ERRI DataFld=RATE>
<tr><Td colspan=5><b>Rate This</b></td></tr>
<Tr><Td><Input DataSrc=#ERRI DataFld=RATE.RATE1 Value="1" Type=Radio id=Radio1 name=Radio1></Td><td>1</td></Tr>
<Tr><Td><Input DataSrc=#ERRI DataFld=RATE.RATE1 Value="2" Type=Radio id=Radio1 name=Radio1></Td><td>2</td></Tr>
<Tr><Td><Input DataSrc=#ERRI DataFld=RATE.RATE1 Value="3" Type=Radio id=Radio1 name=Radio1></Td><td>3</td></Tr>
<Tr><Td><Input DataSrc=#ERRI DataFld=RATE.RATE1 Value="4" Type=Radio id=Radio1 name=Radio1></Td><td>4</td></Tr>
</Table> -
Flash 8 UI Component: Radio Button
Hi:
May someone kindly guide me how to bind a radio button to a
text area? Perhaps without using action script.
What's the trick of binding the Radio Button in Flash 8 as
the attempt to bing ComboBox or some other UI components has no
problem at all; but only the Radion Button.
Thanks!Thanks for the response.
After i posted I kept digging and found where the code is
that sets the font for the Radio buttons in the quizzes when you do
an export to flash. What I found out is listed below in case anyone
else ever needs the information- hopefully it will save someone
else some time.
The ".as" file is --
C:\Documents and Settings\YOUR NAME HERE\Local
Settings\Application Data\Macromedia\Flash
8\en\Configuration\Classes\AdobeCaptivate\quiz\CpMultipleChoice.as
Strating at line 106 there is the following code
p._font.name = "Arial";
p._font.size = 12;
p._name = "" + numAnswers;
I was then able to make the font size larger to match the
other text on the screen (i do have to say it's rather annoying
that those attributes don't get exported from the captivate file,
because i set the font properties before exporting - but i guess
there is probably a reason for that) -
Reset Button is Not Working For Radio Buttons In Expand to fit Forms
Dear All,
I have a dynamic form in which text fields height is set to expand to fit.The functionality of the reset button is working fine if none of the field expand during filling the form but during filling the form if any fields height expands and then we want to reset the form, all fields are getting refreshed but the radio buttons are not getting refreshed.
I have also tried by writing script on the click event of the reset button to make the rawvalue of the radio buttons as null.Even though it is not working.
I am usuing Reader 7.0 to open the form.Is there anything wrong in this reader version or is there any other problem?
If any body can please help me.
Thanks a lot in advance
Regards
RakeshCheck on the Property Palette of the radio_group the Navigation->Keyboard Navigate atribute.It must be Yes.
-
Based on the examples
here
and
here
I have a datagrid which uses an XML object as its dataprovider. The
xml goes like this:
<questions>
<question>
<prompt>What are your heroes?</prompt>
<answers>
<answer>
<correct>true</correct>
<text>Luther Higgs</text>
</answer>
<answer>
<correct>false</correct>
<text>Barney Fife</text>
</answer>
</answers>
</question>
</questions>
Well formed (if a bit confusing) xml. In my datagrid I have
two columns. The second column binds to
questions.question.answers.answer.text and works just fine. The
datagrid's editable property is set to true, and I'm able to click
on the second colum and type and it saves the answer back into the
xml object just fine. The problem lies in my first column. The mxml
looks like this:
<mx:DataGridColumn headerText="Correct">
<mx:itemRenderer>
<mx:Component>
<mx:VBox horizontalAlign="center">
<mx:RadioButton id="myRadioButton"
buttonMode="true" useHandCursor="true"
group="{outerDocument.myRadioButtonGroup}"
selected="{data.correct}"/>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
The problem is that the radio buttons' selected properties
aren't bound to the xml, that is the one that is true doesn't
display as selected. If I set the datagridcolumn's editable
property to false, clicking on the radio button doesn't affect the
xml at all either. If I leave the editable property of the
datagridcolumn as the inherited default of true (based on the
parent datagrid's editable property) when I click on the radio
button the default itemEditor appears (a text input box) which
contains the following text:
</answer>
and when I leave the editor (click outside or hit enter) the
xml then looks like this:
<answers>
<answer>
<correct>true</correct>
<text>Luther Higgs</text>
</answer>
<answer>
<correct>false</correct>
<text>Barney Fife</text>
<null><answer>
<correct>false</correct>
<text>Barney Fife</text>
</answer></null>
</answer>
</answers>
I have seen controls that don't have the xml path written
correctly display the entire xml node rather than just the
contained data, but I can think of no reason anything should Ever
reference just the closing tag. To me this looks like a bug in the
data bindings between the radio button and the xml object.
Just to clear the air to avoid suggestions that will work but
not meet the design requirements, what I need is a datagrid that
has a radio button group (only one correct answer out of the group)
in the first column and strings in the second column which need to
be editable. I suppose I could write some hairy event listener code
and manually hack things together, but aside from avoiding that
headache, I'd love to use data bindings for what they were intended
for - I just need to know why it doesn't appear to be working
right. Much thanks in advance for any and all help.Searching the LiveDocs revealed the answer. Under the topic
"Using an E4X expression in an <mx:Binding> tag" I found that
if instead of
<mx:RadioButton id="myRadioButton"
buttonMode="true" useHandCursor="true"
group="{outerDocument.myRadioButtonGroup}"
selected="{data.correct}"/>
I have
<mx:RadioButton id="myRadioButton"
buttonMode="true" useHandCursor="true"
group="{outerDocument.myRadioButtonGroup}"/>
<mx:Binding source="myRadioButton.selected"
destination="data.correct" />
It works just perfectly.
Apparently binding between XML and the selected property of a
radio button (which is of type boolean) needs the <mx:Binding
/> rather than the in-tag curly brace notation.
P.S. The link on livedocs is here:
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=databinding_091_05.html#177459 -
Radio Buttons, Global Binding, and Change Event
I have a pair of radio button groups with the same name that I have set to Global binding. The radio buttons in these radio button groups have script in the change event. The problem is, when I click on a button in one group, it doesn't fire the change event in the other one, even though the corresponding button changes. I can work around this, but I'm curious why this doesn't work.
ocen12 is correct - the change event will only fire when a user clicks on the radiobutton. It will not fire when a script changes the value. I tried it here and found that the radio buttons on both groups act like they are under the same exclusion group. Do you see the same thing? If I select a value in the second exclusion group any value I had in the 1st one is gone.
Paul -
Is "AutoPostback" property valid for Radio button control in RCDC
Hi,
I have been trying to add "Autopostback" property to a radio button control, but it doesnt seem to be working.
Below is the code:
<my:Control
my:Name="Activation"
my:TypeName="UocSimpleRadioButton"
my:Caption="{Binding
Source=schema, Path=ADActivation.DisplayName}"
my:Description="{Binding
Source=schema, Path=ADActivation.Description}"
my:AutoPostback="true"
my:RightsLevel="{Binding
Source=rights, Path=ADActivation}">
<my:Properties>
<my:Property
my:Name="TrueText"
my:Value="ADActive"/>
<my:Property
my:Name="FalseText"
my:Value="NotActive"/><my:Property
my:Name="SelectedItem"
my:Value="{Binding
Source=object, Path=ADActivation, Mode=TwoWay}" /></my:Properties></my:Control>
DollyDolly,
What do you expect the AutoPostback property to do?
AutoPostback: This is an optional,
Boolean-type attribute. The default value is false.
If set to false, refreshing
the page may not refresh the control. For information about AutoPostback,
look for the Microsoft ASP.NET UI control property of the same name. -- FIM RCDC Reference
According to MSDN:
Set this property to true if the server needs to capture the selection as soon as it is made. For example, other controls on the Web page can be automatically filled depending on the user's selection from a list
control.
This property can be used to allow automatic population of other controls on the Web page based on a user's selection from a list.
Blain Checkley illustrates its use with his blog post: http://identityminded.wordpress.com/2011/10/14/fim2010-semi-dynamic-rcdc-operations/
David Lundell, Get your copy of FIM Best Practices Volume 1 http://blog.ilmbestpractices.com/2010/08/book-is-here-fim-best-practices-volume.html -
What is the diffrence between "Key to Select" and "Selected Key" while creating Radio Buttons?
While creating radio buttons there is a confusion regarding two properties "Key to Select" and "Selected Key".Can anybody explain it with example?
Thanks,
VimalHi Vimal,
Please find my explanation as below
Key to Select: This is the unique key for each radio button to identify which one is selected
Selected Key: This holds the "KEY" of selected radio button
Example:
Let us say we have 2 radio buttons : Male & Female
Create a context attribute SELECTED_KEY of type STRING.
Create an action ON_SELECT for radio button select event
Now,
the properties for "MALE" radio button as below
KEY_TO_SELECT = 'M'
SELECTED_KEY = "bind to the context attribute SELECTED_KEY
OnSelect = 'ON_SELECT'.
The properties for 'Female" radio button as below
KEY_TO_SELECT = 'F'
SELECTED_KEY = "bind to the context attribute SELECTED_KEY
OnSelect = 'ON_SELECT'.
If we select radio button 'Male', we get the key as 'M' and for 'Female' radio button 'F'.
check inside the event handler method ONACTIONON_SELECT, you get the 'KEY' of selected radio button.
So, the context attribute 'SELECTED_KEY' gets filled with the key of selected radio button
Hope this helps you in distinguishing the 'KEY TO SELECT' & 'SELECTED KEY' .
Regards,
Rama -
Hi all,
I've adopted the script stated in HightlightOneRequiredField.pdf so that the print button in my form can detect and prevent null field before pop up the print dialog. It works fine.
In my form, I've created a mandatory 2-radio buttons group with click event script written, using ".presence", in each button. When user clicks:
Button A: make subform A visible and subform B invisible;
Button B: make subform A invisible and subform B visible.
Apart from the visibility of the subforms, what I want more is to add a .mandatory script (together with the click event) in the buttons to turn some fields' mandatory in the subforms on and off so that when user clicks:
Button A: will also turn some fields' value type in subform A to be "User
Entered-Required", whereas some of that in subform B to be "-
optional";
Button B: will turn the subform B's fields to "-Required" and subform A's
fields back to "-optional"
However no luck with me. When I press the print button after any of the radio buttons checked, the print dialog still show up even the subforms' fields are null as if those fields' value type always remain "-optional"
I wonder if this problem is caused by Chinese binding name ? The script written in the radio button B is:
FormA.presence = "invisible";
FormB.presence = "visible";
if (B1.mandatory = "disabled")
B1.mandatory = "error";
if (B2.mandatory = "disabled")
B2.mandatory = "error";
if (B3.mandatory = "disabled")
B3.mandatory = "error";
if (A1.mandatory = "error")
A1.mandatory = "disabled";
if (A2.mandatory = "error")
A2.mandatory = "disabled";
if (A3.mandatory = "error")
A3.mandatory = "disabled";
B1, B2 and B3 represent the Chinese fields' binding name in FormB
A1, A2 and A3 represent the Chinese fields' binding name in FormA
(The script in radio button A is reversed in this way.)
Have I done something wrong in the above (click event) javascript?
Please help.
Thanks in advance.
AlexHi all,
I've adopted the script stated in HightlightOneRequiredField.pdf so that the print button in my form can detect and prevent null field before pop up the print dialog. It works fine.
In my form, I've created a mandatory 2-radio buttons group with click event script written, using ".presence", in each button. When user clicks:
Button A: make subform A visible and subform B invisible;
Button B: make subform A invisible and subform B visible.
Apart from the visibility of the subforms, what I want more is to add a .mandatory script (together with the click event) in the buttons to turn some fields' mandatory in the subforms on and off so that when user clicks:
Button A: will also turn some fields' value type in subform A to be "User
Entered-Required", whereas some of that in subform B to be "-
optional";
Button B: will turn the subform B's fields to "-Required" and subform A's
fields back to "-optional"
However no luck with me. When I press the print button after any of the radio buttons checked, the print dialog still show up even the subforms' fields are null as if those fields' value type always remain "-optional"
I wonder if this problem is caused by Chinese binding name ? The script written in the radio button B is:
FormA.presence = "invisible";
FormB.presence = "visible";
if (B1.mandatory = "disabled")
B1.mandatory = "error";
if (B2.mandatory = "disabled")
B2.mandatory = "error";
if (B3.mandatory = "disabled")
B3.mandatory = "error";
if (A1.mandatory = "error")
A1.mandatory = "disabled";
if (A2.mandatory = "error")
A2.mandatory = "disabled";
if (A3.mandatory = "error")
A3.mandatory = "disabled";
B1, B2 and B3 represent the Chinese fields' binding name in FormB
A1, A2 and A3 represent the Chinese fields' binding name in FormA
(The script in radio button A is reversed in this way.)
Have I done something wrong in the above (click event) javascript?
Please help.
Thanks in advance.
Alex -
Hi experts,
I am using radio buttons in alv report by using screen painter but error occurs in alv that screen doesn't exist in module.
plz help me.Hi Ankita,
check this program.
*& Report ZALVGRID_WITH_RADIOBUTTONS
*& This program shows how to realize radiobuttons in ALV grid lists
*& using event HOTSPOT_CLICK.
*& Screen 100:
*& - Flow logic
*& PROCESS BEFORE OUTPUT.
*& MODULE PBO.
*& PROCESS AFTER INPUT.
*& MODULE PAI.
*& - Screen elements: none
*& - ok-code field -> gd_okcode
*& GUI Status MAIN100:
*& - F3 = 'BACK', Shift+F3 = 'EXIT', F12 = 'CANC'
PROGRAM zalvgrid_with_radiobuttons.
TYPE-POOLS: abap, icon. " INCLUDE . for releases < 6.20
TYPES: BEGIN OF ty_s_sflight.
INCLUDE TYPE sflight.
TYPES: button1 TYPE iconname.
TYPES: button2 TYPE iconname.
TYPES: button3 TYPE iconname.
TYPES: button4 TYPE iconname.
TYPES: END OF ty_s_sflight.
DATA:
gt_sflight TYPE STANDARD TABLE OF ty_s_sflight,
gs_layout TYPE lvc_s_layo,
gt_fcat TYPE lvc_t_fcat.
DATA:
gd_okcode TYPE ui_func,
go_docking TYPE REF TO cl_gui_docking_container,
go_grid TYPE REF TO cl_gui_alv_grid.
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING
e_row_id
e_column_id
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_hotspot_click.
define local data
FIELD-SYMBOLS:
IS ASSIGNED ).
Set all radio buttons "unselected"
IS ASSIGNED ).
Set selected radio button "selected".
= icon_wd_radio_button.
ENDIF.
Force PAI followed by refresh of table display in PBO
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'REFRESH'
IMPORTING
RC =
ENDMETHOD. "handle_hotspot_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
MAIN *
START-OF-SELECTION.
PERFORM select_data.
PERFORM init_controls.
PERFORM build_fieldcatalog.
PERFORM set_layout.
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
is_layout = gs_layout
CHANGING
it_fieldcatalog = gt_fcat
it_outtab = gt_sflight.
Link docking container to dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
CONTAINER =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
lifetime_dynpro_dynpro_link = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL SCREEN 100.
END-OF-SELECTION.
MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAIN100'.
ENDMODULE. "PBO OUTPUT
MODULE PAI INPUT *
MODULE pai INPUT.
Leave report
CASE gd_okcode.
WHEN 'BACK' OR
'EXIT' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
Refresh table display
WHEN 'REFRESH'.
PERFORM refresh_display.
WHEN OTHERS.
do nothing
ENDCASE.
CLEAR gd_okcode.
ENDMODULE. "PAI INPUT
*& Form BUILD_FIELDCATALOG
text
--> p1 text
<-- p2 text
FORM build_fieldcatalog .
ALV List with Radio Buttons
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 7
define local data
DATA:
ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'ICON'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
DELETE gt_fcat WHERE ( fieldname <> 'NAME' ).
NOTE: field ICON-NAME has data element ICONNAME.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'SFLIGHT'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE gt_fcat INTO ls_fcat
WITH KEY fieldname = 'NAME'.
IF ( syst-subrc = 0 ).
DELETE gt_fcat INDEX syst-tabix.
ENDIF.
ls_fcat-fieldname = 'BUTTON4'.
ls_fcat-coltext = ls_fcat-fieldname.
ls_fcat-icon = 'X'.
ls_fcat-hotspot = 'X'.
INSERT ls_fcat INTO gt_fcat INDEX 5.
ls_fcat-fieldname = 'BUTTON3'.
ls_fcat-coltext = ls_fcat-fieldname.
INSERT ls_fcat INTO gt_fcat INDEX 5.
ls_fcat-fieldname = 'BUTTON2'.
ls_fcat-coltext = ls_fcat-fieldname.
INSERT ls_fcat INTO gt_fcat INDEX 5.
ls_fcat-fieldname = 'BUTTON1'.
ls_fcat-coltext = ls_fcat-fieldname.
INSERT ls_fcat INTO gt_fcat INDEX 5.
Renumbering of the columns
LOOP AT gt_fcat INTO ls_fcat.
ls_fcat-col_pos = syst-tabix.
MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
ENDLOOP.
ENDFORM. " BUILD_FIELDCATALOG
*& Form SELECT_DATA
text
--> p1 text
<-- p2 text
FORM select_data .
define local data
DATA:
ls_sflight TYPE ty_s_sflight.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_sflight.
ls_sflight-button1 = icon_wd_radio_button. " selected radiobutton
ls_sflight-button2 = icon_wd_radio_button_empty.
ls_sflight-button3 = icon_wd_radio_button_empty.
ls_sflight-button4 = icon_wd_radio_button_empty.
Alternatively: create icons using function module 'ICON_CREATE'
on SAP releases where these icons are not available.
MODIFY gt_sflight FROM ls_sflight
TRANSPORTING button1 button2 button3 button4
WHERE ( carrid IS NOT INITIAL ).
ENDFORM. " SELECT_DATA
*& Form INIT_CONTROLS
text
--> p1 text
<-- p2 text
FORM init_controls .
CHECK ( go_docking IS NOT BOUND ).
ALV List with Radio Buttons
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 9
Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
REPID =
DYNNR =
SIDE = DOCK_AT_LEFT
EXTENSION = 50
STYLE =
LIFETIME = lifetime_default
CAPTION =
METRIC = 0
ratio = 90
NO_AUTODEF_PROGID_DYNNR =
NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Size of container = full screen size
CALL METHOD go_docking->set_extension
EXPORTING
extension = 99999
EXCEPTIONS
cntl_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Create ALV grid instance
CREATE OBJECT go_grid
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
i_parent = go_docking
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
I_FCAT_COMPLETE = SPACE
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Set event handler for event HOTSPOT_CLICK
SET HANDLER:
lcl_eventhandler=>handle_hotspot_click FOR go_grid.
ENDFORM. " INIT_CONTROLS
*& Form REFRESH_DISPLAY
Refresh table display after switching the radiobuttons
--> p1 text
<-- p2 text
FORM refresh_display .
define local data
DATA:
ls_stable TYPE lvc_s_stbl.
ls_stable-row = abap_true.
ls_stable-col = abap_true.
CALL METHOD go_grid->refresh_table_display
EXPORTING
is_stable = ls_stable
I_SOFT_REFRESH =
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " REFRESH_DISPLAY
*& Form SET_LAYOUT
Set layout for ALV list
--> p1 text
<-- p2 text
FORM set_layout .
CLEAR: gs_layout.
gs_layout-cwidth_opt = abap_true. " optimize column width
gs_layout-zebra = abap_true.
ENDFORM. " SET_LAYOUT
Regards,
Prasanth
Reward if helpful -
How to set a default pre-select for radio buttons?
Hi
I have some text form fields that I've set up to display some paired variables stored in a .txt file. When the swf loads, the form fields are populated with the text.
I've also set it up so that if you change the text and hit a submit button, the .txt file gets updated.
I'm now tryng to set it up so that I can store radio button selections in the .txt file too.
I've started doing it a certain way, but am wondering if there is a more straightforward way of doing ?
Here's what I've done...
I've set up the butttons to spit out "on" or "off" depending on the selection, and apply that to the variable that gets stored.
Now, in the same way I loaded the variables into the text form fields when the swf is refreshed, I want to load the on/off variable, and then somehow apply it to the radio buttons so that one of them is pre-selected.
So my questions are a) how do I take that loaded variable, and use an if statement to make it pre-select the button, and b) is there a simpler way to pre-select a button based on an external variable?
Thanks
ShaunNevermind guys - I did it using the 'rb_on.selected' command on the "on" radio button if the .txt file variable was "on", else the "off" radio button is selected.
Thanks for taking a look though!
Shaun -
Using radio button selection in multiple tables
Hello All,
I've got a bit of a design issue and it being a Friday my brain is a bit foggy and I can't seem to figure out a solution.
what I want to do is have 3 tables. The user should only be able to select one line from any of the three tables.
I can do this by having events that clear down selection on the two other tables on any selection of the third, but the select buttons of tables don't really give the UI impression that only one row can be selected. To do this I'd like to use the radio button element.
so
table A
choice - name
(o) - Anne
(o) - Bob
(o) - Charlie
Table B
choice - name
(x) - David
(o) - Ellen
(o) - Fran
Table C
choice - name
(o) - George
Here the entry in table B for David is selected. But any selection of any of the other options should deselected.
My thoughts are to use a radio button ui element, bind the "selected" value to a unique id for each row/table (an attribute of the node element for each table) and the value to a common shared attribute (not table specific).
Any better ideas - and certainly any which would mean I'm not going to have to maintain a lookup table of my unique ids and node elements to find out which one is selected?
Cheers,
ChrisOk - here's how I did it.
I created another lookup table which had a guid and reference to the element.
in the each elements I had a guid which I bound to the key for selection property of the radio button in the table.
I then bound the selected key property to an attribute that was common to all elements.
in my "processing" logic I read the selected key, read the lookup table - and therefore got the reference to the selected element.
Would have been an awful lot easier if I could have used a reference to the element itself as the "key" - but that was required to be a character field.
[image showing radio button selection working across multiple tables|http://i51.tinypic.com/bi79dx.jpg]
End result works quite nicely.
Cheers,
Chris
Maybe you are looking for
-
So annoying! My imessages finally activates but when I have conversations with other imessage users, my side of the conversation is iMessage and theirs is normal message? How can I fix this?
-
Mac Mail is constantly forwarding same email to my BB 8120.
I'm suffering an annoying problem whenever I type a new email using my Mac Mail (Version 3.3). As I compose a new email I'm constantly bombarded by new message alerts on my Blackberry 8120 of the actual email I'm writing. It is sending multiple alert
-
Hi, I am using java.net.URLConnection to invoke servlet which uses oracle.xml.sql.dml.OracleXMLSave for dml operations. I am facing below exception. 09/05/26 17:47:50 java.io.IOException: Server returned HTTP response code: 500 for URL: http://xxx.co
-
WOT and Webutation is showing as disabled when they are not
WOT and Webutation is showing as disabled when they are not .The icons show,but no color on icons. Says WOT is disabled when its not. Also the same on Webutation. Tried uninstalling then reinstalled both and the same thing happened. Tried Wot on anot
-
How can I keep music playing longer without using the web.
I listen to siriusxm through the web. After about 20 min the system turns off if I do nothing on the web. How I fix this?