Dynamically changing attributes of a field in view container UI element
In the layout of the web dynpro component I have added a view container UI element. I am populating the fields in the view container UI element in methods in component controller using the following code
*--Adding a Checkbox
lv_str = wd_assist->if_wd_component_assistance~get_text( '009' ).
CALL METHOD wd_this->att_wd_handler->add_parameter_field
EXPORTING
i_id = 'CHB_DOWNLOAD_CHECKBOX'
i_description = lv_str
i_value = lv_chb_download_checkbox
i_as_checkbox = abap_true.
*--Adding a Parameter
lv_str = wd_assist->if_wd_component_assistance~get_text( '010' ).
CALL METHOD wd_this->att_wd_handler->add_parameter_field
EXPORTING
i_id = 'CHB_DOWNLOAD_PATH'
i_description = lv_str
i_value = lv_chb_download_path
i_as_checkbox = abap_false.
Now based on the checkbox selection I want to make the field CHB_DOWNLOAD_PATH mandatory and also on F4 for CHB_DOWNLOAD_PATH I want a method to be called. Where must i write the coding for the above conditions and how? Please help.
hi
In your method there would be a parameter ie ON_TOGGLE where you can write the name of your event .
Whenever your checkbox will be clicked that event wil be called.
You can write your code in that event itself.
Regards
Kuldeep
Similar Messages
-
View Container UI element in a table popin dynamically
Hello people,
I create a WD Table dynamically using the runtime class. I also create the table popin and then I set it in the table using the method SET_POPIN from the runtime class.
Now my requirement is that I should be able to add the 'View Container UI Element' into this popin so that I can embed any other views into this VC UI E. I cannot find a way in which I can achieve this. I am able to do it statically but not dynamically.
Even though it is suggested that such a design would lead to performance issues, but I have to achieve this.
Regards
RohanHi Anita,
you cannot set metadata at element level of a node. When you set the metadata ( example mime type or file name ) for a particular element in the node , it changes for all the element. So you are always getting the file for the last row. ( most recent set metadata ).
Try using the inteface IWDCachedWebResource for file download.
For each row add a button, and associate an action "DownloadFile" for it. Use the following "onAction" for the said action.
public void onActionDownloadFile(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionDownloadFile(ServerEvent)
int selectedIndex = wdContext.nodeFileTab().getLeadSelection();
IPrivateView_pdfView.IFileTabElement file = wdContext.nodeFileTab().getFileTabElementAt(selectedIndex);
try {
IWDCachedWebResource webResource = WDWebResource.getWebResource(
this.
getByteArrayFromResourcePath("/sapmnt/PCD/global/config/cm/etc/pdf/"+
wdContext.nodeFileTab().getFileTabElementAt().getFilename(selectedIndex),
WDWebResourceType.PDF);
wdComponentAPI.getWindowManager().createExternalWindow(webResource.getURL(),"Download File",true).open();
catch(Exception e) {
// take some action
wdComponentAPI.getMessageManager().reportException(e.toString(),true);
//@@end
Hope you get a solution.
Regards
KK. -
Embeding ALV table in dynamically created view container UI element
Hi ,
I created a view container UI element dynamically .that is working fine . I am using standard ALV component . Now i want to embed ALV table in View container UI element dynamically > please help me in this .
Thanks in advance ,
Vijay vorsuHi,
I am not sure how to do add an ALV table dynamically but you can have a look at this blog which talks about creating and adding a TABLE ui element dynamically. And TABLE UI element may solve your problem.
http://mamma1360.blog.163.com/blog/static/314740992008127115551165/
Thanks,
Abhishek -
Embedding view in view container UI element
Hello,
I have a requirement which is given below:
I have a MAIN view where there is a view container UI element. This container holds one of 3 views(VIEW1,VIEW2 and VIEW3) depending on user input. Initially VIEW1 is displayed (this is set as the default view). Then the user navigates to VIEW2 and enters some selection criteria and confirms. Then VIEW3 is displayed with the entered selection criteria. Then the user clicks on search on the MAIN view and the RESULT view is displayed. When the user clicks on back functionality in the RESULT view,MAIN view is again displayed but the view container has VIEW1. The user wants to see VIEW3 in the viewcontainer in MAIN view.
Please let me know if there is anyway to achieve this.
Regards
NilanjanHi Nilanjan,
Create three context attributes V1,V2,V3 of type char1.
Default value for V1 is 'X'.
Bind the visible property of each view container to the above attributes like
View1-V1
View2-V2
View3-V3
When you run the application, defaul View1 displays, coz its default values set as 'X'.
Now depends up on the logic, change the value of each attribute as 'X' or SPACE .
Eg:
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->Element_context.
DATA lv_v1 TYPE wd_this->Element_context-v1.
DATA lv_v2 TYPE wd_this->Element_context-v2.
DATA lv_v3 TYPE wd_this->Element_context-v3.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* @TODO handle not set lead selection
IF lo_el_context IS INITIAL.
ENDIF.
* set single attribute
lo_el_context->set_attribute(
name = `V1`
value = 'X' ).
* set single attribute
lo_el_context->set_attribute(
name = `V2`
value = '' ).
* set single attribute
lo_el_context->set_attribute(
name = `V3`
value = '' ).
or
* set single attribute
lo_el_context->set_attribute(
name = `V1`
value = '' ).
* set single attribute
lo_el_context->set_attribute(
name = `V2`
value = 'X' ).
* set single attribute
lo_el_context->set_attribute(
name = `V3`
value = '' ).
or
* set single attribute
lo_el_context->set_attribute(
name = `V1`
value = '' ).
* set single attribute
lo_el_context->set_attribute(
name = `V2`
value = '' ).
* set single attribute
lo_el_context->set_attribute(
name = `V3`
value = 'X' ).
Regards,
Amarnath S -
Can I change the FaceTime camera field of view on my iMac?
Is it possible to change the field of view size on my iMac? If so, how? Thanks.
Only by moving your video subject relative to your Mac (or vice-versa.)
FaceTime software does not allow FOV adjustment in software.
A couple of workarounds I can offer:
(1) http://www.ecamm.com/mac/iglasses/index.html add-on softwre can pan and zoom.
(See System Requirements to be sure of compatibility with your system.)
(iGlasses' modified images can show reduced quality. Using more light may help.)
(2) If you have a compatible external camera that can zoom, you could use it.
(some examples in this list: http://www.mac-compatible-web-cam.com/)
Message was edited by: EZ Jim -
Dynamically embed View into View Container UI Element
Hi all,
I'm searching for a possibility to embed a view into a dynamically created View container element.
I want to do this out of another view, where a tabstrip is contained. So I have a button on this view for generation of a new tab with an view container element in it. Now I got to the point where I have to set the view to this container within the tab strip.
I read several blogs and articles, where this is done via the window manager within an method of the window, but non how to do this within a view.
Any ideas?
Thanks
OlliHI,
that's nit what I wanted. What I want to do is a kind of table maintenance. There is a button under the tabstrip for creating a new row. If the user klicks on that button a new tab should be created for the new row. Therefore the view on the tabs are always the same.
I have created the tabstrib. dynamically add a tab to this strip on button press is no problem. Also a ViewContainerElement is created. But now I have to set the statically created view for the row maintenance into the container.
Thanks
Ragards
Olli -
Dynamically Changing State of a field based on condition
Hi,
I have an existing view on the SRM portal which I have enhanced. There is a field Supplier. Requirement is when Invoice is created with reference to a PO, this field Supplier should be mandatory, But when Invoice is created without reference to PO, this field Supplier should be optional. Current by default this is a Required field on the view.
Component Name is /SAPSRM/WDC_DODC_INV_O_BD
I am new to Web Dynpro ABAP. Can someone please provide me the sample code to check this condition and change the state of this field Supplier dynamically. Also where should i write this code?
Thanks and Regards,
Vanessahi
In your method there would be a parameter ie ON_TOGGLE where you can write the name of your event .
Whenever your checkbox will be clicked that event wil be called.
You can write your code in that event itself.
Regards
Kuldeep -
How to dynamically change the table name inside a view
Hi All,
create table t_auto_feeds
id number,
table_name vachar2(100));
insert into t_auto_feeds values(1,'T_FEED_POSITIONS');
insert into t_auto_feeds values(2,'T_KAP_MTM');
assume there are 100 records on id=1 in T_FEED_POSITIONS and 100 records of id=2 in T_KAP_MTM (id 1 is present only in t_feed_positions & id 2 is present only in t_kap_mtm)
i need to create a view such that it needs to give the count of records based on the id
create or replace view aa_view as
select count(*), id from t_feed_position group by id
union
select count(*), id from t_kap_mtm group by id;
I am getting a proper result when i query the view like select * from aa_view where id=1 but will the other union query seems to be a overhead?. I am having 10 such tables configured for different id in t_auto_feeds.so do i need to put 10 unions or is there a better way to handle this stuff.
I know i can use a PLSQL block and dynamically build view structure, the problem is the view itself is configured in a table , so i cant write a proc for this.. can this aa_view be modified such that it queries only the table(using the t_auto_feeds ) which matches the id rather than the entire list.
Kindly help me in this regard and let me know in case u need any further information from my side.>
so do i need to put 10 unions or is there a better way to handle this stuff.
>
Yes - you need 10 unions
Yes - there is a better way so that only one of the 10 queries does anything.
You can use SYS_CONTEXT to control the query selection.
Here is an example of using SYS_CONTEXT. Try this code in the SCOTT schema.
create or replace context VIEW_CTX using SET_VIEW_FLAG;
create or replace procedure SET_VIEW_FLAG ( p_table_name in varchar2 default 'EMP')
as
begin
dbms_session.set_context( 'VIEW_CTX', 'TABLE_NAME', upper(p_table_name));
end;
select * from emp where 'EMP' = sys_context( 'VIEW_CTX', 'TABLE_NAME' );
select * from emp1 where 'EMP1' = sys_context( 'VIEW_CTX', 'TABLE_NAME' );
select * from emp2 where 'EMP2' = sys_context( 'VIEW_CTX', 'TABLE_NAME' )
exec set_view_flag( p_table_name => 'EMP' );
exec set_view_flag( p_table_name => 'EMP1' );
exec set_view_flag( p_table_name => 'EMP2');
SELECT sys_context( 'VIEW_CTX', 'TABLE_NAME' ) FROM DUAL
CREATE VIEW THREE_TABLE_EMP_VIEW AS
select * from emp where 'EMP' = sys_context( 'VIEW_CTX', 'TABLE_NAME' )
union all
select * from emp1 where 'EMP1' = sys_context( 'VIEW_CTX', 'TABLE_NAME' )
union all
select * from emp2 where 'EMP2' = sys_context( 'VIEW_CTX', 'TABLE_NAME' )
SELECT * FROM THREE_TABLE_EMP_VIEWNote that you set the context for the table you want. This doesn't have to be a table name it could just be flag value
-- use the emp table
exec set_view_flag( p_table_name => 'EMP' );
-- ue the emp1 table
exec set_view_flag( p_table_name => 'EMP1' );
-- use the emp2 table
exec set_view_flag( p_table_name => 'EMP2'); -
DYNAMIC CHANGE OF TABLE CONTENTS IN WEBDYNPRO VIEW
Hi,
I have a requirement to display a table contents, and there are two buttons, When i select some records and clk on a button i need to delete these records in the database table as well as in webdynpro view.
I am able to delete the records in database but the contents of table in view of webdynpro remains unchanged. Can anyone tell me how to delete the contents in the view also??
Regards
NaveenHi Naveen,
You need to Refresh the data you are binding to the table to make the latest data
visible on the screen.
On action of the button you are deleting entries from the database. After this
Fetch data again from the database and bind to the node of the table.
Hope this solves your problem..
Regards,
Ismail. -
Check mandatory fields of view in ViewContainer
Hi Experts!
I created a view (main view) which containes a ViewContainer UI element. After a click on the main view I want to check the mandatory fields (with method check_mandatory_fields onview). But therefore I need the reference to the view controller which is embedded in the ViewContainer element. How can I solve this???
Thanks!Hi
This is how I achieved it:
In DoINIT of the view which is embedded inside view container UI element I got the reference of view controller and stored it as a component controller public attribute
wd_comp_controller->mo_api_controller = wd_this->wd_get_api( ).
Here mo_api_conroller is a comp controller public attr of type ref to if_wd_view_controller.
Now you can call your method like this in the main view
cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
EXPORTING view_controller = wd_comp_controller->MO_API_CONTROLLER
display_messages = abap_true
IMPORTING messages = lt_messages
Hope this helps.
Regards
Manas Dua -
Embed view in view container dynamically
Hello Experts,
I have links in my web dynpro ABAP view, when user clicks on a link I need to show another view in view container. For example I have two links in my view and when user clicks on link1 I need to show VIEW1 to the user in the view container UI element, if user clicks on link2 I need to show VIEW2. I have written the below code in Link action method. But it is not working. Any one can help in this?
DATA : lo_window_controller TYPE REF TO if_wd_window_controller.
DATA : lo_view_controller TYPE REF TO if_wd_view_controller.
DATA : lo_window_rr TYPE REF TO if_wd_rr_window.
lo_view_controller = wd_this->wd_get_api( ).
lo_window_controller = lo_view_controller->get_embedding_window_ctlr( ).
lo_window_rr = lo_window_controller->get_window_info( ).
Embedding view
lo_window_rr->embed_view( used_view_name = 'V_EMP_TERMINATION'
embedding_position = 'V_ACTION/VCU_CONTAINER'
used_component_name = 'ZHR_MSS_APPL' ).
with best regards
K. Mohan ReddyHi mohan ,
You written the code for embedding the view . then you have to creat the navigation link then only you can do navigation
Look at the sample code for creating the navigation link dynamically
DATA lo_navi_services TYPE REF TO if_wd_navigation_services_new.
DATA lo_api_v_main_wf TYPE REF TO if_wd_view_controller.
DATA lo_navi_services TYPE REF TO if_wd_navigation_services_new.
DATA lo_view_usage TYPE REF TO if_wd_rr_view_usage.
DATA lo_window TYPE REF TO if_wd_rr_window.
lo_api_v_main_wf = wd_this->wd_get_api( ).
lo_navi_services ?= lo_api_v_main_wf.
lo_view_usage = lo_api_v_main_wf->get_view_usage( ).
lo_window = lo_view_usage->get_window( ).
CONSTANTS lc_target TYPE string VALUE 'VIEW_MAIN_WF/VC_WF'. "viewname /view vontainer name
*Write the code for getting the view name here
if view_name is not initial
TRY.
lv_window_name = lo_window->get_name( ).
wd_comp_controller->fire_unactivate_all_pro_event( ).
wd_this->m_navi_repository_handle = lo_navi_services->do_dynamic_navigation(
source_window_name = 'lv_window_name'
source_vusage_name = lo_view_usage->name
source_plug_name = 'source_out_plug'
plug_parameters = lv_plug_parameter
target_view_name = lv_view_name
target_plug_name = 'FROM_Plug'
target_embedding_position = lc_target )."lv_target ).
CATCH cx_wd_runtime_repository INTO lr_error.
ENDTRY.
hope thisl piece of code is help full
regards
chinnaiya -
Dynamic change selected columns
hi all,
Created an anwers with 5 columns:
level1 | level2 | level3 | level4 | facts
I created a session filter on all the level columns. Like this:
level1 = session.value or
level2 = session.value or
level3 = session.value or
level4 = session.value
Now i want to dynamic change the columns depended on wich column contains the session value.
For example: level2 contains the session value. The ouput I (want to) expect:
level1 | level2 | facts
Hope someone can help with this...tnx in advancedMore information at this link:
http://oraclebizint.wordpress.com/2007/11/16/oracle-bi-ee-101332-using-indexcol-function-varying-underlying-columns-based-on-user-login/
Hope this helps
Swapan. -
Show view container elements on click of button in view
Hi All,
I have a view ,in that view I have 1 View Container UI Element.In ViewContainer I have a Table.
I have a button in my view.onclick of that button I want to open a view Container's table.
Could anyone please suggest me what are all the steps i have to follow for this?
Regards,
KarthickHello Karthick,
1) Create custom controller.
2) Create attribute with type Visibility in custom controller.
3) Add custom controller in "required controllers" for embedded view and for container view.
4) Create attribute with type Visibility in embedded view and container view.
5) Map visibility attribute from custom controller to container view and from custom controller to embedded view.
6) in container view in wdDoInit put wdContext.currentContextElement().setVisible(WDVisibility.VISIBLE);
7) In action handler for button put something like:
final int ordinal = wdContext.currentContextElement().getVisible().ordinal();
wdContext.currentContextElement().setVisible(WDVisibility.valueOf(ordinal%2 + 1));
While clicking on button table would be shown or hidden.
Best regards, Maksim Rashchynski. -
Error message for View Container Element that is no longer existing
Hi Experts,
i have problem in my webdynpro component. After perform the Code Inspector I get a error message accordingly View Container element.
In one of my view I have rename the name of a viewcontainer element.
Afterwards I could the find the ViewContainer element with new name in my window. But there is also displayed the view container element with the name before renaming. Therefore the code inspector give the error message:
"View Container ..... does not contain a View Container UIelement".
I try different ways to solve it, but it is not possible to delete the displayed ViewContoinerElement in window(that is no longer existing) and it is also not possible to find the ViewContainerElement with the old name in the View.
Thanks in Advance.Hi,
Instead of trying to delete the View Container UI Element in window, Delete the View itself in window and then re-map it again to the window by simply drag and drop.
Hope this helps u,
Thanks & Regards,
Kiran. -
How to change the attributes of screen fields dynamically
<b></b>
well i have created a table by name empmaster_data with following fields.
*emp_id.
*emp_fname.
*emp_lname
*dob.
*doj.
*dept.
*desig.
now using a single screen i want to create,change and display the information.even i am using save and exit button.
now i want to change the attributes of screen fields dynamically like active,input,output,invisible.Hi,
Have Different Radio Buttons for the purposes what you have and use AT Selection Screen Output, Under the event Use loop at screen and with continue with your requirement.
Hope This Info Helps YOU.
<i>Reward Points If It Helps YOU.</i>
Regards,
Raghav
Maybe you are looking for
-
How to install 1280 printer on windows7 64Bit?
how to install 1280 on windows7 64 Bit?
-
how do I load the DPXPLUS plug in into ae? I have both ae6 and ae CC. I need to read 12 bit dpx file
-
This may be a stupid question, but this seems like a very un-Apple like behavior to me... I have an Xserve G5 with 3 x 250Gb drives in a RAID 5 configuration using the PCI RAID card. With the security lock engaged, if I even push on one of the drive
-
INTEGRATED MIC ARRAY RECORDS ONLY NOISE
My laptop is hp dv6 2164 TX. The integrated mic has been working very fine for almost 2 years now. I use it to chat in yahoo messenger. But suddenly it has stopped working. I ve the latest updates, the dafault devices are all correct. The mic doesnt
-
When i click on tool bar ,delete recent histtory is grey color i cant use it ,why
when click on tool bar , and i see the options where it say delete recent history ,,it is grey color i can not use it why, what is the problem