Pushbutton disabled in a table
Hello.
I would like to see a pushbutton enabled at the end of each row depending the result of the comparaison of two fields in my table.
To explain much better, I want that only the personne who created the recording in the table would be allowed to delete its. So I check if the ID of the recording creator is the same as the current user, and depending this result, the pushbutton to delete the row has to be enabled.
So I marked the checkbox "disabled" in my pushbutton options and written the following condition :
bool ( if ( @ID == @CurrentID , 1 , 0 ))
The function is ok (I checked by displaying the result in another variable)... But it doesn't work !!!
So I tried to write directly "true" or "false" in the display condition, and : There is no difference between both, the pushbutton is desactivated in each case. So I don't understand.
Can Somebody help me please ?
Hi,
I tried the same and it worked for me the way it should. Just make sure that you have assigned some action to the button because if we haven't assigned any action then it would always be disabled.
Also, your table is set as Editable and not Read Only
Regards,
Murtuza
Similar Messages
-
How to disable fields in Table control???
Hi
How to disable fields in Table control??? I want to disable particular row in table control when enter datas are correct.lets take as example ME41 or ME51 table control.
Can anyone tell how to do disable in this table control
Points will be rewarded if its helpful.
Thanks
senthilIf you want to disable the row then you can use
in pbo module create a module in side loop,
loop at itab with control tc.
module change_screen.
endloop.
in module,,,,,
loop at screen.
if condition.
screen-input = 0.
modify screen.
endif.
endloop.
Regards
Vijay -
Disabling button if table is filtered
hi,
i have a command button and a adf table on a jspx page.
i am keeping filtering enabled for table.
my requirement is i have to disable button if table is filtered and as soon as table becomes 'normal' or 'un filtered' i should enable this button.
can anyone suggest a way to implement this use case?
thanks.Don Kleppinger wrote:
Just add a query listener to the table which gets called whenever query is filtered. Detect if the list of filter criteria is empty and refresh your button accordingly
public void queryListener(QueryEvent queryEvent)
FilterableQueryDescriptor desc = (FilterableQueryDescriptor) queryEvent.getDescriptor();
Map<String, Object> filterCriteria = desc.getFilterCriteria();
// refresh your button here.
// call default query listener to execute the query
Object query = JSFUtils.resolveExpression("#{bindings.MyROViewQuery}");
((FacesCtrlSearchBinding) query).processQuery(queryEvent);
to avoid using the internal FacesCtrlSearchBinding class use the example from
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/30-table-filter-queries-169172.pdf
invokeMethodExpression(
"#{bindings.DepartmentsView1Query.processQuery}",
Object.class,QueryEvent.class,queryEvent);
Edited by: Don Kleppinger on Jun 4, 2013 12:02 PMthanks Don.
on this -
Detect if the list of filter criteria is empty and refresh your button accordingly
to detect i am using this code:
boolean filterApplied = false;
while (iterator.hasNext()) {
String key = iterator.next().toString();
String value = filterCriteria.get(key).toString();
if (!value.isEmpty()) {
filterApplied = true;
break;
System.out.println("filterApplied --> " + filterApplied);
is there anyway better way of detecting?
Edited by: user5636757 on Jun 6, 2013 10:46 AM -
How to Enable and Disable column in Table Control.
Hi all,
I want to make certain column of Table control as Enable or Disable on Button action.
Enable means ready for input and Disable means not ready for input.
Please send me sample code.
Thanks in advance.Hi Vipin,
You have to loop through the table columns to set the properties in the PBO of your screen.
Here is the sample solution.
delcare a workarea for the columns in the table control in your top include.
Table Control .
CONTROLS: TAB1 TYPE TABLEVIEW USING SCREEN '0100'.
DATA: WA_COLS LIKE LINE OF TAB1-COLS.
in your screen
PROCESS BEFORE OUTPUT.
MODULE INTIALISE_100.
*& Module 0100_INTIALISE OUTPUT
MODULE INTIALISE_100 OUTPUT.
LOOP AT TAB1-COLS INTO WA_COLS.
WA_COLS-SCREEN-INPUT = 1.
MODIFY TAB1-COLS FROM WA_COLS TRANSPORTING SCREEN-INPUT.
ENDLOOP.
ENDMODULE. " 0100_INTIALISE OUTPUT
modify the screen-input property as required for the table control columns.
Please provide points if helpfull.....
Thanks,
Karthik
Message was edited by: Karthik
Karthikeyan K -
Disabling fields in table Maintenance generator
Hi Experts,
I would like to restrict some fields in table maintenance generator dynamically/ statically.
Here is the situation.
I have generated table maintenance for the table ZMARA and I have created three transactions for the above single table maintenance generator.
i.e .. Transaction --- Table
ZT1 --- ZMARA
ZT2 --- ZMARA
ZT3 --- ZMARA
I am using above three transactions in my module pool program. Based on the certain conditions I am calling different transactions i.e ZT1, ZT2, etc
Here is my requirement:
Suppose if I call ZT1 transaction, I need to display only few fields. i.e ZMATNR, ZMTART, ZPRODH.
or remaining fields should disable. User should not allow to change the content, even if it is new entries/existing entries. only ZMATNR, ZMTART, ZPRODH.
Suppose if I call ZT2 transaction, I need to display only few fields. i.e ZMATNR, ZMTART, ZHTSCODE
How can we restrict dynamically when you call table maintenance generator table through transaction
or
How can we generate table maintenance for few fields?
Edited by: r badveli on Mar 16, 2009 4:27 PM
Edited by: r badveli on Mar 16, 2009 4:27 PM
Edited by: r badveli on Mar 16, 2009 4:28 PMHi ,
go to Se11->Table maintenace generation. Double click on screen to edit and assign the field you want to display/hide to groups. In PBO , after the following lines..
LOOP AT EXTRACT WITH CONTROL
TCTRL_ZMARA CURSOR NEXTLINE.
MODULE LISTE_SHOW_LISTE.
ENDLOOP.
Write a new module in PBO and edit the SCREEN as per the Tcode, you are calling,,'
Hope this helps you
Rj -
Disable columns in table control based on condition
Hello Gurus,
I am having a table control in my module pool program.Out of 25 columns , I am having 12 columns on months wise like (jan, feb, march....).Now my concern is based on current month I want to enable the column of month rest all months will be in disable mode.So that the user can enter his/her time of work.Could you please tell me any way.I tired to read tc-cols and stored in col with index but its not working I wrote this code for first month without any condition
READ TABLE tC-COLS INTO col INDEX 22.
col-SCREEN-INPUT = 0.
MODIFY tC-COLS FROM col INDEX 22.
but its not working.I wrote this code in PBO as well as i tried in PAI as wellstill my columns is in enable mode.Also when user clicks on button then only the table control required fields should start working like months enable/disable process.for eg. I am having 2 button one is Create and other is Search on both these buttons after click the condition for enable/disable months should work.
Thanks
GauravHi,
In my scenario, I have used months as radio buttons. A month is selected and "enable" button must be clicked so that only the corresponding column of the month turns into an editable mode.
I have attached the output.
The field can be disabled or enabled by using the line type of <table_control_name>-cols.
It contains the screen elements. For disabling / enabling, use active element in screen.
This must be written in PBO event of the corresponding screen containing the table control.
Coding:
* Type-Pools
TYPE-POOLS: abap.
* Types
TYPES: BEGIN OF ty_month_emp,
jan TYPE char30,
feb TYPE char30,
mar TYPE char30,
apr TYPE char30,
may TYPE char30,
jun TYPE char30,
jul TYPE char30,
aug TYPE char30,
sep TYPE char30,
oct TYPE char30,
nov TYPE char30,
dec TYPE char30,
id TYPE char10,
name TYPE char10,
age TYPE char10,
END OF ty_month_emp,
ty_t_month_emp TYPE STANDARD TABLE OF ty_month_emp.
* Data
DATA: gs_month_emp TYPE ty_month_emp,
gt_month_emp TYPE ty_t_month_emp,
ok_code TYPE sy-ucomm,
r1 TYPE char1 VALUE abap_true,
r2 TYPE char1,
r3 TYPE char1,
r4 TYPE char1,
r5 TYPE char1,
r6 TYPE char1,
r7 TYPE char1,
r8 TYPE char1,
r9 TYPE char1,
r10 TYPE char1,
r11 TYPE char1,
r12 TYPE char1.
* Table Controls
CONTROLS: tc TYPE TABLEVIEW USING SCREEN 9000.
* Field-Symbols
FIELD-SYMBOLS: <fs_cols> LIKE LINE OF tc-cols.
* Initialization
INITIALIZATION.
CALL SCREEN 9000.
*& Module ENABLE_COLUMN OUTPUT
* text
MODULE enable_column OUTPUT.
LOOP AT tc-cols ASSIGNING <fs_cols>.
PERFORM enable_col USING: r1 'GS_MONTH_EMP-JAN' CHANGING <fs_cols>,
r2 'GS_MONTH_EMP-FEB' CHANGING <fs_cols>,
r3 'GS_MONTH_EMP-MAR' CHANGING <fs_cols>,
r4 'GS_MONTH_EMP-APR' CHANGING <fs_cols>,
r5 'GS_MONTH_EMP-MAY' CHANGING <fs_cols>,
r6 'GS_MONTH_EMP-JUN' CHANGING <fs_cols>,
r7 'GS_MONTH_EMP-JUL' CHANGING <fs_cols>,
r8 'GS_MONTH_EMP-AUG' CHANGING <fs_cols>,
r9 'GS_MONTH_EMP-SEP' CHANGING <fs_cols>,
r10 'GS_MONTH_EMP-OCT' CHANGING <fs_cols>,
r11 'GS_MONTH_EMP-NOV' CHANGING <fs_cols>,
r12 'GS_MONTH_EMP-DEC' CHANGING <fs_cols>.
ENDLOOP.
* LOOP AT tc-cols INTO ls_cols.
* IF r1 = 'X'.
* ls_cols-screen-active = 1.
* else.
* ls_cols-screen-active = 0.
* ENDIF.
* modify tc-cols FROM ls_cols INDEX sy-tabix.
* ENDLOOP.
ENDMODULE. " ENABLE_COLUMN OUTPUT
*& Form ENABLE_COL
* text
* -->P_0170 text
* -->P_0171 text
* <--P_<FS_COLS> text
FORM enable_col USING p_radio TYPE c
value(p_screen_name) LIKE screen-name
CHANGING pa_cols LIKE LINE OF tc-cols.
IF p_radio = abap_true.
IF pa_cols-screen-name = p_screen_name.
pa_cols-screen-active = 1.
ELSE.
pa_cols-screen-active = 0.
ENDIF.
ENDIF.
ENDFORM. " ENABLE_COL
Thanks & Regards,
T. Prasanna Kumar -
Enable/Disable Rows In table Control
I m getting material number for particular material doc. if i get N rows in output i want to disable all other rows of table control.
Moderator message: please search for previous solutions to similar problems before asking.
Edited by: Thomas Zloch on Nov 20, 2010 7:24 PMHi,
In PBO, Loop at your table control lines, create a module inside it and use
LOOP AT SCREEN.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDLOOP.
Regards,
Senthil -
Hi,
I'm trying to disable a row... not a column in a table control so the user can't change it, however I'd like the previuos and next rows in the table control to be enabled for modifications. I know it sounds simple, but i havén't been able to do it, anyone knows how to?Hi,
Disable all the columns for that row..
Example
PROCESS BEFORE OUTPUT.
LOOP AT ITAB WITH CONTROL TC.
MODULE DISABLE_ROW.
ENDLOOP.
MODULE DISABLE_ROW.
Check for the conditions where you have to disable the row.
if the conditions are satisifed.
IF CONDITION IS SATISFIED.
LOOP AT SCREEN.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
The above will disable all the columns in that row..
ENDMODULE.
Thanks,
Naren -
Hhow to disable invoice detail table
Hi
I've fussion web applicateion developed on Jdeveloper 11.1.2.3.0
I've a page showeing Purchase invoice from 2 database tables
first table for invoice Info such as purchase_id,Purchase_date,vendor,location,Inoice_statuse wither invoice is complested or Not Completed
as af:form on the web page
second table is for invoice details purchase_id,item_id,qty,price
as af:table on the web page
and I use the Inoice_statuse filed to set the row as non editaable in the form row
by overwriting isattributeupdatable method and it works fine
But Iwant also to disable the table of the same invoice
my relationship between the two tables is purchase_id
any one can help by example if itis possible
thank you
Edited by: user451648 on 02/04/2013 01:10 صHi,
Based on my understanding of the issue, you have a master detail screen (master as form i.e. invoice header and detail as adf table i.e. invoice details) and based on certain condition, you want the below child table to be enabled/disabled.
1. You cannot make the entire af:table component disabled/enabled by any condition, instead you can do it on the columns inside af:table.
easy way to get this done in this method is , Define a scope variable(request scope should be fine) and set the value to true /false programatically and use it in behavior section in property palette of af: table columns so that you just need to update the request scope variable as per your need and that will take care of everything.
2. You can override isattributeUpdatable method in child vo as well for all attributes which you display on the screen
Regards,
Ravi Nuka -
Need to Disable field in Table maintenance generator
Hi Frds,
I have created a custom table .But i stuck at one point. In the TMG one field is User ID and next field is filled with Full name of this User ID(made it noneditable). To get user name i implement '01' event in TMG. and its working fine. But when i change the user ID in the row ramdamly the user name is not updated. its because Event not trigger.
Please help me by giving valuable suggestion either of two query.
1) When any row field value get change. Which TMG event trigger and capture the changed row
2) How can i make field disable once it get filled and saved.
Thanks
ImranHi,
When you create any entry in TMG event get occurred is 05 and if you are changing any row content than you have to use 01. And if you want to disable fields ,double click on overview screen number which is you have given when you created TMG and than it opens flow logic of screen than click on Element List tab and uncheck the fields which you wants dsiable in input column as i am attaching screenshot have a look at it.
in this user ID is unchecked.
Regards,
Shahezad -
Disabling Textfield in Table which exist under subform under the table
Hi
I am new to Interactive forms. Here is my node structure which is available in following path for your reference.
http://i44.tinypic.com/leejn.jpg
I want to disable the two fields(AmendCapital & AmendExpense) at runtime which are available under the tblInvestmentByYear table based on the following condition.
I need to read the value of the "year" filed which is under table(tblInvestmentByYear).
Then need to read the current system year( only year YYYY).
If the value of the "year" is less than the current system year . I need to disable( make read only) those two fields which are under table.
For this validation i have written the following script: under table initialize event with language as java script. But it is not working means it is not disabling the two fields.
var yearInfo;
yearInfo = xfa.resolveNode("RequestData.P1.sfBidRequest.sfPage2.tblInvestmentByYear.Row1[0]);
var todayDate = Date();
var currYear = Num2Date(todayDate, "YYYY");
if( yearInfo.Year.rawValue < currYear.rawValue){
* P1.sfBidAmendment.sfPage2.tblInvestmentByYear.Row1.AmendCapital.access="readOnly";*
* P1.sfBidAmendment.sfPage2.tblInvestmentByYear.Row1.AmendExpense.access="readOnly";*
If i write only following two lines of the code with out rest of the code in table(tblInvestmentByYear) initialize event it is working file if add the rest of the lines , it is not working.
P1.sfBidAmendment.sfPage2.tblInvestmentByYear.Row1.AmendCapital.access="readOnly";
P1.sfBidAmendment.sfPage2.tblInvestmentByYear.Row1.AmendExpense.access="readOnly";
I have following questions.
1) In which control or event i need to write my code to work this scenario. Please guide me.
Which is the best event to use or where to write.
It needs happen on as soon as form is loaded. I dont need to click any event. Year value will sent from the back end which available in Table.
ThanksHi Lakshmipathi,
The export control log can be accessed by going to delivery Extras-> Export license log
We need a table that stores the determined license for each item in a delivery document ( as shown in the below screenshot)
Regards,
Jagan -
In disable fields in table maintenance
Hi,
In table maintenace I have done with save user id and last changed date. Now I need to make this fields disable(in gray), means no it should not be edited manually in table maintenance. It should only pick up the system.
if any one have code for this and also in which maintain event i need to do this, please post me.
Thanks in Advance,
Ravihi,
in SE80
goto Function Group
then click on Screen
then click on Element List Tab
below u can see list of ur fields strting with ZTT-......
and against that u can have to uncheck the checkbox in INPUT column ......
so that the input for the field will be disabled..... when u go in edit mode......
if any query revert back........
reward points if useful.......:-)
and mark the post answered once ur problem is solved .... -
CreateInsert pushbutton at bottom of table/iterator and linenum
ENVIRONMENT: 11gR1 / Oracle10g database
Hi,
I'm using pushbutton bound to createInsert for a detail iterator. In various pages, I'm using <af:table> or <af:iterator>. In both situations, it adds rows at the top of the top or above the previous row in an <af:iterator>
Ideally I'd like to add at the bottom.
I'm wondering how I can do that. I tried making an AM method with something as follows and binding to a button, put it doesn't refresh the page to show the new row.
peudocode
newRow = vo.createRow();
newRow.setAttribute(x,y);
vo.insertRowAtIndex(vo.getRowCount());Is this the right approach?
I also have a LineNum attribute that I'd like to autoincrement from 1 to x for every unique key. Using a databse sequence would autoincrement from the last value regardless of a unique key, not start at 1 for each new unique key.
Thanks in advance.After you add a row you can sort and refresh the table in such a way that the new row to appear at the bottom. That depends on the sql query.
you can use af:table varStatus to have unique number.
varStatus="vst"
"#{vst.index}"
Edited by: puthanampatti on Oct 28, 2009 5:05 PM -
How i can disable MONITORING temp tables
In the Oracle 10 g database stats are gathering using
Gtaher_stats_job
current setting is statictics _level =Typical
i need to disable the monotoring for temp tables
i try this command it will not change
ALTER TABLE "RDC"."INV_TEMP"
NOMONITORING
How i can disable this , i read some artikel this feature is disabled in oracle 10g
how i can disable
tks
rdaJustin Note
I would suggest that this is probably a bad idea, though. If there are no statistics on an object,
you're basically asking the CBO to work blind. Why not gather statistics after loading a fresh set of data
into the table?
I am running stats once a week , so i cannnot gather fresh set of dataNicolas
setting stats to a given value and lock them (to be not set to 0 by any gather stat process) may help as well.
Justin
Nicolas.
I cannot understand this >>to be not set to 0 by any gather stat processOk my process as follows
through sqlldr i load a data to temp table , i have a after insert trigger
once the data insert into temp table it check for some condition and
fire this trigger and insert into Permanent Table,
After the process finished the temp table truncated.
this whole process running every day .
I already mention stats are collected once a week , no point i keep the stats
for this temp table and suppose if i keep , it will give wong execution plan
and insert into this temp tabel will be slow -- am i right in this step
This is the reason i dont want stats at all in temp table
Thanks Justin & Nicolas
Best rds -
Enable/disable rows of Table control
Hi,
I am showing n number of records in a table control. These number of records may wary depending on a X condition.
I have also created a button with which user can create a new record from the same tabkle control and t/f back that new value in the itab.
Now, when table control is displayed it WILL have certain records in it. I want those records to be in the INPUT = '0' state and rest of the table control lines should be INPUT = '1'.
I am trying....
PROCESS BEFORE OUTPUT.
MODULE status_0101.
LOOP AT ts_store WITH CONTROL tabc CURSOR tabc-current_line.
module change_scr_attr.
ENDLOOP.
module change_scr_attr output.
CASE ok_code.
WHEN 'DISP'.
Displays all the records in INPUT = '0' state.
LOOP AT tabc-cols INTO cols WHERE index GT 0.
cols-screen-input = '0'.
MODIFY tabc-cols FROM cols INDEX sy-tabix.
ENDLOOP.
WHEN 'CREA'.
if * * disable the CDC Column
* disable Delete shortcut.
REFRESH ts_store.
LOOP AT tabc-cols INTO cols WHERE index GT 0.
IF ts_store-zstcdc_store IS INITIAL.
cols-screen-input = '1'.
ELSE.
cols-screen-input = '0'.
ENDIF.
screen-active = '1'.
MODIFY tabc-cols FROM cols INDEX sy-tabix.
ENDLOOP.
LOOP AT tabc-cols INTO cols WHERE index GT 0.
IF cols-screen-input = '0'.
cols-screen-input = '1'.
ELSEIF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY tabc-cols FROM cols INDEX sy-tabix.
ENDLOOP.
LOOP AT SCREEN.
IF ts_store-zstcdc_store IS INITIAL.
screen-input = '1'.
ELSE.
screen-input = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDCASE.
endmodule. " change_scr_attr OUTPUT
I have waded thru few threads but I dont get it.
Plz suggest!!
~Sid
"Max points are assured"Hi....
Actually.... our table control.. is by defalut make disable the empty rows... which are not having data...
because... the process of dispaly table control like this...
1.Fetching the records from database into one itab...
2.Capturing the itab lines with following sytax...in the PBO module..
> MODULE <TC>_CHANGE_TC_ATTR OUTPUT.
> DESCRIBE TABLE ITAB LINES <TC>-lines.
> ENDMODULE.
with this you are sizing the table control as for itab size...
3. Filling or Attaching the itab with Table control...
> LOOP AT ITAB
> WITH CONTROL TC
> CURSOR TC-CURRENT_LINE.
> MODULE TC_GET_LINES.
> ENDLOOP.
So in above module we can fill data and can disable and enable rows of certain condition...
So the condition aplleid rows should be disable and remaining enable.. and important thing is empty rows should be defaultly disabled mode...
But.. Here you want to appear empty rows should be in enable mode...
For that in second step.... modify the code like this....
> MODULE <TC>_CHANGE_TC_ATTR OUTPUT.
> DESCRIBE TABLE ITAB LINES <TC>-lines.
> <TC>-lines = <TC>-lines + 4.
> ENDMODULE.
So with this you can get 4 empty and enable lines...
and if u are not having 2nd step in ur coding.. just write it now.. it will solve ur problem...
Pleae get back to me if you want any further clarification...
Thanks,
Naveen.I
Edited by: Naveen Inuganti on Jun 30, 2008 5:03 PM
Edited by: Naveen Inuganti on Jun 30, 2008 5:50 PM
Maybe you are looking for
-
How to add addresses to groups in iPad? How to send to group?
Address book has not synced properly from my computer to Mobile Me for ages, well before I added my iPad to my stable of products. I've gone through all the advice here and traveled unsuccessful loops to push it or force it to sync again. I deleted e
-
How can I turn off auto-capitalization for Mail in Mountain Lion?
How can I keep mail.app from capitalizing the first letter of sentences? I have turned off auto-correct both at the system level and in Mail, and yet I cannot seem to keep Mail from capitalizing the first letter?
-
Generics and warning free code
Is it possible to cast to a generic class without compiler warnings? Object object = null; Comparable comparable1 = (Comparable) object; comparable1.compareTo(object); // warning: unchecked call Comparable<Object> comp
-
ok, so i have a vocal track, and the friend of mine who did it said some pretty vile things (and trust me, when i say vile, i mean viiiiiiiiiiiile! haha) so what id like to do is go in and cut out the small pieces of audio where those lovely words re
-
Itunes updgraded and now it continues to open on its own
After downloading new version of itunes it continually opens on it's own after I close it.