on 09-11-2008 12:56 PM
Hello All ,
Please help me out in creating drop down list in web dynpro in java application .
If Possible please send the sample code as well.
Thanks
Sonal
Hi
--> Take DropDownByIndex UI Element in the Layout Tab.
--> Take One ValueNode Named "Vn_test" in the Context.
--> Take One Value Attribute Named "Va_test" for the Node
"Vn_test".
Set : Cardinality --> 0..n
Selection --> 1..1
Singleton --> True
--> Bind "Vn_test" to the texts Property of the DropDownByIndex.
--> Set the "Vn_test" Node Properties in the Context Tab as
--> Write the Code in wdDoIniit method of implementation tab of that view in which u have taken dropdown.
IPrivate< Your View Name>.IVn_testElement test;
for(int i=0;i<3;i++)
{
test = wdContext.createVn_testElement();
test.setId(" "+i); // this will show 0,1,2 in dropdpwn.
wdContext.nodeVn_test().addElement(test);
}
This will definately work
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sonal
plz try to Create One Node called Country to the Context and Attribute Called Name to that node......and Cardinality of the node must be 0-n
and write acode in the init() method
init()
{
String[] count={"AFGHANISTAN","ALBANIA","ALGERIA", "AMERICAN SAMOA","ANDORRA " ,"ANGOLA","ANGUILLA" ,"ANTARCTICA", "ANTIGUA AND BARBUDA " ,"ARGENTINA" ,"ARMENIA " ,"ARUBA" ,"AUSTRALIA" ,"AUSTRIA" ,"AZERBAIJAN","BAHAMAS" ,"BAHRAIN","BANGLADESH","BARBADOS","BELARUS","BELGIUM","BELIZE","BENIN","BERMUDA","BHUTAN","BOLIVIA", "PLURINATIONAL STATE OF BO",
"BOSNIA AND HERZEGOVINA","BOTSWANA","BOUVET ISLAND ","BRAZIL","BRUNEI DARUSSALAM","BULGARIA","BURKINA FASO","BURUNDI", "CAMBODIA","CAMEROON","CANADA","CAPE VERDE","CAYMAN ISLANDS","CENTRAL AFRICAN REPUBLIC","CHAD","CHILE","CHINA","CHRISTMAS ISLAND","COLOMBIA","COMOROS ","CONGO","COOK ISLANDS","COSTA RICA","CÔTE D'IVOIRE","CROATIA","CUBA","CYPRUS ","CZECH REPUBLIC",
"DENMARK", "DJIBOUTI" ,"DOMINICA", "DOMINICAN REPUBLIC " , "ECUADOR ","EGYPT", "EL SALVADOR " ,"EQUATORIAL GUINEA" , "ERITREA " ,"ESTONIA" ,"ETHIOPIA", "FALKLAND ISLANDS",
"FAROE ISLANDS" , "FIJI", "FINLAND " ,"FRANCE", "FRENCH GUIANA", "FRENCH POLYNESIA","FRENCH SOUTHERN TERRITORIES", "GABON" ,"GAMBIA " ,"GEORGIA ","GERMANY","GHANA","GIBRALTAR","GREECE ","GREENLAND" ,"GUATEMALA","GUERNSEY","GUINEA","GUINEA-BISSAU","GUYANA ","HAITI",
"HONDURAS" , "HONG KONG" , "HUNGARY ","ICELAND ","INDIA" ,"INDONESIA" ,"IRAQ" , "IRELAND " ,"ISLE OF MAN", "ISRAEL", "ITALY", "JAMAICA " ,"JAPAN" ,"JERSEY", "JORDAN", "KAZAKHSTAN","KENYA" ,"KIRIBATI" ,"KUWAIT" ,"KYRGYZSTAN","LATVIA", "LESOTHO", "LIBERIA", "LIECHTENSTEIN","LITHUANIA" ,"LUXEMBOURG" , "MACAO " ,"MADAGASCAR","MALAWI","MALAYSIA", "MALDIVES" ,"MALI" , "MARSHALL ISLANDS", "MARTINIQUE","MAURITANIA","MAURITIUS","MAYOTTE","MEXICO","MONACO","MONGOLIA ","MONTENEGRO","MONTSERRAT ",
"MOROCCO ","MOZAMBIQUE","MYANMAR", "NAMIBIA","NAURU","NEPAL","NETHERLANDS","NETHERLANDS ANTILLES","NEW CALEDONIA","NEW ZEALAND ","NICARAGUA","NIGER","NIGERIA","NIUE", "NORFOLK ISLAND", "NORTHERN MARIANA ISLANDS", "NORWAY","OMAN", "PAKISTAN","PALAU","PALESTINIAN TERRITORY", "PANAMA", "PAPUA NEW GUINEA","PARAGUAY","PERU ","PHILIPPINES",
"PITCAIRN","POLAND","PORTUGAL","PUERTO RICO","QATAR","RÉUNION", "ROMANIA" ,"RUSSIAN FEDERATION", "RWANDA" , "SAINT BARTHÉLEMY", "SAINT KITTS AND NEVIS" ,"SAINT LUCIA","SAINT MARTIN","SAINT PIERRE AND MIQUELON","SAMOA","SAN MARINO", "SAO TOME AND PRINCIPE" , "SAUDI ARABIA", "SENEGAL", "SERBIA", "SEYCHELLES", "SIERRA LEONE", "SINGAPORE", "SLOVAKIA" ,"SLOVENIA", "SOLOMON ISLANDS", "SOMALIA" ,"SPAIN" , "SRI LANKA", "SUDAN" , "SURINAME","SWAZILAND" ,"SWEDEN", "SWITZERLAND" , "SYRIAN ARAB REPUBLIC" ,"TAJIKISTAN","THAILAND","TIMOR-LESTE", "TOGO" , "TOKELAU", "TONGA" , "TUNISIA ","TURKEY" ,"TURKMENISTAN", "TUVALU", "UGANDA", "UKRAINE", "UNITED ARAB EMIRATES" ,"UNITED KINGDOM", "UNITED STATES" ,"URUGUAY ", "UZBEKISTAN", "VANUATU",
"VATICAN CITY STATE", "VENEZUELA", "VIET NAM", "VIRGIN ISLANDS", "WALLIS AND FUTUNA","WESTERN SAHARA", "ZAMBIA", "ZIMBABWE" };
Arrays.sort(count);
List elements=new ArrayList();
for(int i=0;i<=count.length-1;i++)
{
IPrivateDropDownView.ICountryElement ele=wdContext.createCountryElement();
ele.setCountryName(count);
elements.add(ele);
}
wdContext.nodeCountry().bind(elements);
wdContext.nodeCountry().setLeadSelection(0);
}
now create application and deploy it..
Regards,
venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sonal
plz try to Create One Node called Country to the Context and Attribute Called Name to that node......and Cardinality of the node must be 0-n
and write acode in the init() method
init()
{
String[] count={"AFGHANISTAN","ALBANIA","ALGERIA", "AMERICAN SAMOA","ANDORRA " ,"ANGOLA","ANGUILLA" ,"ANTARCTICA", "ANTIGUA AND BARBUDA " ,"ARGENTINA" ,"ARMENIA " ,"ARUBA" ,"AUSTRALIA" ,"AUSTRIA" ,"AZERBAIJAN","BAHAMAS" ,"BAHRAIN","BANGLADESH","BARBADOS","BELARUS","BELGIUM","BELIZE","BENIN","BERMUDA","BHUTAN","BOLIVIA", "PLURINATIONAL STATE OF BO",
"BOSNIA AND HERZEGOVINA","BOTSWANA","BOUVET ISLAND ","BRAZIL","BRUNEI DARUSSALAM","BULGARIA","BURKINA FASO","BURUNDI", "CAMBODIA","CAMEROON","CANADA","CAPE VERDE","CAYMAN ISLANDS","CENTRAL AFRICAN REPUBLIC","CHAD","CHILE","CHINA","CHRISTMAS ISLAND","COLOMBIA","COMOROS ","CONGO","COOK ISLANDS","COSTA RICA","CÔTE D'IVOIRE","CROATIA","CUBA","CYPRUS ","CZECH REPUBLIC",
"DENMARK", "DJIBOUTI" ,"DOMINICA", "DOMINICAN REPUBLIC " , "ECUADOR ","EGYPT", "EL SALVADOR " ,"EQUATORIAL GUINEA" , "ERITREA " ,"ESTONIA" ,"ETHIOPIA", "FALKLAND ISLANDS",
"FAROE ISLANDS" , "FIJI", "FINLAND " ,"FRANCE", "FRENCH GUIANA", "FRENCH POLYNESIA","FRENCH SOUTHERN TERRITORIES", "GABON" ,"GAMBIA " ,"GEORGIA ","GERMANY","GHANA","GIBRALTAR","GREECE ","GREENLAND" ,"GUATEMALA","GUERNSEY","GUINEA","GUINEA-BISSAU","GUYANA ","HAITI",
"HONDURAS" , "HONG KONG" , "HUNGARY ","ICELAND ","INDIA" ,"INDONESIA" ,"IRAQ" , "IRELAND " ,"ISLE OF MAN", "ISRAEL", "ITALY", "JAMAICA " ,"JAPAN" ,"JERSEY", "JORDAN", "KAZAKHSTAN","KENYA" ,"KIRIBATI" ,"KUWAIT" ,"KYRGYZSTAN","LATVIA", "LESOTHO", "LIBERIA", "LIECHTENSTEIN","LITHUANIA" ,"LUXEMBOURG" , "MACAO " ,"MADAGASCAR","MALAWI","MALAYSIA", "MALDIVES" ,"MALI" , "MARSHALL ISLANDS", "MARTINIQUE","MAURITANIA","MAURITIUS","MAYOTTE","MEXICO","MONACO","MONGOLIA ","MONTENEGRO","MONTSERRAT ",
"MOROCCO ","MOZAMBIQUE","MYANMAR", "NAMIBIA","NAURU","NEPAL","NETHERLANDS","NETHERLANDS ANTILLES","NEW CALEDONIA","NEW ZEALAND ","NICARAGUA","NIGER","NIGERIA","NIUE", "NORFOLK ISLAND", "NORTHERN MARIANA ISLANDS", "NORWAY","OMAN", "PAKISTAN","PALAU","PALESTINIAN TERRITORY", "PANAMA", "PAPUA NEW GUINEA","PARAGUAY","PERU ","PHILIPPINES",
"PITCAIRN","POLAND","PORTUGAL","PUERTO RICO","QATAR","RÉUNION", "ROMANIA" ,"RUSSIAN FEDERATION", "RWANDA" , "SAINT BARTHÉLEMY", "SAINT KITTS AND NEVIS" ,"SAINT LUCIA","SAINT MARTIN","SAINT PIERRE AND MIQUELON","SAMOA","SAN MARINO", "SAO TOME AND PRINCIPE" , "SAUDI ARABIA", "SENEGAL", "SERBIA", "SEYCHELLES", "SIERRA LEONE", "SINGAPORE", "SLOVAKIA" ,"SLOVENIA", "SOLOMON ISLANDS", "SOMALIA" ,"SPAIN" , "SRI LANKA", "SUDAN" , "SURINAME","SWAZILAND" ,"SWEDEN", "SWITZERLAND" , "SYRIAN ARAB REPUBLIC" ,"TAJIKISTAN","THAILAND","TIMOR-LESTE", "TOGO" , "TOKELAU", "TONGA" , "TUNISIA ","TURKEY" ,"TURKMENISTAN", "TUVALU", "UGANDA", "UKRAINE", "UNITED ARAB EMIRATES" ,"UNITED KINGDOM", "UNITED STATES" ,"URUGUAY ", "UZBEKISTAN", "VANUATU",
"VATICAN CITY STATE", "VENEZUELA", "VIET NAM", "VIRGIN ISLANDS", "WALLIS AND FUTUNA","WESTERN SAHARA", "ZAMBIA", "ZIMBABWE" };
Arrays.sort(count);
List elements=new ArrayList();
for(int i=0;i<=count.length-1;i++)
{
IPrivateDropDownView.ICountryElement ele=wdContext.createCountryElement();
ele.setCountryName(count);
elements.add(ele);
}
wdContext.nodeCountry().bind(elements);
wdContext.nodeCountry().setLeadSelection(0);
}
now create application and deploy it..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
http://help.sap.com/saphelp_nw70/helpdata/EN/3b/f1754276e4c153e10000000a1550b0/content.htm
follow the above link.
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In this link u can see one example with screen shots.
http://saptechnical.com/Tutorials/WebDynproJava/EVS/Demo.htm
Regards,
Sunaina Reddy T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sonal,
1.) Take DropDownByIndex UI Element in the Layout Tab.
2.) Take One ValueNode Named "Employee" in the Context.
3.) Take One Value Attribute Named "Id" for the Node "Employee".
4.) Bind "Employee.Id" to the texts Property of the DropDownByIndex.
5.) Set the "Employee" Node Properties in the Context Tab as
a.) Cardinality --> 0..n
b.) Selection --> 1..1
c.) Singleton --> True
6.) Write the Below Code in the Implementation Tab.
IPrivate<View Name>.IEmployeeElement empEle;
for(int i=0;i<3;i++)
{
empEle = wdContext.createEmployeeElement();
empEle.setId("Emp Id "+i);
wdContext.nodeEmployee().addElement(empEle);
}
It will Create DropDownList.
With Regards,
Roop Kumar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
Refer this code
IWDNodeInfo SeqNodeInfo = wdContext.nodePeriod().getNodeInfo();
IWDAttributeInfo Seqinfo = SeqNodeInfo.getAttribute("AttributeName");
ISimpleTypeModifiable Seqstm = Seqinfo.getModifiableSimpleType();
IModifiableSimpleValueSet Seqsvs = Seqstm.getSVServices().getModifiableSimpleValueSet();
for(int i=0; i<5; ++i)
{
Seqsvs.put(iyear.toString(), iyear.toString());
iyear = iyear - 1;
}
Mandeep Virk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
suppose your attribute is called "MyAtt" and the node is called "MyNode".
IModifiableSimpleValueSet valueSet = wdContext.nodeMyNode().getNodeInfo().getAttribute(IPublic<controllerName>.IMyNodeElement.MY_ATT).getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
valueSet.clear();
for (int i = 0; i < dataArray.size(); i++) }
valueSet.put(dataArray->key, dataArray->Text);
}
Bind "MyAtt" to selected property of dropdownlistbox.
Aviad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sonal,
You can create Dropdown in two ways,
1. Create a simpleType.(DictionariesLocal dictonarysimpleTypes)
2. Go to enumeration , and add the data.
3. Create a context and in the property of the context , choose select and select the local dictionary and select the one which you have created.
4. You can create a DropDownKey and map to the context.
Dropdown by Index.
If Vn_Dropdown is your node and Va_data is the attribute. and testview is the view name you can do this way
IPrivateItestView.IVN_DROPDOWNelement element=null;
element=wdcontext.nodevn_dropdown.createvndropdownelement();
element.setva_data();
wdcontext.nodeVn_dropdown().add(element);
this would add the data you can repeat the create steps again and again.Sorry for the Typos as i am trying to write directly.
Regards
Pankaj Prasoon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sonal,
using simple type:
hpe it hlps u..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.