How to add customized value to drop down by index binded to model attribute
i have to Ui element Drop down by index to which i have binded model attribute for populating the values, now i want to add a customized value to it like "choose all".
how can i do this ??
Thanks and regards,
Aditya Deshpande
Create a value node similar to model node. In value node you can add element at the index wherever you want to:
wdContext.node<nodename>().addElement(<index>,<element>);
Regards,
Murtuza
Similar Messages
-
How to capture selected value from drop down by index
Dear friends,
i want to capture the value of select value from drop down by index, for eg if select air france, how to capture , could any one please let me know
Thanks
VijayaHi Vijaya,
You can get the value of selected from drop down as below
Check out the event handler method attached to Onselect event of the ui element drop down by index , if no event is associated, then create an event and attach to the drop down list
Now you will be having the CONTEXT_ELEMENT in the WDEVENT parameter
data lo_element type ref to if_wd_context_element.
lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT').
Now, you can get the static attribute value of selected drop down value & let us say your drop down list values are populated from context node 'ND_DRP_DOWN'
data ls_data type wd_this->element_nd_drp_down.
lo_element->get_static_attributes(
importing
static_attributes = ls_data ).
Hope this helps you.
Regards,
Rama -
How to hard code values in drop down by index
Hi everyone
I hav a node containing 2 attributes ie value n key. I am using drop down by index. Value attribute is bound to my drop dwn box. In key I am providing key value for the value. I need to hard code 3 value..Can anyone help me how to do so.
Thanks
Jaspreet KaurHi,
Example for Data Binding of the DropDownByIndex UI Element:
Procedure at design time:
1. Create a view with the name TestView.
2. Insert the DropDownByIndex UI element as a container child of the TestView view. (Step 1)
3. Create the context structure, as described in step 2.
Create the context node X with the cardinality 0..n. Insert the value attribute y of the type String into this node. Then perform the data binding of the DropDownByIndex UI element in the Properties window of the View Designer. The texts property must be bound to the value attribute y with the context path description TestView.X.y (step 3).
The context path TestView.X.y describes the attribute y in the context node X of the view context of the TestView view.
You can fill the context with test data using the following controller implementation.
public void wdDoInit()
//@@begin wdDoInit()
String[] letters = new String []
{"A", "B", "C", "D"};
//Create context elements for the node "X"
List nodeElements = new ArrayList();
for (int i = 0; i <letters.length; ++i)
IPrivateTestView.IXElement xElement = wdContext.createXElement();
xElement.setY(letters<i>);
nodeElements.add(xElement);
//Bind node element list to the node
wdContext.nodeX().bind(nodeElements);
//Set nodes lead selection which determines the selected item
wdContext.nodeX().setLeadSelection(1);
//@@end
Regards
Ayyapparaj -
How to get different values in drop down in table rows
Hi
I have an application, which has a drop down in the table. Each row is to have different values in its drop down based on the "characteristic" parameter. For eg. first row has characteristic as color, and the corresponding drop down will contain the color names. Second row has charateristic as weight, and the drop down will carry corresponding weight values.
I am getting the data from the backend as a flat table i.e. charaterisitc - value pair.
I think i will have to use the Drop Down by Index control, but i dont know how exactly to go about it.
Can any one please help in this regard.
Thanks & regards,
AnupreetHi Maksim
I am sorry, but i am not able to get you.
This is the piece of code that i wrote for populating the drop down:
IPrivateMaintainDocAttribView.IDropElement dropEle = null;
for(int i = 0;i<size;i++)
dropEle = wdContext.nodeDrop().createDropElement();
dropEle.setDropval(wdContext.nodeCtxNode_DocAttribs().getCtxNode_DocAttribsElementAt(i).getCmpCtx_Value());
wdContext.nodeDrop().addElement(dropEle);
Here, Dropis the sub node to which i am putting the data and thisis linked to the table.
CtxNode_DocAttribs is the model node from where i am picking the data and setting in the subnode.
Thanks & regards,
Anupreet -
How to set default value for drop down box in jsf
Hi,
Can anyone help me to set the default value in drop down box using <af:selectManyChoice> ?
As I know there is an unselectedLabel attribute in <af:selectOneChoice> but not valid attribute for <af:selectManyChoice>.
Any help must be appreciated.
Regards,
AKHi Frank
My entity type is a List in managed bean. I have set the entityType in the constructor of the managed bean. I have attached my code here.
TPSearchCriteriaBean.java****************************************
/** Constructor */
public TPSearchCriteriaBean() {
super();
entityType=new ArrayList<String>();
entityType.add(UIConstants.LIST_ITEM_ALL);
authorizationType=new ArrayList<String>();
authorizationType.add(UIConstants.LIST_ITEM_ALL);
companyType=new ArrayList<String>();
companyType.add(UIConstants.LIST_ITEM_ALL);
mrgStatus=new ArrayList<String>();
mrgStatus.add(UIConstants.LIST_ITEM_ALL);
legalStatus=new ArrayList<String>();
setEntityType(entityType);
setAuthorizationType(authorizationType);
setCompanyType(companyType);
setMrgStatus(mrgStatus);
country = "0";
//address = new AddressBean();
UIConstants.java***********************************************************
public static final String LIST_ITEM_DEFAULT = "select";
public static final String LIST_ITEM_ALL = "0";
LOVManager.java*****************************************************************
public List<SelectItem> getLovList(String lovType, boolean requiredOption_SELECT, boolean requiredOption_ALL)
log.debug("LOV loading for " + lovType + ": START");
List<SelectItem> lovList = new ArrayList<SelectItem>();
//check validity of lov loading request
validLov:
for (int i = 0; i < lovTypeArray.length; i++)
if (lovTypeArray.equals(lovType))
break validLov;
log.debug("ERROR: LOV Type not valid.");
return lovList;
//First select is replaced by ALL here
//<-- Select --> should be an option
if (requiredOption_SELECT)
lovList.add(new SelectItem(UIConstants.LIST_ITEM_DEFAULT, "--Select--"));
LOVDao dao = new LOVDao();
dao.loadLOVValues(lovType, lovList);
log.debug("LOV Loading successful!");
//<ALL> should be an option
if (requiredOption_ALL)
lovList.add(new SelectItem( UIConstants.LIST_ITEM_ALL, "ALL"));
return lovList;
Kindly help me.
Regards,
AK -
How to get the values of drop downs, which are gonna create at run time.
As per my design requirement, I have to create drop downs in an ADF display table.
The no# of rows of the table are gonna decide the no# of the drop downs. User can select the values from drop downs. My issue is, how can I capture the selected values of those drop downs as those are gonna created run time.Hi
ohh ,ok ,then as u said that u r storing twenty values ,thats y i aksed earlier ,are these form values part of tbale ,or as u said 20 values are there ,for these u r creating 20 form values ???.
My suggestion would be ,u do four calculation and put all your results in a hashmap ,and keep this hash map in to sesion ,using the following method
pageContext.putTransactionTransientValue("HashMapName",myHashMap);
and inside the PFR method when u want to display these values ,u can loop through your hashmap and can display these values.
like this
HasMap hm=pageContext.getTransactionTransientValue("HashMapName");
thanx
Pratap -
Populate Values for Drop Down by Index in Table in Web Dynpro Java
Hi Experts,
I have a table and having a column table cell editor as Drop Down by Index.
I have created the table node (tbnode) and child node for DDBI (ddbinode) and set the singleton property for DDBI node to false.
I have same local variable node as same as above node and the values are available.
I have one button ADD.On click the add button i need to populate the values to table node and as well as DDBI Node.
I created supply function for DDBI node and populate the values for DDBI Node.
Add Method:
IPrivateMdTest8CompView.ItbnodeElement tbnode = wdContext.nodetbnode().createtbnodeElement();
tbnode.setDescription(wdContext.currentCn_LocalVariableElement().getDescription);
wdContext.nodetbnode().addElement(tbnode);
Supply Function Method:
for(int j=0;j<wdContext.nodetbnode().size();j++)
wdContext.nodeddbinode().setLeadSelection(j);
IPrivateMdTest8CompView.IddbinodeElement ddbinode = wdContext.nodeddbinode().createddbinodeElement();
ddbinode.setddvalue(wdContext.currentCn_localddvalueElement().getddvalue);
wdContext.nodeddbinode().addElement(ddbinode);
Problem is one i got the values in the drop down and i click the second row in table again the supply function calls and reset the first row drop down to original value.
If you any problem like please provide the solution.
Thanks & Regards,
SatheshKumar RIf you created the supply method by setting the supply property of the node, you should have variable 'node' available as argument of the supply method, which will be related to the table row of the triggered dropdown. Opening the dropdown does not change the lead selection of the parent node, so
ddbinode = wdContext.nodeddbinode().createddbinodeElement();
wdContext.nodeddbinode().addElement(ddbinode);
does always relate to the first row of the table (given that leadSelection == 0). With the node variable you can
IddbinodeElement ddbiElement = node.createddbinodeElement();
node.addElement(ddbiElement); -
Hi ,
I need to add new agreement types to the drop down. Please let me know how and where to add the item to get populated in the drop-down
Thanks in Advance
TayiHI,
You can create a value list value and point the list from extended field .
Regards
Sudipta -
How to add user command to drop down list in output screen for OALV Report
Hi Experts,
I have created a report by using OALV.
in Output screen i have added drop down for one filed with 2 values.
when i select value from the drop down list the program should trigger and the next field should be update.
so it is possiable to add a user command for the drop down list in output screen.
if so please help me .
Regards,
RathanHI,
Check the Demo program BCALV_EDIT_06 with having the DATA_CHANGED event still you can capture the changed data. This event will help you.
or you can go for this code..
data: it_f4 type lvc_t_f4,
wa_f4 type lvc_s_f4.
wa_f4-FIELDNAME = 'CONNID'.
wa_f4-REGISTER = 'X'.
wa_f4-GETBEFORE = 'X'.
wa_f4-CHNGEAFTER = 'X'.
append wa_f4 to it_f4.
"register F4 event
CALL METHOD g_alv_grid_ref->register_f4_for_fields
EXPORTING
it_f4 = it_f4.
"Once you try to pick the value HANDLE_DATA_CHANGED event will be triggered
"Definition
methods:
handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed e_onf4 e_onf4_before e_onf4_after,
"Implementation
METHOD handle_data_changed .
DATA: ls_mod_cells TYPE lvc_s_modi.
IF e_onf4_before = 'X'.
MESSAGE 'Data changed before F4' TYPE 'I'.
ENDIF.
IF e_onf4 = 'X'. "if event triggered by F4
MESSAGE 'Data changed on F4' TYPE 'I'.
ENDIF.
IF e_onf4_after = 'X'.
MESSAGE 'Data changed after F4' TYPE 'I'.
ENDIF.
"here you know which cell was modified
LOOP AT er_data_changed->mt_mod_cells INTO ls_mod_cells.
"just example test case, here you can implement your code for modified cells
IF ls_mod_cells-value >=5.
CALL METHOD er_data_changed->add_protocol_entry
EXPORTING
i_msgid = 'SABAPDOCU'
i_msgty = 'E'
i_msgno = '888'
i_msgv1 = 'Only numbers below 5 are possibe'
i_msgv2 = 'Please correct'
i_fieldname = ls_mod_cells-fieldname
i_row_id = ls_mod_cells-row_id.
CALL METHOD er_data_changed->modify_cell
EXPORTING
i_fieldname = ls_mod_cells-fieldname
i_row_id = ls_mod_cells-row_id
i_value = space.
ENDIF.
ENDLOOP.
ENDMETHOD. "handle_data_changed
Edited by: sum_it2 on Nov 21, 2011 10:07 AM -
Labview - How to create custom menu bars, drop down menus, pop ups etc.
Hi,
I have a very naive question. How does one create menu bars with custom labels (not NIs defaults), drop down / side menus, pop ups etc.?
Thanks in advance
PaulSearch for the following on the NI website: Run-Time Menus, Run-Time Shortcut Menus.
For pop ups, search for 'dialog' in the Examle Finder (Help -> Find Examples)
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies -
How to show custom descriptions in drop down menu?
We are designing 3D pie chart in BAM report and trying to incorporate drop down menu at top.
The drop down menu is currently displaying 2 fields of associated dataobject - "TaskStatus" and "TaskUser".
But We would like to have "By status", "By user" insted of "TaskStatus" and "TaskUser".
Can anyone help us achieving this?
Thanks.
Edited by: user13027638 on Oct 12, 2010 9:00 AM
Edited by: user13027638 on Oct 12, 2010 10:46 AMI'm assuming you are using Field type prompts and these 2 fields (TaskStatus and TaskUser) are fields to group by for the pie chart.
If that is the case, the only workaround I see is to create 2 calculated columns in the dataobject, using Architect and not Active Studio.
For example:
New field name: By status
Calculated expression: TrimEnd(TaskStatus)
New field name: By user
Calculated expression: TrimEnd(TaskUser)
Then edit your prompt so that the 2 new calculated columns are the selection options for the drop down. -
How can I add values on a Drop Down by Index Webdynpro Element by a Model?
How can I add values on a Drop Down by Index Webdynpro Element with a Model RFC?
Hi Jesus,
Please use the below code for DropDownByIndex Elements :-
Suppose you have model node ABC and attribute xyz. Now you have created custom node CustNode and attribute CustAtt.
ICustNodeElement ele = null;
if(wdContext.nodeABC().size > 0)
for(int i=0; i< CustNode< wdContext.nodeABC().size; i++
ele = wdContext. createCustNode();
ele.setCustAtt(wdContext.nodeABC().getABCElementAt(i).getXYZ)
wdContext.nodeCustNode.add(ele);
Refer to http://help.sap.com/saphelp_nw70/helpdata/en/3b/f1754276e4c153e10000000a1550b0/frameset.htm
Best Regards
Arun Jaiswal -
How can I add values on a Drop Down by Index Webdynpro Element?
Hi every body
Can anybody help me?
How can I add values on a Drop Down by Index Webdynpro Element?
How can I invoque my element on the Implementation Webdynpro?Hi Jesus,
You can add elements to your DDbyIndex like this:
//Example: Popular un Dropdown by Index usando Nodos de contexto
// NODE[Card: 1..n, Sele:1..1] Si es obligatorio; || NODE[Card: 0..n, Sele:0..1] Si no es obligatorio y se puede dejar en blanco
//Assuming we created a node called "Source", with a string attribute called "Texto" binded to the dropdownbyindex
for (int i = 1; i <= 101; i++)
ISourceElement sourceElement = wdContext.createSourceElement();
sourceElement.setTexto("Text number "+i);
wdContext.nodeSource().addElement(sourceElement);
Regards.
Julio Herrera -
How to add Custom Relationship in MSS Employee Search Drop down
Dear Sap Fans,
I would like to link Custom Drop down link at following path.
Manager Self-Service->Team->Employee Information->General Information->Employee Selection
Drop Down 1. Direct Reports
2. Employee from Organization Structure
3. Employee from Organization Units
4. Who's Who
We would like to add one more custom drop down. Can any one suggest how to add custom drop down in this list ? We have created custom relationship in R/3 but it is not showing in Portal.
Your prompt reply highly appreciated and points will be rewarded.
Regards,
Ashish BrahmbhattBarin,
I have done settings in back end. I have created new realtionship for evaluation path. I am not able to see that link on portal. How/From Where I can use object and data provider tool and eventing for config ?
rds,
Aashish -
How to add values to drop down list in adobe forms
how to add values to drop down list in adobe forms
Hi,
If you are using WD Java following are steps of filling values in DD Box:
1 Create a simple type in the Dictionary.
2 Create an attribute "CountryNew" in the Context of type created by you.
3 Write following code in the init method of the form:
IWDAttributeInfo countryinfo =
wdContext.nodeEmployee().getNodeInfo().getAttribute("CountryNew");
ISimpleTypeModifiable Country = countryinfo.getModifiableSimpleType();
IModifiableSimpleValueSet countryValueSet =
Country.getSVServices().getModifiableSimpleValueSet();
countryValueSet.put("IN", "INDIA");
countryValueSet.put("US "USA");
4 Add a Enumrated DD box in the form and bind it to the attribute "CountryNew"
Hope this helps
Amit
Maybe you are looking for
-
Password doesn't work when connecting other devices
I have tried several hundred times and I can't connect any other devices to my wireless network using the password. I am using the router password. Is that the correct password. Just got a android phone and woud like to be able to use my wireless net
-
I'm working in a test environment to configure Solaris 10 hosts to authenticate against an Active Directory environment using LDAP and Kerberos. I have all of the hard parts done - I can login locally, ssh, telnet, ftp, etc to the Solaris 10 device u
-
Change material master i.e MM02 using BAPI's
Hi , I need a BAPI which will change material master for changing MRP 2,Accounting 1 and Costing 1 View . Please provide me with code if possible . Thank you . Regards, Kumar.
-
CHANGES IN KONV TABLE on VA02 ADDRESS CHANGE
hi SAP experts , can any one say when the sales order is changed in the T code. va02 ( just changed the address ) the condition table is changing its values like vat is getting zero . can any one please say the reason behind it . here i have attache
-
Why can't I download ACR 8.2?
I cna't seem to download ACR 8.2 RC. I did OK with DNG, but when I try to install ACR 8.2 it says I need to repair or re-download Adobe Application Manager which I have done...what's wrong?