Displaying the properties of a List of beans
My servlet passes me an ArrayList of a particular type of bean
say class A {
int prop1;
String prop2;
//getters and setters
} Each bean-instance represents a table record.
I want to display a table that has rows corresponding to each bean element in the ArrayList.
How do I do it using JSTL and expression language (NO SCRIPTLETS) ?
http://java.sun.com/j2ee/1.4/docs/tutorial-update2/doc/index.html
Look under chapter 14 for the iterator tags
Similar Messages
-
How to display the count of a list item in Sharepoint Designer?
How to display the count of a list item in Sharepoint Designer? please reply with the proper code line to add for this.
Hello,
What version of sharepoint you are using? Try below approach:
http://sharepointlogics.com/2010/03/total-count-of-items-in-list-in.html
Hope it could help
Hemendra: "Yesterday is just a memory,Tomorrow we may never see"
Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
you see a reply being an answer to the question of the thread, click "Mark As Answer
Please feel free to unmark answer if does not resolves your problem. -
Use PowerShell to display the properties of an App Pool
Hi
I'm writing a script to deploy web applications from the TFS server to the web servers, along with creating the App Pools and such in IIS. I need to know if there is a way that I can list the value of important properties of an App Pool, such as those
found when selecting "Advanced Properties" on an App Pool through the IIS GUI, to the PowerShell console. The Get-ItemProperty cmdlet doesn't seem to show much.
Thanks in advanceHere is a starter if you have PowerShell support installed:
$pool= get-item iis:AppPools\DefaultAppPool
$pool|gm
You will see all of the methods used to manage the app pool listed. For instructions on how to use them you are best postingin the IIS forums.
¯\_(ツ)_/¯ -
Display/Edit Properties in a Table
Hello everyone,
i'm currently writing a javafx2 app for my bachelor thesis.
in that app, i need a table like view to display the properties in.
but, a normal TableView doesn't do what i want:
a TableView expects a new object for each Row, and displays the columns (aka properties) sideways
but i need them displayed downwards.
my first attempt was a normal tableview, but i didn't manage to display them the way i wanted
my 2nd attempt, was a combination of a splitpane and 2 ListViews, which in fact worked, regarding the way properties/their names were displayed.
but: i didn't manage to make the ListCells editable...
i'll post a short code, containing an example class that i want to display, and the code of my 2nd attempt.
would be great if you could guide me to either a solution with the TableView, as i'd preferr that solution, or hint me how to make ListCells in a ListView editable.
public class MyClass
private String name;
private String type;
private Double creationTime;
public MyClass(MyObject object)
this.name = object.getName();
this.type = object.getType();
this.creationTime = object.getCreationTime();
public String getName()
return this.name;
public void setName(String newName)
this.name = newName;
public String getType()
return this.type;
public void setType(String newType)
this.type = newType;
public Double getCreationTime()
return this.creationTime;
public void setCreationTime(Double newCreationTime)
this.CreationTime = newCreationTime;
}that's the class of the object whose properties i want to displayed/edited
public class MyListView extends SplitPane {
ListView propertyNamesListView;
ListView propertyValuesListView;
private MyObject object;
private ObservableList<String> propertyName;
private ObservableList<String> propertyValue;
static class EditableListCell extends ListCell<String>{
public EditableListCell() {
super();
this.setEditable(true);
@Override
public void updateItem(String item, boolean empty)
super.updateItem(item, empty);
setText(item);
setEditable(true);
public MyListView()
propertyNamesListView = new ListView();
propertyValuesListView = new ListView();
propertyValuesListView.setEditable(true);
propertyValuesListView.setCellFactory(new Callback<ListView<String>, ListCell<String>>() {
@Override public ListCell<String> call(ListView<String> list) {
return new EditableListCell();
propertyValuesListView.getFocusModel().focusedIndexProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue observable, Object oldValue, Object newValue) {
if(newValue instanceof Integer)
propertyValuesListView.edit((Integer)newValue);
this.getItems().addAll(propertyNamesListView, propertyValuesListView);
public void setObject(MyObject object)
this.object = object();
propertyValue = FXCollections.observableArrayList();
propertyValue.add(object.getName());
propertyValue.add(object.getType());
propertyValuesListView.setItems(propertyValue);
propertyName = FXCollections.observableArrayList("Name", "Type");
propertyNamesListView.setItems(propertyName);
}that's my take on the combined ListViews, but i can't edit the fields :(
i really hope that you can help me, looking forward for your responses :-)Thank you Carsten,
I had the wrong Item.
I used "display as text (saves state)"....
Regards,
Tim -
I am writing a custom SSIS source that uses a standard SSIS Flat File Connection Manager. I have got a working UI that shows all usable connection managers in a dropdown list and allows the user to pick one. I would like to be able to have a button that
the user can click on to create a new connection manager, and it would open the properties window for the new connection manager so it can be set up.
Abridged code:
Public Class MyNewSourceUI
Implements IDtsComponentUI
Private MetaData As IDTSComponentMetaData100
Public Function Edit(ByVal parentWindow As IWin32Window, _
ByVal variables As Variables, _
ByVal connections As Connections) As Boolean _
Implements Microsoft.SqlServer.Dts.Pipeline.Design.IDtsComponentUI.Edit
Dim UIwin As New MyNewSourcePropertiesWindow(MetaData, connections)
Return (UIwin.ShowDialog() = DialogResult.OK)
End Function
Public Sub Initialize(ByVal dtsComponentMetadata As IDTSComponentMetaData100, _
ByVal serviceProvider As System.IServiceProvider) _
Implements Microsoft.SqlServer.Dts.Pipeline.Design.IDtsComponentUI.Initialize
MetaData = dtsComponentMetadata
End Sub
End Class
Public Class MyNewSourcePropertiesWindow
Inherits System.Windows.Forms.Form
Private _metadata As IDTSComponentMetaData100
Private _cnxions As Connections
Public Sub New(ByVal ComponentMetaData As IDTSComponentMetaData100, ByVal connections As Connections)
InitializeComponent()
_metadata = ComponentMetaData
_cnxions = connections
ShowConnections()
'Setup Existing Metadata '
End Sub
Private Sub ShowConnections()
Me.cboConnection.Items.Clear()
Me.cboConnection.Items.AddRange((
From i As ConnectionManager In _cnxions _
Where CType(i.Properties("CreationName").GetValue(i), String) = "FLATFILE" _
AndAlso CType(i.Properties("Format").GetValue(i), String) = "Delimited" _
Select i.Name).ToArray())
End Sub
Private Sub btnNewConnection_Click(ByVal sender as Object, ByVal e as System.EventArgs) Handles btnNewConnection.Click
Dim newconn As ConnectionManager = _cnxions.Add("FLATFILE")
ShowConnections()
Me.cboConnection.SelectedItem = newconn.Name
End Sub
Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
Me.DialogResult = DialogResult.Cancel
Me.Close()
End Sub
Private Sub btnOK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOK.Click
'Store any metadata changes '
Me.DialogResult = DialogResult.OK
Me.Close()
End Sub
End Class
That's what I've got so far. I had assumed that adding a new connection would automatically display the properties window to the user (right?). However, in my tests, what actually happens is that it creates the new source with a random GUID for a name and no
other properties set up, and puts it in the connections pane, and that's it. Not real useful.
Obviously, something else is required to make the properties window appear, but I can't find what it is. There's no ShowUI() member on any of the classes I have, and I haven't been able to find out the name of the UI class that's used by the flat file source.
Does anyone know how this is done? I know it can be done, because such a button exists in the normal Flat File Source UI.Yes, you need to drive the UI creation. I see you create a custom connection manager, in this case on how to build its UI please refer to http://kzhendev.wordpress.com/2013/08/07/part-2-adding-a-custom-ui-to-the-connection-manager/
Arthur My Blog -
Where does the properties file go?
Hi Folks!
I'm trying to load a system properties file (myproperties.txt) using the example in java.sun.com. I just want to know where the properties file goes.
The example is as follows:
=========================
import java.io.FileInputStream;
import java.util.Properties;
public class PropertiesTest {
public static void main(String[] args) throws Exception {
// set up new properties object
// from file "myProperties.txt"
FileInputStream propFile = new FileInputStream("myProperties.txt");
Properties p = new Properties(System.getProperties());
p.load(propFile);
// set the system properties
System.setProperties(p);
// display new properties
System.getProperties().list(System.out);
=======================
Could someone tell me where the file should physically reside (C:\..\..\).
Also, is it possible to get the path dynamically by using getRealPath() instead of hard coding the file path in the code..
Thanks for your assistance!
DranimThe properties file goes where you want it to go. Just make sure you give it the full path.
To make it dynamic, just make it a parameter.
java myProg "c:\\temp\\MyProp.txt" -
How to print the data in ALV list format using an existing layout
Hi all
Iam displaying the output in ALV list format and I saved the layout with some name
now my requirement is i have to provide a field to select the layout name with F4 help and if i execute the program it should show the output with that layout format
I tried this iam getting F4 help for that layout and selecting the layout but iam not getting the output with that layout iam getting the normal basic layout
Can anyone send me a sample program code or what to do to get that
Thank youHi,
refer this code.
DATA : wa_variant TYPE disvariant, "Work area for variant
wa_variant1 TYPE disvariant, "Work area for variant
wa_layout TYPE slis_layout_alv, "Work area for layout
*& Form sub_get_default_variant *
This form will initialize the variant *
FORM sub_get_default_variant .
*--Clear
CLEAR wa_variant.
*--Pass the report name
v_repid = sy-repid. "Report ID
wa_variant-report = v_repid.
*--Call the function module to get the default variant
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = c_save
CHANGING
cs_variant = wa_variant1
EXCEPTIONS
wrong_input = 1
not_found = 2
program_error = 3
OTHERS = 4.
*--Check Subrc
IF sy-subrc = 0.
p_varnt = wa_variant-variant.
ENDIF.
ENDFORM. "sub_get_default_variant
*& Form sub_f4_for_variant *
This form will display the List of Variants *
FORM sub_f4_for_variant .
*--Local Variables
DATA: lv_exit(1) TYPE c. "ALV exit
*--Call the function module to display the list of Variants
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = wa_variant
i_save = c_save
IMPORTING
e_exit = lv_exit
es_variant = wa_variant1
EXCEPTIONS
not_found = 1
program_error = 2.
*--Check Subrc
IF sy-subrc <> 2 AND lv_exit IS INITIAL.
p_varnt = wa_variant1-variant.
ENDIF.
ENDFORM. "sub_f4_for_variant
*& Form sub_check_variant *
This form will check the variant *
FORM sub_check_variant .
IF NOT p_varnt IS INITIAL.
CLEAR wa_variant1.
MOVE wa_variant TO wa_variant1.
MOVE p_varnt TO wa_variant1-variant.
*--Call the function module to check the variant exist
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = c_save
CHANGING
cs_variant = wa_variant1.
wa_variant = wa_variant1.
ENDIF.
ENDFORM. "sub_check_variant
Regards,
Prashant -
How to get the properties of my system ?
Hi,
does someone know how to get the properties of my system (like RAM,processor,OS ...) ?
Thanks, Fred.Hi!
Try this:
import java.util.Properties;
public class Props {
public static void main(String[] args) {
// This shows all the properties
System.getProperties().list(System.out);
// This retrieves a special property
System.out.println(System.getProperty("java.runtime.name"));
// Here is to get total system memory
long totalMemory = Runtime.getRuntime().totalMemory();
System.out.println("Total memory: "+totalMemory);
// Here is to get free system memory
long freeMemory = Runtime.getRuntime().freeMemory();
System.out.println("Free memory: "+freeMemory);
}Hope it helps!
/Andrew -
Can I set the value of a list binding in my managed bean?
Dear All,
This is just an exercise for me and I just wanted to experiment on the bindings of ADF for me to understand it further.
I wanted to create a custom Model Driven LOV with my data control listed below
Countries
-CountryId
-CountryName..but I wanted to display the label similar to this
1 - USA
2 - England
n - France..so I thought of manipulating the select items in a bean
<af:selectOneChoice id="soc1" value="#{bindings.Countries.inputValue}">
<f:selectItems value="#{pageFlowScope.MyBean.countries}" id="si1" valuePassThru="true"/>
</af:selectOneChoice>..and the code similar to this
public class MyBean{
public List<SelectItem> getCountries(){
//countryMap points to accessing the iterator binding
//BindingsHelper is a utility class that sets the value
for(...){
SelectItem item = new SelectItem();
item.setLabel(countryMap.get("CountryId") + " - " + countryMap.get("CountryName"));
item.setValue(countryMap.get("CountryId"));
list.add(item);
//set the item to the first row
BindingsHelper.setExpressionValue("#{bindings.Countries.inputValue}",
list.get(0).getValue());
return list;
}...on the last part I wanted to set the value to the first item but I am encountering numberformatexception when setting the list binding.
I know I can do this declaratively also by removing the unselected item but as I have said I am experimenting on the bindings.
Is this not possible?
Thanks.
JDev 11G PS5Hi ,
I understand that , you want to show select one choice (dropdown) with label (countyid - country name) and value is (countryid).
and these informnation is coming from ADf Model ( may be a VO).
in the UI page you used this list is coming from MyBean
<af:selectOneChoice id="soc1" value="#{bindings.Countries.inputValue}">
<f:selectItems value="#{pageFlowScope.MyBean.countries}" id="si1" valuePassThru="true"/>
</af:selectOneChoice>
so ,
The Managed Bean code should be ,
private List<SelectItem> countries;
///setter method
public void setCountries(List<SelectItem> countries) {
this.countries= countries;
// getter method
public List<SelectItem> getQuoteStatusList() {
quoteStatusList =
selectItemsForIterator("countriesVOIterator",
"countryId", "countryName");
return quoteStatusList;
public static List<SelectItem> selectItemsForIterator(String iteratorName, String valueAttrName, String displayAttrName) {
return selectItemsForIterator(findIterator(iteratorName), valueAttrName, displayAttrName);
public static DCIteratorBinding findIterator(String name) {
DCIteratorBinding iter = getDCBindingContainer().findIteratorBinding(name);
if (iter == null) {
throw new RuntimeException("Iterator '" + name + "' not found");
return iter;
public static List<SelectItem> selectItemsForIterator(DCIteratorBinding iter, String valueAttrName, String displayAttrName) {
List<SelectItem> selectItems = new ArrayList<SelectItem>();
for (Row r : iter.getAllRowsInRange()) {
string labelValue = (String)r.getAttribute(valueAttrName) +"-"+ (String)r.getAttribute(displayAttrName);
selectItems.add(new SelectItem(r.getAttribute(valueAttrName),labelValue ));
return selectItems;
this will give you what you except in the ui
when you try to get the value form that seclecOneChoice value in MyBean what user selects , you can simply get the value of this selectOneChoice. -
Displayed Properties in Collection List Renderer are not displayed
Hello All,
I have created one custom property and entered the value for a resource which had that property.
Now, when I am trying to display the custom property in any layout, its not coming, even though I have added the property name in the Displayed Property of the collection list renderer.
To check the view is taking the correct layout or not, i changed some other settings of the collection list renderer and the changes are immediately getting reflected. What could be the problem here?
Any help, deeply appreciated
Regards
BPHello Bobu,
Are you using a different Namespace Alias other than 'Default' in your property definition? If so then you need to specify the property in the 'Displayed Properties' parameter of the collection renderer as <NamespaceAlias>:<propetrty ID>, e.g. rnd:displayname.
Other than that you should check the 'Folder Validity Patterns' and 'Document Validity Patterns' to make sure they are valid for the content on which you are trying to display this property, you may have already checked this.
Regards,
Lorcan. -
Displaying only certain properties in the Properties Pane
Hi
The properties pane that is available as a component in the Web Application Designer is quite a useful component. However, there are certain properties that we don't want to make available to the user.
At the moment I am using the property pane with the following config:
Property Set Definition : PROP_SET_PREDEFINED
Properties Source : Web Item Parameters
Web Item : Analysis
As mentioned, that works nicely, and shows me an area with 3 columns of properties, namely:
- Layout
- Alternate Table Row Styles
- Cell Specific Settings
- Exception Visualisation
- Document icons for data
- Document icons for metadata
- Document icons for masterdata
- Data Specific Settings
- Display Repeated Texts
- Scaling Factos Visible
Now, we don't want to display the "document icons ..." properties, as that doesn't make sense for our users.
How would I go about not displaying those properties?
I have played around with the properties pane item, and I can see how to list a single property. For this I set:
Properties Set Definition = Single Value
Property Name = ALTERNATE_STYLES
This works, and I then only see 1 property being displayed. I can get the technical name of the property by using my standard pane with the verbose mode set to ON.
To display multiple propeties of my choosing, I thought I would be able to use the PROP_SET_MATRIX option. I can select this, then start defining the table. I need to assign the following properties:
- GROUP_DESC : <Not sure what to put in here>
- COLUMN : 1 (the number of columns I want)
The I have a "properties list", where it looks like I can specify which properties are to be include. For this I need to provide:
- Property Name : ALTERNATE_STYLES
- Caption : Alternate Table Row Styles
- Property Parent : < Don't know what to put in here>
I have tried various values in the Property Parent and the group_desc fields, but still I see nothing and sometimes get rather meaningless errors appearing.
Surely this shouldn't be a difficult task.?
The SAP help file (http://help.sap.com/saphelp_nw04s/helpdata/en/43/69b8a62985619ae10000000a1553f6/content.htm) provides the following really useful description of PROPERTY_PARENT:
You specify the property parent
Please, is there anyone out there that has done this, and if so, please point me in the right direction.
Cheers,
AndrewAny Update on the below query
-
What Component should be used to display the list on UI
Hi All,
I have a table in which when the user selects a row and tries to remove the row. I am supposed to show the pop up which shows all the rows matching to the header of the row.
In my backing bean i have the context of the row so i could extract the matching rows form db into a List<String> . Now what i need to know is which component on the Ui will show this as a list in Pop Up.
I mean which component af:??? should be used to display the List ?
I am kind of new to ADF.
Regards,
SharmainputComboboxListOfValues
selectOneChoice
inputListOfValues -
How to display the Attachment(picture) on the list item page?
I have attached a picture to the list item and then when I click the item, there is a link of the attachment but not the picture graphics! I want to display the picture on the list item page and how to do it?
I am a beginner of SharePoint 2010 and my English is not very good! Thanks!Hi,
Using few easy steps you can set image in your out of the box List View, Edit and View Item Page.
1. Create one Picture type Column in your list.
2. Just create one Event Handler with Item
/// <summary>
/// An attachment was added to the item.
/// </summary>
public override void ItemAttachmentAdded(SPItemEventProperties properties)
base.ItemAttachmentAdded(properties);
SPListItem item = properties.ListItem;
//SPAttachmentCollection attach = item.Attachments;
string attachmentUrl = item.Attachments.UrlPrefix + item.Attachments[0];
item["PictureColumnName"] = attachmentUrl;
item.Update();
Now, just add item with attachment and you will see attached image in Picture Column field.
Manoj | SharePoint -
Displaying the list of resources
Hi guys,
I need to display the resources assigned to the each user, in the form. i have the list of user objects and i am doing iteration using fieldloop. is there any function to get the list of resources assigned to the user.
i am trying with user.getAssignedResources( ) metho. But its giving me the following xpress exception
XPRESS exception:
Can't call method getAssignedResourceList on class com.waveset.object.WSUser ==> com.waveset.util.WavesetException: Cannot resolve resources without a cacheThe getAssignedResourceList method works for me.... not sure what causes the cache exception mentioned above
Message was edited by:
chits98 -
Displaying the list of values in the Report
Hi All,
Is there any possibility to include the scrollable list on the face of report(Not in the left side i.e as input control)
For example If I have a country with different counties.
Based on the country selection in the block it should display the list of counties as scrollable list.
Would it be possible.
Please help
thanks
Edited by: VP S on Sep 1, 2010 2:45 PMNot sure if you are looking for the same..
Have you tried applying the filter at the filter pane..i.e.
Click on the the show\hide filter pane (filter icon is present nearby the drill icon)
Now drag the required object on this pane.
It will create the dropdown filters on top of the report.
Regards,
Rohit
Maybe you are looking for
-
Simultaneously Controlling LabVIEW Remote Front Panels not working properly
We are trying to simultaneously control a Executable file from different PC as per the description given in link below: http://www.ni.com/white-paper/4867/en But the issue is that we are not able to view it in Web browser as in "Web Publishing tool"
-
Hi, I have an album of 15 songs, 5 of which are Christmas songs. I've created a Smart Playlist called Holiday to gater up all my Christmas songs and music. I can see only two ways of getting those 5 songs onto my playlist:- 1) change the genre of the
-
Hi Guys, In my run() method, I am making a call to a method from an object provided by third party...now sometimes it just takes forever for that method to return the response back and we have to impose restriction to abort it if it is taking more th
-
I have started designing a lot of websites for real estate agents and they always want access to make changes to their site. I always include unlimited changes for them but is there any way of simply setting it up for them to access their site and ma
-
Where do I go to upgrade my plan? Why don't you have a link? It *****!!!