Check box events
I have three cheak boxes on one stage of the application,
when a user selects a particular type and selects the next button
it will direct the user to the corresponding part of the
application. I have no code so far and am completely stuck, any
help would be great, cheers
so where abouts does this code need to be inserted, as have
tried to place the second, more correct way into my script but
seams to come up with script error
#.hilite
is cb1 the name of the checkbox or is it the name within the
brackets? plus is the "set1" the number of the fame i want the
button to navigate to once a certain box has been selected? i have
tried to put your code into the application but seams to do
nothing? please could you help, again.
Cheers
Similar Messages
-
How to handle check box events in alv tree.
hi,
i am working in CL_GUI_COLUMN_TREE class.Also using Check box. Now i want to handle events for check box . I am new to ABAP Objects.
Pls expaline in detail or send code
thanks in advance,
senthil kumar.rHello Senthil
Have a look at the sample report
SAPCOLUMN_TREE_CONTROL_DEMO
. The crucial points are:
<b>(1) Register the required events at the control</b>
* define the events which will be passed to the backend
" checkbox change
event-eventid = CL_GUI_COLUMN_TREE=>EVENTID_checkbox_change.
event-appl_event = 'X'.
append event to events.
CALL METHOD G_TREE->SET_REGISTERED_EVENTS
EXPORTING
EVENTS = EVENTS
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
ILLEGAL_EVENT_COMBINATION = 3.
IF SY-SUBRC <> 0.
MESSAGE A000.
ENDIF.
<b>(2) Set the event handler</b>
assign event handlers in the application class to each desired event
SET HANDLER G_APPLICATION->HANDLE_CHECKBOX_CHANGE FOR g_tree.
<b>(3) Define and implement event handler method</b>
METHOD HANDLE_CHECKBOX_CHANGE.
" this method handles the checkbox_change event of the tree
" control instance
" show the key of the node and the name of the item
" of the clicked checkbox in a dynpro field
G_EVENT = 'CHECKBOX_CHANGE'.
G_NODE_KEY = NODE_KEY.
G_ITEM_NAME = ITEM_NAME.
CLEAR G_HEADER_NAME.
ENDMETHOD.
Regards
Uwe -
HOW TO TRIGGER CHECK BOX EVENT IN BLOCKED LIST OUT PUT
Hi Abapers,
I am developing ALV Blocked list using 3 internal tables.
in output list my requirement is if I click one check box in one intrrnal table the below internal table checkboxes should be checked.
how to solve this problem this is very urgent to me I hope somebody will help me.
Regards
Shashikumar.GHi
First you need to register the events of clicking of the checkbox.
Once registerred, you can capture that event and when occured, you can set the checkboxes for below internal table.
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/95/34eb7feb6211d3a7270000e83dd863/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/95/34eb7feb6211d3a7270000e83dd863/frameset.htm</a>
Regards
Raj -
How to add unique id to check box in a table
Hi Experts,
I have a static table in which more than 500 records appears in the table, so vertical scroll is displaying in the table. In each row, check boxes and text boxes displays with the data. When the check box is selected, I will do the calculation based on the selected check box and displays the calculated value to text control of respected row. To achieve this, I am triggering the event iterating the loop over the context to find which check box is selected. When the page gets refreshed, cursor moves to first record.
Since all the check boxes having the same id, I am not able to get from which check box this event has got triggered.
Is there a way to assign unique id to each check box so that I can assign parameter to the control and get from which check box event got triggered. I have tried to generate the table dynamically, even there I couldn't assign id to each check box.
Please through light on this request
Thanks
MurthyIt is not specific to any platform but common in all whether is CE or 7.0 follow the given procedure
1. Create a common onLeadSelect of table say it selectedRow
2. Assign the same event in onToggle selectedRow of checkbox.
3. Now loop it in such a way that
if (wdContext.nodeAppinvoiceData().getLeadSelection() >= 0)
wdContext.currentAppinvoiceDataElement().setIsPreviewSelected(true);
if (wdContext.currentAppinvoiceDataElement().getIsSelected())
wdContext.currentAppinvoiceDataElement().setIsSelected(false);
for (int i = 0; i < wdContext.nodeAppinvoiceData().size(); i++)
boolean flag = wdContext.nodeAppinvoiceData().getAppinvoiceDataElementAt(i).getIsSelected();
if (flag)
break;
else
else
wdContext.currentAppinvoiceDataElement().setIsSelected(true);
wdContext.currentAppinvoiceDataElement().setIsPreviewSelected(false);
wdContext.nodeAppinvoiceData().clearSelection();
wdContext.nodeAppinvoiceData().setLeadSelection(-1);
BR
Satish Kumar -
Make check box activate a calculation
Hello I have a question about forms and calculations. I have the following problem. I have a grand total which is setup to sum my fees column. It works fine. My fees column is multi line. I had it setup to calculate hours multiplied by hours worked and put it in my fees column. I only want the calculation to be dependent on whether or not my check boxes are checked. If they are not checked then I do not want the calculation to happen. I can't get this to work for me. Is it possible? Thanks for any help fellas!
If that is your fill script, you first need to obtain the values of the field objects.
// obtain the value for the field objects:
var C1= this.getField('C1').value;
var HR= this.getField('HR').value;
var HR2 = this.getField('HR2').value;
Once you have established the values you can test and use them. The
'if (statement) {
// block of code
} else {
// block of code
does not return a value. The '(statement)? {true answer code} : {false answer};' variation is used to return a value. So your final code can be:
// obtain the value for the field objects:
var C1= this.getField('C1').value;
var HR= this.getField('HR').value;
var HR2 = this.getField('HR2').value;
// test the value of the check box
if (C1 == 'Yes')
event.value = HR * HR2;
else
event.value = 0;
or
// obtain the value for the field objects:
var C1= this.getField('C1').value;
var HR= this.getField('HR').value;
var HR2 = this.getField('HR2').value;
// set the value based on the value of the check box
event.value = C1 == 'Yes'? HR * HR2 : 0;
But if you set the export value to '1', then your script can be:
var C1= this.getField('C1').value;
var HR= this.getField('HR').value;
var HR2 = this.getField('HR2').value;
// compute value from HR, HR2, and logical value of C1 not being Not a Number
event.value = HR * HR2 * !(isNaN(C1)); -
Event to use for Creation of a Check box on Warehouse master Form
Hi experts
I have created one check box on Warehouse Master form in AfterMENUClick Event. It works fine if I open the form on Menuclick . But If I open the Warehouse master form by Link button from any document, it does not show the check box. I also want to deactive the checkbox if once it checked. So, I do some coding in Data_Load event. It also works fine If I open the form by Menu click. But if I open the form by Link button it gives error " Invalid Item Id ".
So I want to know which event I should use to create the check box and which Event I Should use to Deactive the Check boxThanks Nagy for quick reply
I use the following code for creation of check box
<B1Listener(BoEventTypes.et_FORM_LOAD, False, New String() {"62"})> _
Public Overridable Sub OnAfterFormLoad(ByVal pVal As ItemEvent)
Dim ActionSuccess As Boolean = pVal.ActionSuccess
Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
'ADD YOUR ACTION CODE HERE ...
Dim oForm As Form
Dim oMatrix As Matrix
Dim oItem As Item
Dim sysItem As Item
Dim BinCheck As CheckBox
Dim BinLabel As StaticText
Dim cmbBinCode As ComboBox
oForm = B1Connections.theAppl.Forms.ActiveForm
oForm.PaneLevel = 1
sysItem = oForm.Items.Item("2000002010") 'Excisable check box
oItem = oForm.Items.Add("BinChk", BoFormItemTypes.it_CHECK_BOX)
oItem.Left = sysItem.Left
oItem.Top = sysItem.Top + 20
BinCheck = oItem.Specific
BinCheck.Caption = "Bin Enabled"
BinCheck.DataBind.SetBound(True, "OWHS", "U_BinEnabled")
End Sub
It gives error on sysItem = oForm.Items.Item("2000002010") line Invalid Item Id
Plz check and tell the problem
Regards
Gorge -
Event for Check box in the list
hi,
I have a 10 check boxs in list using
loop.
WRITE CHK1 AS CHECKBOX.
endloop.
and if I click on 8th checkbox. i need to trigger an event, like what we have in
AT LINE SELECTION. or AT USER COMMAND.
i don't want to use below logic because when there are 300 records it starts reading from first line and giving time out dump. I don't want to run the loop for 300 to find out for one selected box.
Do.
ADD 1 TO w_line.
READ LINE w_line line value INTO porec.
Enddo.
pls reply ASAP.
Thanks,
Ram.I'll confirm that - at least to the best of my knowledge. There is no event that is triggered when a simple checkbox is ticked on a list.
You either need to make them buttons (ie at user-command) or hotspots (so the 'click' also triggers at line-selection). -
Hi Experts ,
I am developing an application in this it contain a matrix within that a check box exist. now i have to catch the check event of the check box. can u help me to catch the event and where to write the further code .
Thanks Regarding,
Mahi.Hi, Sandy.... this code what i hav implemented.. does it contain any error.. code it is not working
plz,,, go through it,,
If pVal.Before_Action = True Then
Select Case pVal.FormUID
Case "REACTOR_"
Select Case pVal.ItemUID
Case "MATRIX"
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_VALIDATE
If pVal.ColUID = "V_22" Then 'Or pVal.ColUID = "col_5" Then
oItem = oForm.Items.Item("MATRIX")
oMatrix = oItem.Specific
oColumns = oMatrix.Columns
Dim J As Integer
J = 0
J = CInt(pVal.Row)
Dim oColumn1 As SAPbouiCOM.Column
For Each oColumn1 In oMatrix.Columns
Select Case oColumn1.UniqueID
Case pVal.ColUID
oedit = oColumn1.Cells.Item(Int32.Parse(J)).Specific
If pVal.ColUID = "V_22" AndAlso pVal.ItemChanged Then
BubbleEvent = False
P("REACTOR1_", J)
Else
End If
End Select
Next
End If
End Select
End Select
End Select
End If
Regards
mahi -
How to check the "check box" based on an event on form
Hi,
I have couple of text items and a check-box on a form. Is there a way I can check the box automatically when the text item values are edited/enterd by user ?
I'm using the JS shown below but it doesn't work.
I have this JS in page header.
+<script type="text/javascript">+
+function checkTheBox() {+
document.getElementById('MY_KBOXNAME').checked='checked';
+}+
+</script>+
And I have this in my form element options.
onChange=checkTheBox();
What am I doing wrong?
Thanks in advance,
AshaHi,
For checkbox with name P1_CHECKBOX , first checkbox is refferred using P1_CHECKBOX_0 , second one using P1_CHECKBOX_1 and so on..
Change document.getElementById('MY_KBOXNAME').checked='checked' . instead of MY_KBOXNAME , use MY_KBOXNAME_0, MY_KBOXNAME_1 ETC depending which checkbox you want to check.
Regards,
SK -
Multiple checked boxes fill in common text field
I am attempting to create a form that has various criteria that are checked off (check boxes) and need to populate a common text field within the same form. Presently with action items I am able to design the form so that when only one item is checked it shows up on in the text field at a time not multiples Any suggestions would help.
Thank you1) In the Binding tab of your checkboxes you can put the On Value to whatever you want to populate the common text field with and the Off Value blank.
2) Assuming all your check boxes names are CheckBox under the same subform use this script in the calculate event of your common text field:
var aChkList=[];
var vChecks = CheckBox.all;
for (var a=0;a<vChecks.length;a++){
if (!vChecks.item(a).isNull){
aChkList.push(vChecks.item(a).rawValue);
this.rawValue=aChkList.join(", ");
Kyle -
Need Help: I need a check box to auto fill a set value in separate text field.
Hi, this is my first time with inserting scripts into a PDF Form.
We have a form that requires the user to check a box regarding medical conditions they have (i.e. Asthma, Diabetes, Hypertension). Later in the form, they have to type out the same condition into a text box. (I know stupid to double document, but it is required). Is there a script that will auto fill the text box when they check the box? For example, if they check asthma, the text box on a later page in the PDF will say "Asthma, controlled." Is this possible?
In addition, if they don't click Asthma, and do click Diabetes, could it add Diabetes to the first text box, but if they check both, it would add Asthma to box 1 and Diabetes to box 2?
Any help would be GREATLY appreciated.
I'm using Acrobat 9
Thanks!Hi, I'm staring at the code trying to make it work for my needs, which are similar to Austin's.
I have a 16-page form with 2,988 checkboxes in the entire document (a little over 200 in each page besides the first and last page). The last page contains a textbox labled Summary, and it should provide a summary of all the items checked in the document. Theoretically only one page will be populated at a time, so there will be no more than 200 checkboxes checked in the entire document.
Is it possible to use the same code? And do I just put the code under the text in the script that reads:
form1.SummaryPage.SummaryText::calculate - (JavaScript, client)
The JS I am trying to get to work is the following from a post above.
// Custom Calculate script
(function () {
var i, v, s = "";
// Loop through the 2988 check boxes
for (i = 1; i < 2989; i += 1) {
// Get the value of the current checkbox
v = getField("checkbox " + i).valueAsString;
// Concatenate check box value to string if not deselected
if (v !== "Off") s+= v + "\r";
// Set this field value
event.value = s; -
I need to identify a series of single-response checkbox variables and display the ones selected (as a group) in a text field in an appended (comma, space) format. Last week, you provided a great little script for a similar need using List Box (multiple response) variables. This time I need to know how to formally identify the checkbox variables and, I presume, use a similar script to display the results in a comma, space format.
You've been of great help.
ThanksHere's the script adapted to this situation. It assumes there are ten check boxes named cb1, cb1, cb2, ...cb10.
// Custom Calculate script for text field
(function () {
// Initialize the string
var v, s = "";
// Loop through the check boxes to build up a string
for (var i = 1; i < 11; i++) {
// Get the value of the current check box
v = getField("cb" + i).value;
if (v !== "Off") {
if (s) s += ", "; // Add a comma and a space if needed
s += v; // Add the selected value
// Set this field value to the string
event.value = s;
You'll have to change the field name and starting/ending numbers to match your form. -
How to handle check box click in ALV grid
Hi Experts,
I use ALV grid using FM.
I have list of delivery note items with one custom field as check-box. When I check the checkbox, all other lines related to the same delivery note should be automaticaly checked.
Is there any event or function code, where I can handle single click to checkbox?
Thanks®ards,
JirkaHI
you can use following code in user command function .
DATA :BEGIN OF IT_MAINDATA OCCURS 0,
MAINDATA(1),
IT_RD1(1),
END OF IT_MAINDATA.
data: V_INDEX TYPE I.
DESCRIBE TABLE itab LINES LINE.
DO. " line times.
READ LINE SY-INDEX FIELD VALUE Iitab-RD1.
IF SY-SUBRC NE 0. EXIT. ENDIF.
CHECK V_INDEX > 0.
CHECK itab-RD1 = 'X'.
MODIFY itab INDEX V_INDEX.
IT_MAINDATA-IT_RD1 = Iitab-RD1.
ENDDO.
i think is work.
regards,
Abhi -
How to capture check box click in ALV
Hi,
I have requirement in which after displaying the ALV out put, immediately when the check box is checked i need to capture it and proceed with further coding with that input.
Check box click is not getting captured in "USER COMMAND or LINE SELECTION"
Could you please suggest a way.
Regards
venkatesh.Venkatesh,
If you are using cl_gui_alv_grid you need to register "change" event to catch the checkbox change.
you do so with this method of cl_gui_alv_grid class :
register_edit_event( i_event_id = cl_gui_alv_grid=>mc_evt_modified ).
event handler class
class lcl_event_receiver definition.
public section.
methods:
user_command for event user_command of cl_gui_alv_grid
importing e_ucomm, "#EC NEEDED
data_changed for event data_changed of cl_gui_alv_grid
importing er_data_changed e_onf4 e_onf4_before e_onf4_after e_ucomm,"#EC NEEDED
endclass.
global data
data: o_event_receiver type ref to lcl_event_receiver.
data: goo_grid type ref to cl_gui_alv_grid.
At the displaying of your grid / register the change event and set handlers
goo_grid->register_edit_event( i_event_id = cl_gui_alv_grid=>mc_evt_modified ).
set handler:
o_event_receiver->user_command for goo_grid,
o_event_receiver->data_changed for goo_grid.
hope this helps...
regards -
How to insert check box fields in a htmlb: tableview
Hi,
Can anybody tell me how to insert check box fields in a htmlb: tableview in a sequence of rows in a table view. How to generate the sequence no for the checkbox inorder to know the row that is checked.
Thanks in advance,
Aruna.Here is the code which has the custom "Checkbox" in the tableview & Triggers the event. <b>You can identify the checkbox based on cell ID (p_cell_id)</b> in the method "IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START" & Based on the event name + Cell ID. Look at the code & let me know if you any issue.
<b>Layout:</b>
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content id = "content"
design = "design2002+design2003"
controlRendering = "SAP"
rtlAutoSwitch = "true"
forceEncode = "ENABLED" >
<htmlb:page title="Test " >
<htmlb:form>
<%
data TV_ITERATOR Type Ref To zcl_itr.
data iterator type ref to IF_HTMLB_TABLEVIEW_ITERATOR.
create object tv_iterator exporting appl_cons = application.
iterator = tv_iterator.
%>
<htmlb:tableView id = "fligts"
headerText = "Flight"
width = "100"
headerVisible = "true"
design = "alternating"
visibleRowCount = "10"
fillUpEmptyRows = "true"
showNoMatchText = "true"
filter = "server"
sort = "server"
onHeaderClick = "MyEventHeaderClick"
table = "<%= APPLICATION->itab %>"
iterator = "<%= ITERATOR %>" />
</htmlb:form>
</htmlb:page>
</htmlb:content>
<b>Event Handling:</b>
DATA: EVENT_ID1 TYPE REF TO IF_HTMLB_DATA.
EVENT_ID1 = CL_HTMLB_MANAGER=>GET_EVENT_EX( REQUEST ).
CASE EVENT_ID1->EVENT_SERVER_NAME.
IF NOT event_id1 IS INITIAL.
if event_id1->server_event+0(9) = 'chkevent'.
SPLIT event_id1->server_event AT '-' INTO v_event v_dummy v_row v_col.
endif.
endif.
method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS.
CLEAR p_column_definitions.
CLEAR p_overwrites.
DATA: tv_column TYPE TABLEVIEWCONTROL.
tv_column-COLUMNNAME = 'FLDATE'.
tv_column-edit = 'X'.
tv_column-sort = 'X'.
tv_column-TITLE = 'Flight Date'.
tv_column-WIDTH = '100'.
APPEND tv_column TO p_column_definitions.
CLEAR tv_column.
tv_column-edit = 'X'.
tv_column-COLUMNNAME = 'CONNID'.
tv_column-TITLE = 'Conn.ID'.
tv_column-WIDTH = '70'.
tv_column-HORIZONTALALIGNMENT = 'center'.
APPEND tv_column TO p_column_definitions.
CLEAR tv_column.
tv_column-edit = 'X'.
tv_column-COLUMNNAME = 'CHECKBOX1'.
tv_column-TITLE = 'Check Box'.
tv_column-WIDTH = '30'.
tv_column-HORIZONTALALIGNMENT = 'center'.
APPEND tv_column TO p_column_definitions.
endmethod.
METHOD IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
DATA: L_EVENT TYPE STRING.
CASE P_TABLEVIEW_ID.
WHEN 'fligts'.
CASE P_COLUMN_KEY.
WHEN 'CHECKBOX1'.
* CONCATENATE 'chk_event' '123' '2323' INTO L_EVENT SEPARATED BY '-' .
CONCATENATE 'chkevent' p_cell_id INTO l_event SEPARATED BY '-'.
P_REPLACEMENT_BEE = CL_HTMLB_CHECKBOX=>FACTORY( ID = P_CELL_ID
ONCLICK = L_EVENT CHECKED = 'false' ).
ENDCASE.
ENDCASE.
ENDMETHOD.
Hope this will solve your problem.
<b><i>* Reward each helpful answer.</i></b>
Raja T
Message was edited by:
Raja T
Maybe you are looking for
-
When I type an email address in Mail I'm getting ancient email addresses
For example, I used work with a laura and now I work with a new laura. different surnames. the old one keeps autofilling. When you backspace delete, they multiply! I don't have these old names in contacts, it's onviously something dredged up from the
-
While watching rented movie it stops during playback, how do i fix it?
I rented a long movie and it continues to stop during playback, how do I fix that?
-
Want to know SAP MM Table, like table VBFA for SD Document Flow
Hello Experts, I want to know, direct relationship between GR against PO line item and IR against PO line item. I want to know, is there any SAP table for MM which gives direct relationship between succeeding document and preceding document, similar
-
I've got an 2.4Ghz MBP running the latest version of Leopard that is maxed out with 4GB of RAM. I run XP under VMWare full-time. Most of the time, things are fine. However, at times my computer will just seem to "slow down", even when not much is run
-
i have purchased apple iphone 4s FROM LONDON (uk) on 1st june 2012 but right now i am in india (either mumbai or new delhi)my iphone having display problem verticle/horizontal lineing,from where i can repaired/replaced.