Setting Non-Editable property for selected Rows in jTable
Hi,
I want particular rows to be set non-editable within a jTable. For example. If I have seven rows as follows:
1
2 - (Non-editable)
3
4
5 - (Non-editable)
6
7
I want to set non-Editable property to the second & Fifth Rows(say) alone. Other Rows, I may edit.
How can I do this?
Thanks in adv.
TableModel has method
boolean isCellEditable(int rowIndex,
int columnIndex)
so you need to make your table model return false for these rows.
Similar Messages
-
ALV Grid OO : Set Field editable for selected rows
Hello ABAPers,
I used object cl_gui_alv_grid to created ALV grid and i succed to set an editable
field for all rows. However my request is to set it for and only for selected rows
I could get the row index but i didn't know how to use it
Thanks in advance
AmineHi Amine,
I think the standard SAP sample program might help you, BCALV_EDIT_02.
I will tell the procedure to make the selected rows editable on ALV.
1. Add a additional field of type LVC_T_STYL in the internal table that you are displaying in the ALV. LVC_T_STYL is a actually a table type.
2. Place a button on the ALV toolbar for EDIT/DISPLAY.
3. Once you press the EDIT button after selecting the rows, loop through the records which you have selected (you have already said that you have the index of selected records).
4. The table type LVC_T_STYL has fields for FIELDNAME and STYLE.
If you have 10 fields in the internal table, then all these ten fields name should be appended to the newly added field in the internal table (LVC_T_STYL) and their style should be populated with value cl_gui_alv_grid=>mc_style_enabled.
Regards,
Rahul MB -
WAD - input locking for selected rows in planning querie!?
hello guys,
i need some ideas - in which way i can lock data entry functionality in IP query for selected rows? some rows in the query have an indicator S (sum) and some I (input). so i have a chance for selection, which rows are input rows and which rows are sum (dsiplay) rows.
but all rows are input ready in sap standard querydefiniton and i need some ideas how i could implement an row specific inputfunctionality.
example
ITEM KEYFIGURE
line 1 Input input ready
line 2 Input input ready
line 3 Sline display only/ no input
line 4 Input input ready
dataslices are no option, because i need to change the "Sline-rows" data via planning functions.
i need ideas for web, not excel.
thx for your ideas!
Edited by: David Jahn on May 4, 2010 2:03 PMHi David,
of course, it is possible to use two structures in BI-IP, e.g. one containing the key figures (may be restricted) and another one used in the rows where one uses only characteristic values. But then the number of lines in the row structure is static. It is possible to drill-down other characteristics as ususal.
One idea is to use you characteristic containing the 'S value' as a navigation attribute and to create a row structure containing two lines, one with the restriction # and one with S and the corresponding setting for input readyness (maybe a cell definition for input readyness is needed here). Then drill-down by the base characteristic of the navigation attribute. What is not so nice then that one will get a group change: drill-down characteristic by the row structure; but the system generated characteristic relationship for navigation attributes makes the non existing combinations not input ready.
Regards,
Gregor -
How to hide edit link for some rows in report? (according to value of col)
Helo,
How to hide edit link for some rows in report? (according to value of column)
regards
siyavuşHi siyavuş
You can do this by taking the edit link off the report and putting it into your report SQL.
Use something like Select CASE WHEN (condition) THEN
'Put your edit link in here as an html Anchor like<a href="(target)">Edit</a>'
ELSE
tt.value
END edit_link
FROM test_table tthope it helps,
Gus..
You can reward this reply (and those of other helpers) by marking it as either Helpful or Correct.
This allows forum users to quickly find the correct answer.
;-) -
Setting the editable property of a datagrid column dynamically
Hi,
Im trying to set the editable property and renderer is editable property for a datagrid column to false on the creation complete event of the datagrid.But It does not work.While visible property works.why doesnt the editable property work.The particular column has a renderer which is a text box.and the editable property is set to false initially.Any Suggestions or ideas on how to achieve this will be of great help.Eu tenho vontade de estar devidamente por dentro de tudo isso.
-
How get values of columns for selected rows in SortingTable
Hi,
is possible to get values of more columns for selected rows? I have SortingTable that have 1st column loaded from list and 2nd and 3rd columns are text areas where user must write some text. I need way how to get values from all three columns for selected rows.
My table looks like this:
System name I User Account I User Password
system1 ...............jblack ............. passw1
system2 ...............pdowe..............p@ssw
system3 ...............ekie................. pas123
Column System name is loaded from list, columns User Account and User Password are Text class. How can I get values for all three columns in case that I select e.g. system1 or system1 & system2?
I read [this post|http://forums.sun.com/thread.jspa?forumID=764&threadID=5220609] but there is described selection only for one column.
Code of my SortingTable is following:
<Field name='tblDalsiSystemy'>
<Display class='SortingTable'>
<Property name='align' value='center'/>
<Property name='sortEnable' value='false'/>
<Property name='selectEnable' value='true'/>
<Property name='pageSize' value='5'/>
<Property name='pageButtonAlign' value='center'/>
<Property name='columns'>
<List>
<String>System name</String>
<String>User Account</String>
<String>User Password</String>
</List>
</Property>
</Display>
<FieldLoop for='y' in='lstSystemList'>
<Field name='SystemName'>
<Display class='SortingTable$Row'>
<Property name='key'>
<ref>lstSystemList</ref>
</Property>
</Display>
<Display class='Label'>
<Property name='align' value='center'/>
<Property name='value'>
<ref>y</ref>
</Property>
</Display>
</Field>
<Field name='UserAccount'>
<Display class='SortingTable$Row'>
</Display>
<Display class='Text'>
<Property name='size' value='10'/>
<Property name='value'>
</Property>
</Display>
</Field>
<Field name='UserPassword'>
<Display class='SortingTable$Row'>
</Display>
<Display class='Text'>
<Property name='size' value='10'/>
<Property name='value'>
</Property>
</Display>
</Field>
</FieldLoop>
</Field>Getting value is performed by:
<ref>tblDalsiSystemy.selected</ref>Any help?
Thanks
PetrHi Ivan,
thanks for your advice - it works.
Here is my final code:
<Field name='tblDalsiSystemy'>
<Display class='SortingTable'>
<Property name='align' value='center'/>
<Property name='sortEnable' value='false'/>
<Property name='selectEnable' value='true'/>
<Property name='pageSize' value='5'/>
<Property name='pageButtonAlign' value='center'/>
<Property name='columns'>
<List>
<String>System name</String>
<String>User Account</String>
<String>User Password</String>
</List>
</Property>
</Display>
<FieldLoop for='y' in='lstSystemList'>
<Field name='SystemName'>
<Display class='SortingTable$Row'>
<Property name='key'>
<ref>lstSystemList</ref>
</Property>
</Display>
<Display class='Label'>
<Property name='align' value='center'/>
<Property name='value'>
<ref>y</ref>
</Property>
</Display>
</Field>
<Field name='Account[$(y)].login'>
<Display class='SortingTable$Row'/>
<Display class='Text'>
<Property name='size' value='10'/>
<Property name='value'>
</Property>
</Display>
</Field>
<Field name='Account[$(y)].passwd'>
<Display class='SortingTable$Row'/>
<Display class='Text'>
<Property name='size' value='10'/>
<Property name='value'>
</Property>
</Display>
</Field>
</FieldLoop>
</Field>Maybe it could be helpful for somebody another :-)
Petr -
How to set fire action event for particular rows in a table
HI All,
I have a requirement in which I want to set fire action event for particular rows in a table based on some condition.
The table has columns like fullname,employee id etc.
So i want to set fire action event for particulars rows only which will saisfy some condition.Atanu,
Your approach(setting fire action for few rows) seems not possible. Better to go ahead with workaround.
Do you want this functionality in processRequest(while page loading) or processFromRequest(on some event) method ? Give more explanation regd. your requirement ?
In either case loop through the rows and when your condition is met write the action to be performed in controller.
Regards,
Anand -
Error in receiving tableview data for selected row
Hi Collegues ,
We plan to realize an application for the maintanance of planning data . In the first step we created a value help page by using a tableview with iterator class ( 1 of the 3 methods of the Interface was filled with logic ) . We don't use any controller for that application .
A global internal table with the relevant help value data ( fgrvalues ) is used for the tableview and the call is :
TYPE I .
+CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
CLEAR ONCLICKEVENT.
IF EVENT_ID = CL_HTMLB_MANAGER=>EVENT_ID.
EVENT_DATA = CL_HTMLB_MANAGER=>GET_EVENT( REQUEST ).
IF ( EVENT_DATA IS NOT INITIAL ) AND
( EVENT_DATA->EVENT_TYPE = 'click' ) .
ONCLICKEVENT = EVENT_DATA->SERVER_EVENT .
ENDIF.
ENDIF.+
CASE ONCLICKEVENT.
WHEN 'take' .
TABLE ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = REQUEST
NAME = 'tableView'
ID = 'fgr1_vhelp' ) .
TABLE_EVENT = TABLE->DATA.
IF TABLE_EVENT->SELECTEDROWINDEX IS NOT INITIAL.
ROWSELECTION = TABLE_EVENT->SELECTEDROWINDEX.
-> ROWSELECTION - Content is now the index of the selected tableview row
We always get the selected row in TABLE_EVENT->SELECTEDROWINDEX and the table TABLE_EVENT->ALLCOLUMNNAMES filled ( column ZX_FGR1 is the 2nd column )
but we never got the tableview data for that tableview row no matter what we tried . We tried it with a tableview-event fired on 'rowselection' by user line-selection . We have deactivated the iterator or changed the BPS design value . With the same result - nothing was given back .
We found that the System-Call Return value of :
+system-call ict
did
ihttp_scid_get_form_field
parameters
m_c_msg " > c handle
name " > form field name value " < form field value
m_last_error. " < return code+
in the method IF_HTTP_ENTITY~GET_FORM_FIELD is empty . M_LAST_ERROR occurs with value '20' .
+ ASSIGN ROWSELECTION TO .
COLUMN_VALUE = TABLE_EVENT->GET_CELL_VALUE( ROW_INDEX =
COLUMN_INDEX = '2' ). -> Column Value is empty !!+
+CALL METHOD TABLE_EVENT->GET_CELL_VALUE
EXPORTING
ROW_INDEX = TABLE_EVENT->SELECTEDROWINDEX
COLUMN_INDEX = '2'
RECEIVING
VALUE = COLUMN_VALUE -> Column Value is empty !!+
+CALL METHOD TABLE_EVENT->GET_SIMPLE_DATA ....
-> Column Value is empty !!+ *----
What could be the reason for that problem ? In generally it must be possible somehow to read the tableview data for one or all rows of the mentioned tableview .
We hope that someone can help and are very thankful for a hint or solution . If you need more details please let us know .
Please Remark: It's no solution for us to read the data by using the created internal table fgrvalues and the selectedrowindex cause in a later step we plan to update an ODS table with the manual modified planning data of an editable tableview .
Thanks a lot in advance
Dirk LäuferHi collegues ,
It's done .
After we've got a very helpful little hint from Brian :
The <htmlb:tableView> renders a table to the browser. It does not keep a copy of the table. The browser will also never return the table. Never. What it can return are inputfields for each cell. But then only if each cell is custom rendered as an inputfield.
we could certainly solve the problem .
We set the field we want to get back from table view on not editable inputfield via the tableview-iterator method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START :
DATA: LCL_TABLE TYPE REF TO CL_BSP_BEE_TABLE ,
LCL_INPUTFIELD2 TYPE REF TO CL_HTMLB_INPUTFIELD .
CASE P_COLUMN_KEY .
WHEN 'ZX_FGR1'.
* Field Firm Group
CREATE OBJECT LCL_INPUTFIELD2.
LCL_INPUTFIELD2->ID = P_CELL_ID.
LCL_INPUTFIELD2->WIDTH = '100%'.
LCL_INPUTFIELD2->MAXLENGTH = 4.
LCL_INPUTFIELD2->TYPE = 'STRING'.
LCL_INPUTFIELD2->DESIGN = 'STANDARD'.
LCL_INPUTFIELD2->DISABLED = 'TRUE'.
LCL_INPUTFIELD2->VALUE =
GET_COLUMN_VALUE( COLUMN_NAME = 'ZX_FGR1').
P_REPLACEMENT_BEE = LCL_INPUTFIELD2 .
Now the method in OnInputPorcessing:
TRY.
CALL METHOD CL_HTMLB_MANAGER=>GET_SIMPLE_DATA
EXPORTING
REQUEST = RUNTIME->SERVER->REQUEST
ID = 'fgr1_vhelp'
ROW_IDX = TABLE_EVENT->SELECTEDROWINDEX
COL_NAME = 'ZX_FGR1'
CHANGING
DATA = FGRVALUES_LINE-ZX_FGR1 .
IF NOT FGRVALUES_LINE-ZX_FGR1 IS INITIAL.
* selektierte Firmengruppe übernehmen
ZX_FGR1 = FGRVALUES_LINE-ZX_FGR1 .
CALL METHOD NAVIGATION->SET_PARAMETER
EXPORTING NAME = 'ZX_FGR1'
VALUE = ZX_FGR1.
ENDIF.
CATCH CX_SY_CONVERSION_ERROR .
ENDTRY.
works properly as it should be ...
An enormous Thanksgiving to you , Brian !!!! -
Non-editable Color for TextInput
Hi,
Is it possible to set up, in a CSS, the backgroundColor of a
readonly text input?
So whenever it's set to readonly (editable=false) its
background will automatically
change to the color set up in the CSS.
I want to do something like this:
TextInput{
theme-color:haloGreen;
color:#005FA9;
readonly-color:0xF5F5F5; // or "non-editable-color"
Cheers,
Jarrod...you must completely fill in the background in a non-opaque color.
I doubt the 'non-opaque color' part might be a typoI think it is a typo, otherwise, like you, I don't know what they are trying to say.
Just using setOpaque(true), does NOT make a component opaque. It simply tells the the RepaintManger not to search the ancestor tree to find an opaque component. This makes painting more efficient if it doesn't need to search all the way up to the content pane of the window. By setting the opaque property you are guaranteeing that the component will paint its own background in an opaque color.
For example a JPanel is opaque and its paintComponent() method will invoke the fillRect(...) method to paint the background whatever color is specified by the setBackground() method.
So if you do panel.setBackground(Color,RED) this is valid.
However, if you do panel.setBackground( new Color(255, 0, 0, 128) ); this is invalid because you have set a background with an alpha value that results in a transparent color. In this case you will generally see artifacts in the background of the panel. If you want to do this, then you must also use setOpaque(false), so that the background of the ancestor component is painted first.
Edited by: camickr on Jul 8, 2008 11:18 AM
Fixed an incorrect reference from "non-opaque" to "opaque". -
Setting background for single row in JTable
Hi,
I have a table which uses the DefaultCellRenderer for cols0,1,3-5
while column 2 uses a custom renderer.
When user right clicks mouse on one of the rows i get the rowindex and colindex selected and tries to set background color for this row. but the whole table get painted(of course except 2nd column)...rather i need just the row to be colored.....any solution is greatly appreciated.the code is below....
int rowIndex=table.rowAtPoint(p);
int colIndex = table.columnAtPoint(p);
for (int i = 0; i < 6; i++) {
if (i!=2){
DefaultTableCellRenderer r = (DefaultTableCellRenderer) table.getCellRenderer(rowIndex,i);
Component c = taskListTbl.prepareRenderer(r, rowIndex, i);
c.setBackground(Color.yellow);
}Maybe my reply in this posting will help:
http://forum.java.sun.com/thread.jspa?forumID=57&messageID=1730267 -
Setting the update property of the row of a records group to false IN ORACL
hello
i have to populate a records group with the previous records user had entered as well as enable the user to enter new record in that RECORD GROUP IN ORACLE 6I FORMS.
I want that previous record that user had entered caN NOT BE EDIT .USER CAN SEE THESE RECORDS ONLY AND ACCORDINGLY ADD NEW RECORDS IN SAME RECORD GROUP.
PL TELL ME HOW TO DO THIS.
THANKS & REGARDS
VISHAL AGRAWALI also try for which u mentioned earlier but it is like selectting individual records to display in my tablular record group.
we are using following code for fetching data and displaying it into records group and also making all fetched record disabled.
code is given below :
PROCEDURE fetchdata(mf char) IS
cursor c1 is select dateofmtrl,rm1,rm2,rm3 from rawmtrl_graph
where
dateofmtrl between TO_DATE(TO_CHAR(ADD_MONTHS(SYSDATE, 0),'YYYYMM'),'YYYYMM') and
TO_DATE(TO_CHAR(ADD_MONTHS(SYSDATE, + 1),'YYYYMM'),'YYYYMM') - 1 and
mtrl_flag = mf
order by dateofmtrl ;
r1 c1%rowtype;
lstrec number;
cnt number :=1;
BEGIN
go_block('dtl');
last_record;
lstrec:=:system.cursor_record;
for ctr in 1..lstrec
loop
delete_record;
end loop;
first_record;
open c1;
loop
fetch c1 into r1;
exit when c1%notfound;
if :dtl.date1 is not null then
next_record;
end if;
:dtl.date1:=r1.dateofmtrl;
:dtl.opc:=r1.rm1;
:dtl.ppc:=r1.rm1;
:dtl.total:=r1.rm1;
end loop;
close c1;
last_record;
lstrec:=:system.cursor_record;
first_record;
for ctr in 1..lstrec
loop
SET_record_PROPERTY(:system.cursor_record,'dtl',ENABLED,PROPERTY_FALSE);
SET_RECORD_PROPERTY(:SYSTEM.CURSOR_RECORD, 'dtl',UPDATE_ALLOWED,PROPERTY_FALSE);
SET_RECORD_PROPERTY(:SYSTEM.CURSOR_RECORD, 'dtl',insert_allowed,PROPERTY_FALSE)
next_record;
end loop;
first_record;
END;
But it is not working...
givinng the erros that no such property for set_record_property
pl tell me how to modify the code to disable some selected raws in a record group............ -
Set of default values for Select-Options
Hi Gurus,
I have a requirement where I need to set default values for select options
ex: SELECT-OPTIONS: S_MTART FOR MARA-MTART
default values must be ERSA - HIBE- FHMI - DIEN - GEST
Please tell me how to do it.
Effective replies will be rewarded with full points
KarthikHi,
For each SELECT-OPTION, you can only specify one DEFAULT.
You must specify the default value g in its internal format, e.g. "SELECT-OPTIONS DATE FOR SY-DATUM DEFAULT '19931224'", not "... DEFAULT '24.12.1993'".
The default value g should normally be a literal because, at runtime when you use SUBMIT, it is transferred to the selection options table sel so early that no value can be assigned to the field g. System fields like SY-DATUM are an exception here because the system usually assigns values to them as soon as the report processing starts.
When you use user-defined selection screens in your programs that you do not call using SUBMIT, the DEFAULT value is transfered when the selection screen is first called. In this case, therefore, you can use other fields g.
regards,
sowjanya
Message was edited by: sowjanya suggula -
Non-Repudiation property for Service Operations
Hi guys,
Does anyone has the knowledge of what is the Non-Repudiation property used for on the Service Operations configuration component ?
I can not find the detail information from the PeopleBook or Oracle Support Website. Any docs are welcomed.
Thanks in advance!
DennisThis is quite good explained in :
PeopleBooks > PeopleTools 8.52: PeopleSoft Integration Broker Administration > Setting Up Secure Integration Environments > Implementing Nonrepudiation -
Make columns editable in a selected row of SALV
Hello ,
I have a requirement,im using SALV for listing some records,On lead select of a row in SALV,i need to make two columns of that selected row editable and make the remaining in display mode.
Useful answers would be rewarded.Hi Reema Elsy Easow,
Changing the type of a single field in a column is i think not possible. you can make whole column editable.
I will suggest you a solution-- when a row is selected for editting , you can display that row in another alv or table with single row and provide the record for editiing.
Regards
Sarath -
Non-editable mode for customer master data in VA01 and VA02
Hi all,
User requirement is they don't want to give permission to change customer master data (payer & ship-to ). I didn't find any user exit to do screen non-editable.
Can any one help me in this..
Regards,
SudhakaraHi Sudhakar Reddy,
For this transaction code user exits available :
SDTRM001 Reschedule schedule lines without a new ATP check
V45A0001 Determine alternative materials for product selection
V45A0002 Predefine sold-to party in sales document
V45A0003 Collector for customer function modulpool MV45A
V45A0004 Copy packing proposal
V45E0001 Update the purchase order from the sales order
V45E0002 Data transfer in procurement elements (PRreq., assembly
V45L0001 SD component supplier processing (customer enhancements
V45P0001 SD customer function for cross-company code sales
V45S0001 Update sales document from configuration
V45S0003 MRP-relevance for incomplete configuration
V45S0004 Effectivity type in sales order
V45W0001 SD Service Management: Forward Contract Data to Item
V46H0001 SD Customer functions for resource-related billing
V60F0001 SD Billing plan (customer enhancement) diff. to billing
For ur requirement whixh exit is suitable plz check it out. other wise put breakpoint for userexit and check it out.
Rewards somr points.
Rgds,
P.Nag
Maybe you are looking for
-
Hi All, I have trying to use a user defined function in the XI message mapping. Here is the code of the User defined function : if (a != null) return "test"; else return "fail"; The mapping looks like : a -> UDF -> result. If I am sending t
-
Hi All, I really need your help. Is there any tools that can be used to do performance / Stress test in Oracle Flexcube? Does JMeter can be used to do that? Thanks for help. Taufix
-
TS3694 i cant restored my iphone 4S unkonwn error occurred (3194)
i want to know how to fix my error 3194... i cant do restored my iphone 4s because that error... my iphone 4s is version 6.0 but i want to make a version 5.1.1...
-
Generic Datasource using Infosets
Dear Experts What can be the problems we face when we do Generic Extraction based on Infosets in ECC or R/3 and what are the other alternatives to this one? Thanks for your inputs, Regards, NJ
-
What is the maximum size of the dmp(exp) file?
Friends, OS: RHEL AS 3.0 DB: Oracle 9iR2 Daily i am taking the dmp file backup using exp utility. Now the file size is 777MB. What should be the maximum size of the dmp file.? if it crosses 1GB, is it possible to copy the dmp file from production ser