Populate drop down on pageload using struts
How can i populate my dropdown box from database on pageload event by using struts
<html:select name="beanName" property="someProperty">
<html:optionsCollection name="beanName" property="dropDownProperty" label="drop down Label" value="dropdown value"/>
</html:select>Here the bean name is the Form bean which contains the drop down list and selected value.
Similar Messages
-
How to populate drop down list in infopath 2010 with form Active Directory resources.
I want to populate drop down list in infopath 2010 with Active directory resources.
Kindly let me know how to do this.Actually I posted an alternative approach, whoops. This is the Web service way, but both will work;
http://blog.mangroveweb.com/pre-populating-an-infopath-from-with-mysql-data-using-a-net-web-service/using-sharepoints-getuserprofilebyname-web-service-to-retrieve-ad-account-information/
w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP -
Hi
Is there a way to filter a drop down list by using the result main data display from"GetUserProfileByName" when open the form?
The second source has a huge list of company names that can be narrrow by email work.
background:SP 2010 and Infopath 2010
CRISTINA& MICROSOFT ForumI'm not sure if I understood your question clearly but here is a good resource on how to get attributes from "GetUserProfileByName" web services:
http://blog.mangroveweb.com/pre-populating-an-infopath-from-with-mysql-data-using-a-net-web-service/using-sharepoints-getuserprofilebyname-web-service-to-retrieve-ad-account-information/
Regarding filtering dropdown list then this could be done by applying form on-load rules.
Hope this helps -
Populate drop-down list from multiple text fields.
Just to begin, I am brand new to this application and brand new to coding in general. Anyways, this is what I am trying to accomplish. I need to populate a drop-down list from multiple text fields. I am able to populate one item using this in the calculate event:
TextField1.rawValue
After I type text in TextField1 and hit enter, it displays the text in the drop-down list. I need to do this but with more than just one text field to populate more options for the drop-down list. I will also need to do something similar with populating a drop-down list from selections made in multiple other drop-down lists.
Thanks for any help you can give me.Thank you for your suggestion Geo Kaiser. With that, I was able to populate my drop-down lists, but now when I select an option from the drop-down list, the selection dissapears. The selection will appear briefly in the box but then dissapears although my drop-down list options remain there. Here is the code I am using for my text field to drop-down list:
DropDownList1.clearItems()
DropDownList1.addItem(TextField1)
DropDownList1.addItem(TextField2)
And here is my code for my drop-down list to populate another drop-down list:
DropDownList3.clearItems()
DropDownList3.addItem(DropDownList1)
DropDownList3.additem(DropDownList2)
Thanks again for your help. By the way, I am using Adobe Designer 7.0. -
Populate drop-down lists based on check box selections
Hi. I'm creating a Service Work Order form. At the top, there are several check boxes for the various services we provide, under that , more text fields, drop downs and checkboxes to elaborate on those services, and then at the bottom, fields for pricing.
I'd like the top half of the form to drive the pricing info that is available or that auto-populates at the bottom.
Ideally, I'd like to make the pricing specific based on 3 things:
the service checkbox
the client
and the details on that service
For example:
If Client XYZ wants Service A that includes subservice B
$123 should show up on the bottom half in the field for that service
If Client ABC wants Service B that includes subservice C
$456 should show up on the bottom half in the field for that service
Does that make sense?
I've been unable to get code to work in either the calculate and pre-Open options
I first tried calculate and used this code (which was just a guess on my part)
if (CheckBox1 == 1) and if (CheckBox9 == 1) then
$.rawValue = 50
elseif
(CheckBox2 == 1) and if (CheckBox9 == 1) then
$.rawValue = 50
elseif
(CheckBox5 == 1) and if (CheckBox9 == 1) then
$.rawValue = 55
elseif
(CheckBox6 == 1) and if (CheckBox9 == 1) then
$.rawValue = 55
elseif
(CheckBox7 == 1) and if (CheckBox9 == 1) then
$.rawValue = 50
elseif
(CheckBox8 == 1) and if (CheckBox9 == 1) then
$.rawValue = 50
else
$.rawValue = 0
endif
That didn't do anything but give me an error about "and"
So I tried putting code in pre-Open:
// clear the dropdown displayed value and items
this.rawValue = null;
this.clearItems();
// repopulate the items based on the checkboxes
if(offshore.rawValue == 1)
this.addItem("$40.00", "offshore_001");
this.addItem("$45.00", "offshore_002");
this.addItem("$50.00", "offshore_003");
if(inland.rawValue == 1)
this.addItem("$40.00", "inland_001");
this.addItem("$45.00", "inland_002");
this.addItem("$50.00", "inland_003");
I got no error but nothing populated and the drop-down was, in effect, disabled.
Any help would be appreciated.
Thanks!Gavin,
This sounds like an issue that is not related to JHeadstart. To simplify the test case, you could create a simple drag-and-drop ADF application without JHeadstart and see if the same problem occurs there.
Your suggestion that it is related to the where clause seems likely. Please find out what kind of object USER_ENV is, and how it is initialized. Maybe this initialization is skipped when bouncing the application.
What happens if you perform the query in SQL*Plus, without doing anything about the USER_ENV?
Maybe you should ask the Oracle Applications discussion forum...
kind regards,
Sandra Muller
JHeadstart Team
Oracle Consulting -
To populate drop down in a table..
Hi,
In my Application i have a table populated from an EJB bean through a class[]....
Node:GroupNode
Attributes:user , name, location.
User attribute is the dropdown field in table..
below values are to be poupulated in the dropdown of the table from the string array.
String[] ca = { "user1","user2","user3"}
I am populating the table from my class...but i am not able to populate the dropdownbox...
Below is the code i used to populate the table:
UserDTO[] cat = wdContext.currentBeanElement.modelobject.Objuser();
for(int i-0;i<cat.length;i++)
IPrivateUserView.IGroupNodeElement e = wdContext.createGroupNodeElement();
e.setUser(cat<i>.getUser());
e.setName(cat<i>.getNmae());
wdContext.nodeGroupNode.addElement(e);
When I use Textview element in the table UI , the values are populating..
But I need the User column in DropDown...So when i change the UI element to Drop Down Box in User column in Table,the User Column in the table is alone empty..
How can I populate the values in dropdownbox with String[] ca = { "user1","user2","user3"} ...
And I am usin DropDownByIndex UI element...
Thanx in advance...
Arjun.G
Edited by: arjun swamy on Jan 22, 2008 7:22 AMHi
To populate a dropdown by key inside a table, you should do it this way:
//YOURNODENAME card: 1..n selection: 1..n , attribute within node,
// it could be card: 0..n y sel: 0..1, depend on your liking/mandatory
//condition.
IModifiableSimpleValueSet ValueSet= wdContext.getNodeInfo().
getChild("YOURNODENAME").getAttribute("ATTRIBUTENAME").
getModifiableSimpleType().getSVServices().
getModifiableSimpleValueSet();
//Fill dropdownbykey with data
ValueSet.put("user1","user1");
ValueSet.put("user2","user2");
ValueSet.put("user3","user3");
ValueSet.put("user4","user4"); //... etc.. fill to fit your needs
//Fill table with independant copies, that means choosing one doesnt modify the others
for (int i = 0; i<5 ; i++)
wdContext.nodeYOURNODENAME().addElement(wdContext.nodeYOURNODENAME().createElement());
Regards
Julio Herrera -
Populate drop down in a selection screen
Hi All,
I have created a selection screen where i have a drop down field .How do i populate the drop down? In the backend i have a table type in the export param. which contains all the drop downs values.
Please help.
Thanks
tubai.Hi,
If you are using drop down by index. then use following code. Create a context node with cardinality 1:N
data : it_table type STANDARD TABLE OF sflight.
DATA lo_nd_cn_drpindex TYPE REF TO if_wd_context_node.
DATA lo_el_cn_drpindex TYPE REF TO if_wd_context_element.
DATA ls_cn_drpindex TYPE wd_this->element_cn_drpindex. " Here cn_drpindex is the name of context node which is binded to the drop down by index UI element.
* navigate from <CONTEXT> to <CN_DRPINDEX> via lead selection
lo_nd_cn_drpindex = wd_context->get_child_node( name = wd_this->wdctx_cn_drpindex ).
select carrid from sflight into CORRESPONDING FIELDS OF TABLE it_table.
lo_nd_cn_drpindex->bind_table( it_table ).
If you are using drop down by key ui element then you can use the following code
DATA : node_info TYPE REF TO if_wd_context_node_info.
DATA : it_zinsp TYPE TABLE OF zinsp.
FIELD-SYMBOLS : <tablezinsp> TYPE zinsp.
DATA : value TYPE wdy_key_value,
value_set TYPE wdy_key_value_table.
DATA : zlandx TYPE string.
node_info = wd_context->get_node_info( ).
node_info = node_info->get_child_node( 'CN_VISATYPE' ).
CALL METHOD cl_wd_dynamic_tool=>get_table_data
EXPORTING
tab_name = 'ZINSP' " Here ZINSP is name of table
row_count = 0
IMPORTING
data = it_zinsp.
LOOP AT it_zinsp ASSIGNING <tablezinsp> .
value-key = <tablezinsp>-zvisaty." This is field of table
value-value = <tablezinsp>-zvisaty.
INSERT value INTO TABLE value_set.
ENDLOOP.
node_info->set_attribute_value_set( name = 'CA_VISATYPE' " Name of attribute
value_set = value_set ).
I hope it helps.
Regards,
Rohit -
Populate drop-down list in table row or repeating subform
I am currently working on an Adobe Interactive Form integrated with web dynpro ABAP. I would like to create a table or repeating subform with a number of drop-down lists populated from SAP.
I am using the Enumerated Drop-down list from the WebDynproNative menu. In my WDDOINIT method, I am populating the attributes using the set_attribute_value_set method. This is working fine when my dropdown is not in a table or repeating subform. The dropdown is populated and the selected value is returned to SAP when submitting the form. However, when I place the dropdown in a table row or a repeating subform, the dropdown is not populated.
Any ideas or suggestions?Hi There,
I am facing problem in Dropdown lists in Subforms.
I want the region dropdown list values according to country (only for DE) dropdown list value. Both Dropdown lists are in a Subform.
For that, I have used this in EXIT event of Country Dropdown list:
if (this.rawValue == "DE Deutschland")
data.Item.IT_ITEM.DATA.ZZ_REGION.clearItems();
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Schleswig-Holstein","1");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Hamburg","2");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Niedersachsen","3);
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Bremen","4");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Nordrhein-Westfalen","5");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Hessen","6");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Rheinland-Pfalz","7");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Baden-Württemberg","8");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Bayern","9");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Saarland","10");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Berlin","11");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Brandenburg","12");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Mecklenburg-Vorpomme","13");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Sachsen","14");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Sachsen-Anhalt","15");
data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Thüringen","16");
else
data.Item.IT_ITEM.DATA.ZZ_REGION.clearItems();
It does only change first region dropdownlist value, not others because both dropdown lists are in a Subform.
Other problem is that it works only when All Country Dropdown lists are "DE". Means, first region dropdown list depends upon not only first country dropdown but also other dropdown.
My requirement is, If first country Dropdown is "DE", only first Region Dropdown list should be fill, not others. And so on.
Please provide solution that How can I change all dropdown lists of a Subform dynamically?
Waiting for reply.
Thank you
Chandler Bing -
How to populate drop down list in infopath 2010 with form library column
I created one column of choice type and have put 3 values on this column in form library in site.
and one drop down list in form library at infopath 2010 but how to populate the dropdown in infopath populate with this column.Hi John, you should either add the values to your InfoPath dropdown manually or create a new list in SharePoint with the values and make a connection to that list to populate your dropdown.
cameron rautmann -
Populate drop-downs from free text fields.
Hi all,
I have a problem which I can't quite get my head around.
Currently I have a flowed form, and among others, a free text field named 'sectors'. Attached to this field are some + and - buttons which use instance manager to add or remove more 'sectors' rows.
Once all the sectors have been added, I would like users to then be able to be able to select from drop-down lists elsewhere in the form that are populated from the 'sectors' items.
Im thinking that I need to add another button to the 'sectors' row, which might add the item to the required drop-down, but im not really sure how to do this as my JS really isn't that great!
Any help or suggestion would be greatly appreciated.
Cheers,
Lachlan.Hi Stephen,
I would say that the this.rawValue=null; is necessary.
If in my example you comment out the null line. Then select the Fruit checkbox and Apple from the dropdown:
Now if the user goes back and deselects Fruit and instead selects Cars, when they open the dropdown the script clears the Fruit options and adds the Car options (everything okay there). However the value of the dropdown is still fruit_001, even though this is not an option in the list. If the user exists the dropdown without making a new selection, you could have a value displayed that does not relate to the correct choices:
So I would say that the this.rawValue=null; is not redundant at all.
In the null pattern for a dropdown: http://assure.ly/gcXx03, I actually null and clear the Relationship dropdown as soon as the user makes a selection in the Gender dropdown.
Maybe have a look and test before you go back on your existing forms.
Niall -
Drop-down in JSP using a bean as back-end
Hi everyone,
I like to create a dynamic drop-down (reading from a database) using JSP but accessing a bean. My code on the bean is:
public void DepartmentName() {
try
stmt1 = tConnection.createStatement();
rs1 = stmt1.executeQuery ("select DEPT_NAME from DEPARTMENT");
while ( rs1.next() )
String DptName = rs1.getString("DEPT_NAME");
System.out.println(DptName);
Can anybody tell me how to call this DepartmentName bean in JSP? So far my JSP looks like this...
<table width="100%"><tr>
<form action="next.jsp" method="POST">
<input type="hidden" name="type" value="listemp">
<td width="100">
<b>Department</b></td>
<td wifth="100">
<SELECT name=cust multiple size=4>
<option>??????? HELP ???????????</option>
</SELECT>
</td>
<td><input type="submit" value="Submit" name="dept">
</td></tr></table>
Many thanks.First you need to modify your bean to return some sort of data structure of String objects. How about a Vector? Then you could call Vector.elements() on the return statement of the DepartmentName() method, like this...
public Enumeration DepartmentName()
Vector myVector = new Vector(0);
while(rs.next())
myVector.add(rs.getString(1));
return myVector.elements();
}Then in your JSP you'll need to use the JSP useBean tag
<jsp:useBean id="myBean" class="com.myco.myapp.MyBean" scope="page|request|session|application" />And before the option tag call the bean and get the enumeration of String objects, then loop through them like this:
while(enum.hasMoreElements())
out.println(((String) enum.nextElement()));
} -
Passing database table values to drop down list list using "vrm_set_values"
DEar Experts,
How can we pass database travel to drop down list using vrm_set_value call function.
Looking forward for advise from you experts .
REgards
CHandanDear Anubhab,
Thanks for your suggestion,
Plz see my code:
Type-pools: vrm.
DATA: it_zlt_mita TYPE STANDARD TABLE OF Zlt_mita,
wa_zlt_mita TYPE zlt_mita,
it_vrm TYPE vrm_values with header line .
Selection-Screen: Begin of Block b1 With Frame Title text-001.
Parameters:
p_mitar Type Zlt_mita-M1 as listbox visible length 20 user-command zcc01 obligatory,
p_mitarn Type Zlt_mita-M2.
Selection-Screen : End of Block b1.
AT SELECTION-SCREEN OUTPUT.
Select * From ZLT_mita INTO CORRESPONDING FIELDS OF TABLE it_zlt_mita.
LOOP at it_zlt_mita into wa_zlt_mita.
it_vrm-key = wa_zlt_mita-m2.
it_vrm-text = wa_zlt_mita-m1.
APPEND it_vrm.
Clear: it_vrm, wa_zlt_mita.
ENDLOOP.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_mitar'
values = it_vrm[]
* EXCEPTIONS
* ID_ILLEGAL_NAME = 1
* OTHERS = 2
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Data: dynfields type table of dynpread with header line.
dynfields-fieldname = 'p_mitar'.
Append dynfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = 1000 " can I use sy-dynnr here
* TRANSLATE_TO_UPPER = ' '
* REQUEST = ' '
* PERFORM_CONVERSION_EXITS = ' '
* PERFORM_INPUT_CONVERSION = ' '
* DETERMINE_LOOP_INDEX = ' '
* START_SEARCH_IN_CURRENT_SCREEN = ' '
* START_SEARCH_IN_MAIN_SCREEN = ' '
* START_SEARCH_IN_STACKED_SCREEN = ' '
* START_SEARCH_ON_SCR_STACKPOS = ' '
* SEARCH_OWN_SUBSCREENS_FIRST = ' '
* SEARCHPATH_OF_SUBSCREEN_AREAS = ' '
tables
dynpfields = dynfields
* EXCEPTIONS
* INVALID_ABAPWORKAREA = 1
* INVALID_DYNPROFIELD = 2
* INVALID_DYNPRONAME = 3
* INVALID_DYNPRONUMMER = 4
* INVALID_REQUEST = 5
* NO_FIELDDESCRIPTION = 6
* INVALID_PARAMETER = 7
* UNDEFIND_ERROR = 8
* DOUBLE_CONVERSION = 9
* STEPL_NOT_FOUND = 10
* OTHERS = 11
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = 1000
tables
dynpfields = dynfields
* EXCEPTIONS
* INVALID_ABAPWORKAREA = 1
* INVALID_DYNPROFIELD = 2
* INVALID_DYNPRONAME = 3
* INVALID_DYNPRONUMMER = 4
* INVALID_REQUEST = 5
* NO_FIELDDESCRIPTION = 6
* UNDEFIND_ERROR = 7
* OTHERS = 8
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
PLZ SUGGEST ME IF ANYWHERE I WENT WRONG IN MY CONCEPT AS PER YOUR SUGGESTION.
Looking forward for your further guidance.
Regards
Chandan -
Populate Drop down values to Adobe forms
Hello,
I am in the process of developing the HCM forms for PCR's. This is using old technology. How can I pass values to the Adobe forms based on certain condition selected in previous screen. For eg. Based on Position selected, I should have a certain value in Drop down pre-selected on the next screen and when the user does a drop down a list of the values should be listed. Where should do the coding for the subsequent drop down values?
Appropriate points rewarded.
PrasadHere a change in the question below. Based on Position selected, I should have a certain value in Drop down pre-selected on the next screen from table IT1008
and when job is selected drop down from table T500P should be listed. Does this need to be handled in badi or in the Adove form scripting?
Thanks
Prasad -
Oracle ADF Populate Drop Down based on Parameter
Hi All,
I have been struggling with a scenario where we want the values in a drop down to be limited based on something specifc....so for instance the users department ID. If that value exists in the view object that is displaying the data and where I will have my LOV it works fine to restrict the LOV based on the user's department id.
However, if that value isn't in that view object we are using to display the form values along with the LOV then I can get the value listing to be restricted. I have tried execute with params and a few other things (This works to restrict data on the page, but not the LOV).
Any tips on how I can restrict an LOV based on a value that is not in the current VO would be great.
Thanks,
SFrank,
I Found your previous example and it worked like a charm thanks.
Put this in the view accessor like you said and it did what I wanted: adf.source.applicationModule.findViewObject('departmentsInLocation').currentRow.DepartmentId
--S -
Auto Populate Drop Down and Text Fields from Other Drop Down and Text Fields
Hi everyone
I'm trying to pre populate a "Proposed Employment Status" drop down field with the selection from the "Current Employment Status" drop down field and allowing users to select another option if the proposed employment has changed. If it hasn't it would just remain as populated by the Current Employment Status" entry.
I'm also trying to do this with text fields eg "Proposed Position Title" is populated with "Current Position Title". If the title changes in the bew employment arrangements users can enter it over the Proposed Position Title that is presented when the Current Position Title is entered.
I can get it to work if the drop down or text field names are the same, but this doesnt solve the problem.
Any ideas
Regards,
MichaelJava is a full featured-language and you shouldn't have any problem doing the mathematics, etc.
As far as the rest, Studio Creator is a relatively easy way to create the user interface that you describe. If supports drop-down selectable lists and standard form capabilities. A Web Application architecture would appear to be ideally suited to what you describe, and this is supported by SC. Be aware that this would require a server to serve the application to the client computer.
If the server is a problem you could consider an applet that would be downloaded from a website, and then run entirely on the client computer. But the first approach is better.
Maybe you are looking for
-
Error in accounting document creation
Hello All, While releasing the billing document, getting the following error: <b>SYST: Tax jurisdiction code at lowest level not transferred Message no. FF793 Diagnosis The application has not transferred the tax jurisdiction code at the lowest level
-
My iMessage doesn't work, and I keep getting a message saying I've lost Internet connection(when really my wifi is just fine) and it won't sign me in. Help?
-
Problems with my online number from Mexico City
Hello, My online number from Mexico 55 84 21 94 is not working correctly in Mexico City. When my family use a landline from MX to call me another person answer the phone call, but if they use a cellphone it works and I receive the phone call. That's
-
Is it Possible to have videos and music in the same playlist for Apple TV?
Hi I'm new here so apologies if this has been asked before but is it possible to create a playlist that contains music AND videos to play on Apple TV? Thanks! Mark
-
System Copy:Failure when starting export with SAPINST
We are busy with a Unicode conversion and needs to start the export with sapinst. All pre unicode conversion steps are done, we upgraded from 4.6C to ECC6.0. It is a distrubuted system running on MSSQL. Started the export on the DB server and got the