Integrating checkboxes in table.....
Hi,
I have a table which is populated using a BAPI.
The fields are diaplayed as InputFileds(editable) so that the user can edit them.
Whenever a field of a row is edited, the user has to click a CheckBox next to it, to indicate that he/she has edited that particular row.
Each row of the table should have such a CheckBox.
The problem is how to integrate these CheckBoxes in the table.
Since I have used 'Apply Template' for the table, for adding the CheckBox column I used 'Insert Column' and then using TableCellEditor I have integrated the CheckBox.
In the Context I have created a node, and under that have created a context variable of type Boolean. This variable is then mapped to the 'checked' property of the CheckBox.
But the problem is that when one CheckBox is clicked , all get clicked......as they are bound to a single context variable......
What do I do so that each CheckBox gets clicked individually??????...........
Also, I want to get the contents of the row selected depending upon the clicked CheckBoxes.
Thx in adv!
Regards,
harshada.
Hi there,
Dont bind the checkbox to the new attribute in another node. Create a value attribute of type boolean under the same node which is the datasource for the table. Then, each line will get selected individually, and you just have to see whether this checkbox is selected by looping through the table node, to get all the selected items.
By this method -however- you cannot map the node to any model node directly. You have to fill this node and copy data from this node programmatically.
Tell me if its not clear, and I will explain in detail,
Regards,
LM
Similar Messages
-
Problem with checkbox on table component
Hello i am having a problem with checkbox in table component
i am developing something like a shopping cart app and i have a checkbox in my table component , i want users to select items from the checkbox to add to thier cart, They can select the items from cartegory combobox , my problem is when they select the items from the checkbox if they select another category the alread selected once do not display in my collection opbject please how can i maintain the state of the already selected items in my collection objectHi,
Please go through the tutorial "Understanding scope and managed beans". This is available at:
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/scopes.html
The details of the selected items need to be stored in an object that is in session scope.
Hope this helps
Cheers
Girish -
Hi,
I want to add CheckBox in Table. my requirement is multiselection. I Implemented the following steps, but it's not working. anyone can tell me,what mistake i did?
I created two "Value Attribute"(check,Name) under a "Value Node"(Student) in context.
check - Boolean
Name - mapped a Dictionary simple Type(5 values)
Include a Table in Layout and select Create Binding on right clicking of Table.
Checked only Student and check -> Next
Selected the Editor as checkbox -> Finish
Selected Name from context and assigned to checkbox text property.
Then I deployed the application. But only one checkbox is displayed in Table without any text.
Please give me the suggestion, how to do this.
Thanks in Advance
RajakumarHello,
I think you have a fundamental misunderstanding on how Checkboxes work. A Checkbox triggers a boolean value with true (checked) or false (uncheked).
When you map your name attribut to text you will see the content of that attribute as text behind. But not the metadata.
You may want to use a RadiobuttonGroup or CheckboxGroup for your purpose.
Frank -
How can i uncheck a checkbox in table component on clicking a button
In my application I have a table component that display data from the database and a submit button outside the table component, the first column in the table component is a checkbox, How can i uncheck the checkbox in the table component when the submit button is clicked?
Thanks in advance.Something like this ... I THINK it will uncheck all checkboxes in table, but I'm not positive ... you can test!
if checkbox id is checkbox1...
<script type="text/javascript"><![CDATA[
function disableCheckbox()
document.getElementById('form1:checkbox1').selected = false;
}]]></script>Put above code inside of head tag in JSP View
NEXT...
go to Design View and select your button and go to properties section and select onClick property and insert this javascript in dialog...
setTimeout('disableCheckbox()', 1)Now run the project when you click the button does the checkbox become unselected?
Anyway this is where I would start...as far as selecting just the first checkbox if there is more than 1 record...I'm not sure...but I'm curious if this works.
Jason -
Integrity checkbox in transformation
Hello
When creating the transformation, I can see the "Integrity" checkbox as a last column in the rule group. This checkbox appears for some of the Info Objects included in the group. What is a purpose for this?
Thanks,
ArelisHi,
Like Ajeet said Hi, Itu2019s for the referential integrity. Say you want to throw an error, if a characteristic gets in to system other than the one you have in the BI system, then check this box.
e.g you have material X,Y,Z in your IB system say during the data pull you get Material A, then the system will throw an error
Regards
Fazal -
How to add selected values from table(selected using checkbox)to table?
Hi All,
i have created simple page with search panel with table in table i have created one column as check box for selecting.
here what my requirement is i need to do search multiple times to add some roles to from some different categories.here whenever i searched i ll get some roles into table there i ll select some role and i ll click add buttion. whenever i click add i need to add those roles into some other table finally i ll submit added roles.
here i followed one link http://www.oracle.com/technetwork/developer-tools/adf/learnmore/99-checkbox-for-delete-in-table-1539659.pdf
i used same code and able to see selected row in console, as object array how to add these into table.
please help me out
Thanks in advance
siva shankarThank you for a quick reply
i used the same thing before i go for table check box concept.here what i observed is when i search i am getting some results i am able to shuttle.but if i search again the shuttle is refreshing with new values even not available list its refreshing selected list. IF dont want refresh selected ones.
my usecase after make some searches I will select some roles from different categories at finally i ll submit.
i hope you understand me requirement. please suggest me is this requirement is possible in shuttle component? if yes please guide me.
thanks
Siva Sankar -
hi dear wd experts,
i have created a 2 coloumns table, which retrieves data from a model object. It's context is nodeUTablenodeUrowsattribute1.
the second table column contains a checkbox.
For the checkbox I set up a node, which carries a bool variable and which is assigned to the checkbox "checked" poperty.
I set the cardinality of the checkbox node 1:n (when using 0:n the checkboxes are disabled...)
During wdDoModify I create checkbox contexts like this:
wdContext.nodeStandard().invalidate();
int rsize = wdContext.nodeUrows().size();
for (int i = rsize - 1; i >= 0; i--)
IPrivateDealer.IStandardElement standard =
wdContext.createStandardElement();
wdContext.nodeStandard().addElement(standard);
so I get as many bool vars as required. I am not sure about the "invalidate()" method.
I thought, when using it like above, I could also use a 0:n cardinality for my checkbox contents. But even "validate()" won't enable the checkboxes on the webpage... hence I use 1:n.
Now I set up an onToggle Event for the checkbox, which looks like this:
if(wdContext.currentStandardElement().getBolStandard()==false){
wdContext.currentStandardElement().setBolStandard(true);
}else{
wdContext.currentStandardElement().setBolStandard(false);
Unfortunatly this only works for all checkboxes, and furthermore, once checked, I can't reset the checkboxes.
I also tried to use the getLeadSelection() of my nodeUrows. But this returns always 1.
<b>Big Question goes here:
How can I address only one checkbox???</b>
thanx a lot for your patience and help...
MatthiasHi armin et al,
thanx for all the messages - i followed different different approaches. Armins for instance.
So I put a boolean var in in my modelnode which "Rows" and bound it to the checked property of the celleditor checkbox. The bool var is called "bolStandard" in my case.
Now in the "CheckBox.onToggle" event, I declared:
if(wdContext.currentUrowsElement().getBolStandard()==false){
wdContext.currentUrowsElement().setBolStandard(true);
}else{
wdContext.currentUrowsElement().setBolStandard(false);
The point is, the checkbox won't check, and the leadselection of the table jumps back to the first row.
What went wrong?
I did not set up any parameters for the event, like somebody here suggested...
I also did the wdDoModify like this (in firstTime):
// checkboxen
IWDCheckBox cb = (IWDCheckBox) view.getElement("cb");
cb.mappingOfOnToggle().addSourceMapping("checked", "newCheckedState");
thanx once more - points will be rewarded of course to every single helpful feedback,
matthias -
Problem with CheckBox as table cell renderer
i m making a JTable having three columns.
i m also making a cellRenderer of my own MyRenderer
extending Jcheckbox and implementing TableCellRenderer
now i m setting MyRenderer as renderer for third column in my table and
DefaultCellEditor with jcheckbox as parameter as cell editor for this column
the code is like this--------------------
****making of JTable****
table= new JTable(3,3);
JScrollPane scrollPane = new JScrollPane(table);
TableColumn tableColumn = table.getColumn("Male"); // let us suppose that this gives third column
tableColumn.setCellRenderer(new MyRenderer ());
tableColumn.setCellEditor(new DefaultCellEditor(new JCheckBox()));
*****The classs implementing TableCellRenderer is given below******
class MyRenderer extends JCheckBox implements TableCellRenderer{
public MyRenderer(){
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus,
int row, int column){
if(value != null){
Boolean booleanValue = (Boolean)value;
setSelected(booleanValue.booleanValue());
return this;
***********************************Problem****************************
The problem is that when we click on the cell of that column first time,
all the cells are selected.
I don't want to use getColumnClass() method for this problem .
If possible , please give some other solution.
what is the problem behind this,If anybody can help us.
Thanks in advance.I think the problem is, when the value is null the checkbox return with the selected state, b'coz u r
returning the checkbox (as it is). so pl'z try with below code (ADDED).
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus,
int row, int column){
if(value != null){
Boolean booleanValue = (Boolean)value;
setSelected(booleanValue.booleanValue());
else /// ADDED
setSelected(false);/// ADDED
return this;
Nediaph. -
Problem In Integrating 3 Internal Tables to make data for email attachment
Hi All,
I am facing a problem. I am having some data in 3 internal tables. Consider it Header Data, Details Data, Tail Data in 3 different Internal tables with different Fields.
Now I want to send this data as an attachment in email. Now the problem is I am integrating the data in 3 internal tables into 1 single internal table with the help of following code :
loop at it1.
concatenate it1-field1
it1-field2
into itab.
append itab.
endloop.
loop at it2.
concatenate it2-field1
it2-field2
into itab.
append itab.
endloop.
similarly for 3rd internal table. But here it goes wrong.
For each and every field in each record, some specific number of characters are fixed. If any field doesn't uses those characters to complete, it has to leave the remaining characters blank and should start next field from there.
E.g.
Like record is :
AAA reserved chars : 10
XXX " " : 15
YYY " " : 8
so it should print like :
AAA XXX YYY .
But in attachment it is printing like :
AAAXXXYYY.
This is because I am using concatenate function. Please suggest me a way to integrate the data of 3 internal tables into a single internal table including the spaces reserved for each field.
Thanks.Hi Ravi,
Did u try to use de addicion 'Separated by space' in the concatenate function?
If it doesn't work, try this...
You have to do as if you want to create a text file, using de offset function.
Creating an internal table with one field and put all the records of your tables into this internal table.
data: wa_line(400).
data: begin of itab_line occurs 0,
line(400),
endif itab_line.
Loop at itab1.
clear wa_line.
write: itab1-field1 to wa_line+0(10).
write: itab1-field2 to wa_line+10(8).
write: itab1-fieldN to wa_line+nn(mm).
append wa_line to itab_line.
clear itab_line.
endloop.
Do the same with itab2 and itab3.
Cheers,
FC. -
Checkbox in table cell won't uncheck
Hey all,
Can someone help with this please. I am using a table model where the second column is Boolean. The table correctly renders this as a checkbox (I'm not using a custom renderer). The checkbox works ok except that you can't uncheck it. You can change which row is selected, but clicking twice on the same cell has no effect - it just stays checked.
Thanks in advance for any help.here I am giving one example. Can u check this. In this eg, I gave check box in 3rd column(column no starting from 0).
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
import javax.swing.table.*;
import java.awt.*;
public class Class1 extends JFrame {
JScrollPane jScrollPane1 = new JScrollPane();
public Class1() {
super();
try {
MyTableModel model = new MyTableModel(); JTable editableTable1 = new JTable(model);
DefaultTableModel tblmdl = (DefaultTableModel) editableTable1.getModel();
tblmdl.setRowCount(3);
tblmdl.setColumnCount(3);
editableTable1.setCellSelectionEnabled(true);
this.getContentPane().setLayout(null);
jScrollPane1.setBounds(new Rectangle(25, 19, 330, 180));
this.getContentPane().add(jScrollPane1, null);
jScrollPane1.getViewport().add(editableTable1, null);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
System.exit(0);
} catch(Exception e) {
System.out.println("Exception in Class1:"+e);
class MyTableModel extends DefaultTableModel {
MyTableModel() {
public Class getColumnClass(int c) {
if(c == 2) {
return Boolean.class;
} else {
return String.class;
public static void main(String[] args) {
Class1 class1 = new Class1();
class1.setSize(400, 400);
class1.setVisible(true);
} -
Integrity check of tables between Oracle 9i and Oracle 11g
Hi,
|Is there a tool or a way to check the integrity of data in the tables after migrating data from an Oracle 9i database to an Oracle 11g database?
Thanks for you help.Hi,
How do you want to proceed for your migration ? Assuming everything was OK in your 9i database normally things should go well whatever the method.
For example as the previous posters mentioned if you use exp/imp and if you have "successfully without warnings" at the end of the operations you can trust those messages. Physical corruption is not the only possible problem and with exp/imp some things not to forget :
- checking the compatibility of the source and target database charactersets and positioning correctly the NLS_LANG variables for exp and imp
- activity on the source at the time of your export ? Your export has to be "logically" consistent.
Oh and about block integrity do a good full rman backup on your 11g database after the migration and check v$database_block_corruption after the backup. RMAN is your friend about physical integrity. Even after an incremental rman backup if a query on this view gives 0 result you can be sure you have no block corruption (at least if block_change_tracking is not used)
Best regards
Phil -
Valuechange listener called multiple times for checkbox in table.
Hi All,
I'm trying to understand how value change listeners work for checkbox components within a table column. I have a checkbox declared as below
<af:selectBooleanCheckbox id="sbc1"
valueChangeListener="#{pageFlowScope.classfiyBean.checkBoxValueChangeListener}"
immediate="true"
autoSubmit="true" />
I notice the value change listener is called multiple times. There are 6 rows in the table within which the checkbox is a component. It is called 6 times for a change. How do I prevent this from happening as it's over writing the values of the other rows as well.
Scenario : The page is based on a human task, so the outcome button cannot be set to Immediate = true since there are other validations on the page.
JDev: 11.1.1.4
Thanks
PPHi
Please make sure that Is there any logic being implemented in WD MODIFY VIEW of view controller.
If yes that may be the cause of your problem because WDModifyView() is being called every time u perform an action.
or
Try to Invalidate current context node which is bound to table UI element and actually containing data at run time. I think this node is not being refreshed. Try to refresh it in Search Button action.
or
Check your loop code snippet, if you implemented it anywhere.
Mandeep Virk -
Is it possible to use Checkboxes with Table Views?
Hi,
I need help with adding checkbox. Here is the detail of what I have.
In my application page, I have the Region Definition:
Type - SQL Query (PL/SQL Function body Returning SQL Query)
Region Source -
DECLARE
l_sql VARCHAR2(50);
BEGIN
Call Function_One(arg1, arg2 ..) ;
IF ( :P11_REQ = Value1 ) THEN
l_sql := ' SELECT Col1, Col2, Col3 FROM View1 ' ;
ELSE
l_sql := ' SELECT Col1, Col2, Col3 FROM View2 ' ;
END IF;
RETURN l_sql;
END;
Please note:
1. ' View1 ' and ' View2 ' are views on two tables.
2. The checkboxes are needed to select rows from these views to be inserted into another table for further processing.
Questions:
1. Can Checkboxes be added to views also, or, to tables only?
2. If checkboxes can be added to views, How can I do that to each of the rows that will be returned?
3. Is there a way to use ' Select * FROM View1 ', and be able to add the checkbox to each of the rows ?
Would appreciate your help.
VasanVasan,
I usually call a plsql function to generate the HTML when I need a custom component like that. ie: create a procedure in a package. this should give you the idea. I usually create a dynamic plsql region to call the below procedure like this
begin
printTableWithCheckboxes();
endl;
procedure printTableWithCheckboxes is
begin
htp.p('<table>');
for rec in (select id, name from test) loop
htp.p('<tr>');
htp.p('<td><input type="checkbox" name="' || rec.name || '" value="' || rec.id || '" /> </td>');
htp.p('</tr>');
end loop;
end printTableWithCheckBoxes; -
Checkbox Within Table Control At Selection Screen
Hello, there.
In my selection screen (dialog) I'm using a table control which is based on an internal table.
In that internal table I have a simple Yes/No field (declared as type XNULL for example).
The problem is that I want it to be displayed as checkbox on the selection screen's table control and not as a simple string with size = 1 like it is..
I hope it's clear and understood ...
Thanks in advance,
RebekaRebeka,
Its very simple,
In that field of table control just drag & drop the checkbox.
In Screen modules ,
loop at itab.
If Field = 'YES'.
Checkbox = 'X'.
else .
clear checkbox.
endif.
endloop.
Regards,
TAlwinder -
Checkboxes in table that show value
Hello,
I have a series of questions that I want the user to be able to answer yes or no by selecting or deselecting a checkbox. I have this working fine now, except when it is loaded again all the checkboxes are unchecked, even though some of my values are 'true'.
I've tried setting the 'selected' property on the checkbox to a binding of the value in the table, as #{row.answer}, but that did nothing. I got it to work by using a #{row.answer == 'true'}, but then the checkbox became read only, which destroys the purpose.
Lastly, I tried having two separate checkboxes, one that was selected by default and one that was unselected, then I set the render property to #{row.answer == 'true'} or #{row.answer == false}, respectively. This works the first time I load the page but after I submit or change sections they all show as unselected again.
How can I get the checkboxes to reflect the current value?
Thanks,
-NHi Frank,
Thanks, that's exactly what I'm looking for.
I'm getting stuck though and I can't figure out why. I got the sample application to work very easily, but when I try to adapt it to my new project it doesn't show any value for StatusAsBoolean. I tried using the same table even and it remains blank.
Here's what I've done:
Created an entity object for the table.
Created a view object based on the entity and added another attribute (StatusAsBoolean) and uncheck everything, set as type Boolean and Always Updatable.
Created a new class (SettingsViewRowImpl.java) and used the same code as in the class in the sample file.
Created a table on the .jsp page.
One thing I've noticed is that when I make a view object, it creates a SettingsViewImpl.java file. I tried putting the code in there but that crashes the application.
I hope I'm not frustrating you, I've been trying really hard to get this to work and I'm sure it's a really obvious mistake.
Thanks
Maybe you are looking for
-
Good morning! I am trying to transfer sound from a FantomX7 keyboard synthesizer to garageband through an interface (MAudio) and with a usb cable. I see the image of the sound being recorded but I cannot hear anything - I know that there is a speak
-
Can I buy a SIM in the UK for the World Phone and use on local service?
I am travelling to the UK and have 2 old World Phones. Can I buy a Vodaphone "pay as you go" SIM card and activate these phones under local UK service for my kids while we are there? I really only need phone and text or BIM service. I believe the UK-
-
Problem with N95 Desktop after upgrade to 20.0.015
Hello, I upgraded my phone's firmware to version 20.0.015 this morning. Before starting the update, I had backed up the phone's memory to my memory card. When the update was finished, everything worked fine until I decided to restore everything from
-
DVD drive not working on Satellite Pro U400-142
My DVD drive is not working. I insert a disk, can hear the drive working for some time but then nothing happens. I checked 'Device Manager' - under DVD/CD-ROM drives it shows: MAT****A DVD-RAM UJ862AS, but there is a black exclamation mark on a yello
-
OB28 - Validation for the G/L Account creation year
Hello, Is there any possible way of doing this validation? Validate G/L Account by the year of creation? Ex: No G/L account cant be used if created in 2008!?? Regard, and thanks in advance, Rui Ribeiro