Automate check box group selections.
Hello there,
Is there a way to programmatically select checkbox group items and save them into the context.
Thanks
Srinivas
Hi Srinivas,
You are doing the selection part completely wrong.
wdContext.nodeCheckbox_GroupList().setSelected(adminOfficeIndex, true);
The above code will not select a check box. This is used to select elements in a table.
First you have to check to which attributes the checkboxes are bound in the context. Let us know the context structure.
You should also know that Checkbox will take data only from the lead selected element of the context node. For instance you have a context node Checkbox_GroupList. The node should have a cardinality 1:1. If you have six checkboxes then you need to have six attributes of type boolean in that node. Each checkbox's checked property need to be bound to an attribute in the node Checkbox_GroupList node.
For selecting the checkbox the code should be some thing like this.
wdContext.nodeCheckbox_GroupList().currentCheckbox_GroupListElement().setCheckBox1(true);
Like wise all the six attribute values need to be checked.
In your case I guess you are comparing the attribute value with the contents of an array. If you know exactly what the names in officeList array is going to be then you can name the context attribute with the exact name then use your code like this,
String[] officeList;
officeList = wdContext.currentUser_Search_ResultsElement().getOffice_List().split(",");
int adminOfficeIndex = -1;
while(finalCheckbox.hasNext()){
adminOfficeIndex++;
String adminOffice = finalCheckbox.next().toString(); ;
IPublicRepNetAdminComp.ICheckbox_GroupListElement officeNames =
wdContext.createCheckbox_GroupListElement();
wdContext.nodeCheckbox_GroupList().addElement(officeNames);
officeNames.setGroup_Names(adminOffice);
//loop through user group to compare, if present make the selection
for(int i =0; i < officeList.length ; i++){
if(adminOffice.trim().equalsIgnoreCase(officeList<i>.trim())){
wdContext.nodeCheckbox_GroupList().currentCheckbox_GroupListElement().setAttributeValue(adminOffice.trim(), Boolean(true));
break;
Make sure that you make the node Checkbox_GroupList cardinality 1:1 and name the attributes exactly the values in officeList.
Sanyev
Similar Messages
-
Radio Button or Check Box Group
Hi,
I built a form based on a query. There is a flag column, only one of queried records is allowed to be "Y" in this column. The rests must be null.
Most ideal thing is to have a radio button group, only one of them can be selected.
Another way is to have a group of check boxes also allow only one checked. Once another check box is selected, the previously selected box must be unchecked.
Does anybody have idea of how to do it?
Thanks,
nullYou have the save the number of the current ("checked") record in your data block.
After that you can launch a trigger which will scan every record in your data block (there are enough built-ins like FIRST_RECORD, LAST_RECORD, NEXT_RECORD, Current_record property, etc.)to allow you to do this. The trigger will set the check item property to "unchecked" if it is not the saved "checked" record.
Joseph
null -
Option ( Radio button or check box) on selection - screen , to go to CNR2
<b>Subject - Option ( Radio button or check box) on selection - screen , to go to Tcode CNR2</b>
Hi all,
I have developed a report , which has a selection screen with one select-option , where i enter employee number and two radio buttons , one is for all workcentres and other one for active workcentre. so when i enter employee number and choose either of the radio button i wil get the output properly. the output displays , employee no, employee name , work centre and project of that employee . an employee may have many workcentres and a corresponding project for that work centre.
Now the Problem is , from the same report i need to add a option on the selection -screen , ( plz tell me whether to use radio button or check box and if it is radio button should i use it seperately or group it in the above two buttons.) .
so that when user selects the option , the control should go to transaction code CNR2, from where i can enter workcentre and in the next screen i have HR assigntment tab , after choosing that it will dsplay persons linked to the workcentre and there is a delete icon , from where i can delete the person.
The only thing is now to move / Navigate to the screen or go to transaction code CNR2 from the report or from the selection screen.
Your valuable Inputs are awaited, PLz do lemme know
Thanks in advance ,
regards,
ShujaShuja,
A radio button nor a checkbox should be used for navigation. I would suggest a COMMAND BUTTON.
Something like this:
Report ZZZZZZ.
TABLES: sscrfields.
SELECTION-SCREEN BEGIN OF BLOCK ONE WITH FRAME TITLE TEXT-001.
selection-screen: PUSHBUTTON /10(20) but1 USER-COMMAND cli1.
SELECTION-SCREEN END OF BLOCK ONE.
initialization.
but1 = 'Button Text Goes Here'.
AT SELECTION-SCREEN.
CASE sscrfields.
WHEN 'CLI1'.
call transaction 'CNR2'.
start-of-selection.
Your code here -
Re: Retrieving data from the check box group.....
Hi all,
I am new to webdynpro Java. I'm facing a problem while retrieving data from the check box group..
I've taken a simple type "Status" and Node with value attribute named status and set the property of that attribute as the simple type. This attribute is bound to the checkboxgroup.The cardinality of the Node is 0..n
But i am unable to read the checked items of the group.
Please help me out in solving my problem........Hi,
Use the following
for (int x=0; x< wdContext.nodeTest().size(); x++)
if( wdContext.nodeTest().isMultiSelected(x) )
// Selected Element
IWDNodeElement nodeElement = wdContext.nodeTest().getElementAt(x);
nodeElement.setAttributeValue("<Your Attribute> ", <Value>);
//Ex setting value for attribute called Name
nodeElement.setAttributeValue("Name", "Test");
Regards
Ayyapparaj -
Refreshing the 'Check Box Group' UI element
Hi ,
The requirement is the 'Check Box Group' UI element should be refreshed automatically . I am dynamically creating the 'Check Box Group' UI element and want to refresh it once I transfer the checked values from the Check Box group.
How this can be realized !!!
Best Regards
SidHi Sid,
CheckBoxGroup UI element`s content is done by binding property <i>texts</i> with appropriate attribute in context node. So, if you change data node and node elements, this will affect UI element immediately.
Best regards, Maksim Rashchynski. -
I am setting up a form to use the Spry check box field and
need to have a check box grouping to have a minimum and maximum
number of check boxes that can be selected. How is this done. I
have got individual spry check boxes with their own spry fields but
can't seem to find any documentation which shows me how to set up a
spry check box group. Could someone please tell me how to do this?
Thanks.Hi,
You can use the following code.
String[] monthNames = new String []
"January", "February", "March", "April",
List Year = new ArrayList();
for (int i = 0; i < monthNames.length; ++i)
IPrivateWebdyn_tableView.IYearElement month = wdContext.createYearElement();
month.setAtt1(monthNames<i>);
Year.add(month);
wdContext.nodeYear().bind(Year);
Bind the Checkbox group element to the node attribute.
Thanks,
Madhavi A. -
Disable Create Serial No. automatically Check box in MIGO
Hi,
I have a problem where in I need to disable Create Serial No. automatically check box in MIGO while posting GRN. And I could not do anything with the profile of the serial nr in t-code OIS2.
You can give me some information that help in this question.
Thanks in advance.
RameshHi,
Thanks for ur answer Sheshu.
Sorry for the delay.
I have created screen variant for that Serial number tab sub screen and assigned Output only option for that check box. Thn i created a transaction variant and assigned that Screen variant to it. At last i assigned and activated that Transaction variant to Standard Variant of MIGO. All these are done in SHD0 tcode. -
Setting tab order in a check box group
I am running a 508 accessibility test on forms created in Adobe. The issue that I am having is that when I verify the tab order, it skips the second or any other check boxes in a check box group. Does anyone know where to set it to recognize all the boxes in a check box group?
Paul,
Thank you. You were correct, it was a version issue. When I opened the form in Reader 9 with JAWS 10, I was aable to arrow through all of the check boxes with correct identification of each field. Thanks again for all your help. -
I want to make sure a check box is selected before allowing a form to be closed.
I want to make sure that a check box is selected before allowing the form to be closed in X Std. I have set the field as a required field but want to make sure that whoever fills in the form cannot exit, print or save without first ticking the box. How do I do this?
There is no way to prevent those actions. The best you can do is alert the user just before any of those things happen.
-
How to create a message check boxes group dynamically in OA Framework
Hi all,
I am developing a custom OAF page. It is a master-detail page. And I am having some difficulties to build that.
Firstly, I need to create a dynamic message check boxes group. These check boxes will get the prompt from a standard database table's column. Let's say I have table X with description column and it has 7 rows. Values of description column are A,B,C, ...etc. Then my master region on the page will have 7 check boxes with the prompts of A,B, C... Check box number will depend on the row/rows that this table has.
The other requirement is to create master and detail rows that depends on the number of any checked check boxes. If 2 check boxes are checked then we need to create 2 rows of master data and detail data too.
Does any of you have any ideas or suggestions to do that?
It is urgent, any help would be appreciated.
Thanks in advance and regards
PS: Is it possible to do that? Can anyone put some light on this thread please?
Edited by: user1742330 on Aug 12, 2012 4:23 PMPlease help me out with this issue...
I am in a very urgent situation. Any idea about this thread??? -
F1 help for Check Box on Selection-Screen
Hi Friends,
I want to attach F1 help for a check box on selection-screen. Though I have checked SDN community for this but did not get any relevant answer.
so, please give me correct example if someone has done similar.
Regards
PradeepPradeep,
I think this fucntion module needs to be used DD_SHLP_CALL_FROM_DYNP.If possibe try to screen debug using /H before pressing f1 for a field.
K.Kiran. -
Delete the rows if the check box is selected.
Dear all,
i have a block (not database block). i added a check box to the same block. now i want to delete the row against which the check box is selected.
i wrote the following code in when-button-pressed trigger.
IF Checkbox_Checked('CHK_DEL') THEN
delete from fa_01_11
where as_id = :as_id;
END IF;
commit;
but when i select only one check box it delete the all rows from the table if the condition is satisfied.
here is the data in my table
as_id year month
63 2006 4 0 -1183.92 1
63 2006 5 0 -1183.92 1
63 2006 6 0 -1183.92 1
63 2006 7 0 -1183.92 1
63 2006 8 0 -1183.92 1
63 2006 9 0 -1183.92 1
63 2006 10 0 -1183.92 1
63 2006 11 0 -1183.92 1
63 2006 12 0 -1183.92 1
what's the proble?
Regards:
Muhammad Nadeem
Message was edited by:
Muhammad NadeemYou need to run the code for each record and you need to find something which is unique. as_id is not unique.
untested:
declare
last_rec boolean := false;
deleted boolean := false;
begin
first_record;
loop
deleted := false;
last_rec := :system.last_record = 'TRUE';
IF Checkbox_Checked('CHK_DEL') THEN
delete from fa_01_11
where as_id = :as_id
and year = :year
and month = :month;
clear_record;
deleted := true;
END IF;
exit when last_rec;
if not deleted then
next_record;
end if;
end loop;
commit;
end; -
Hi,
I have created a check box Group
texts = Mydata.Interest.Interests
Mydata is a node , Interests is of type Simple type Interests.
It has 3 enumerations.
But when i run, I am able to only one check box with out any text.
Where am i wrong?Hi you cannot use symple type to name the check boxes.
create a node(Say CheckBox) of cardinality 0..N
with a context variable(Say CheckValue) of type String. Bind this attribute(CheckValue) to "texts" property of CheckBoxGroup.
Now, to add 5 checkboxes from code, use the following code
IPrivate<View>.ICheckBoxNode lNode=wdContext.nodeCheckBox();
IPrivate<View>.ICheckBoxElement lEl;
for(int i=0;i<5;i++)
lEl=lNode.createCheckBoxElement();
lNode.addElement(lEl);
lEl.setCheckValue("Text"(i1));
xxxxxxxxxxxxxxxxxxxx
Edited by: Armin Reichert on May 21, 2008 7:58 PM -
Hi experts,
I am new to webdynpro, i want to add one more check box in a check box group,
can anyone help me,(but default it is coming 3)
thanks in advanceHi,
if it is limiting to three what you can do is create a two views with three check boxs each and create a view conatiner element in one view and embed the second view inside the view conatiner element.
so by doing this you can have more than three checkbox
cheers -
With recent update, all my check boxes and selection circles have disappeared. I tried to uninstall FF, reinstall, but nothing fixed it. When I run safe-mode, it's fine, but then no youtube or other internet fun stuff. Tried to update plug-ins but still all jacked up. any ideas? also, my side scroll bar screws up too.
Do you mean Firefox safe mode or Windows Safe mode?
If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
* Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
* Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
If you mean Windows Safe-mode then check your security software.
Maybe you are looking for
-
Valuation control in material master and special stock differs
Hello expert. SAP is showing the attach error when a key user is trying to making a usage decision What can be the problem? And how can i resolve? Check the attach file. thank
-
Any help is greatly appreciated
-
FireFox issue copying text in span with content editable true
I found magic in firefox..!!!. When i copy some content (like any text) from Microsoft word file into span which is editable contenteditable="true" in Firefox it convert into twice. Demo : http://jsfiddle.net/LPNYZ/ Note: I am using Microsoft 2013 of
-
Dual-track audio after export plays on first clip, but not on second?
So, I've been working on a project with video that has two audio tracks, and they play fine in the preview window in premiere, but as soon as I export them, the first clip of it works, but the second clip I have does not have the second audio track,
-
Problems with old apple id and the cloud
Ok, I have an Apple ID, but my icloud keeps coming up with my OLD apple id which is linked to an email address I no longer have. How do I fix this and reconnect to the cloud? As it is, I cant connect to a bunch of stuff because I have too many ids. H