Property Binding
I placed a hyperlink, two images on a page and output text on a page.
When the hyperlink has focus, or obtains a onmouseover event,
i would like to change the contents of the image (to another image),
or make it go invisible, while updating and changing the output text.
Do I use the property binding for this?
I tried bind the the name of the value property of the output text
however, it appears the javascript is not being executed or
the display is not being updated. Can any point me to how
I accomplished this w/in the context of using the Creator?
Thanks,
--peter
If I'm correct you need to accomplish this purely by Java Script to do it at the client side. If you are using property binding to accomplish this then the page need to be submited every time as property binding is done at server side.
- Winston
Similar Messages
-
Property binding of a dynamic UI element
Hi all,
It is no problem to define property binding of a UI element statically (see [Example|http://wiki.sdn.sap.com/wiki/display/WDABAP/SimpleapplicationtochangepropertiesofUIElementsduringruntimeinWebDynpro+ABAP])
But, how can I define property binding for a UI element which I create at runtime? I can't find any statement to tell the UI element (for example CL_WD_INPUT_FIELD) that it should use property binding.
Any ideas?
Best regards
OliverHi Prashant
I already use bind_value (it has the complete path to the attribute).
The attribute value is shown correctly, but the visibility doesn't work.
Keep in mind that I do not want to create a dedicated context attribute for visibility. I want to use the property of the context attribute.
At time of dynamic context creation, I use the following statement to set the value of the context attribute property:
DATA l_attribute_name TYPE string.
l_attribute_name = <fs_context_attribute_info>-name.
CALL METHOD lr_context_element->set_attribute_property
EXPORTING
attribute_name = l_attribute_name
property = lr_context_element->e_property-visible
value = l_visible.
When creating the UI element, the following code is used.
DATA lr_input_field TYPE REF TO cl_wd_input_field.
CALL METHOD cl_wd_input_field=>new_input_field
EXPORTING
bind_value = l_context_binding_value
* bind_visible =
id = l_id
state = l_state
* visible =
RECEIVING
control = lr_input_field.
Keep in mind that I can't use bind_value (I dont want an dedicated context attribute for visibility) and I also can't use visible because it should be context (attribute property) dependent.
Thanks in advance
Oliver -
Property binding causes Bean property to be null when Component is readonly
I am retrieving an object (instantiation of a Bean) from a list of objects displayed in a table.
A set of components (textfields, textareas) are bound to the properties of the retrieved object. - propertybinding, text property bound to name property of managed bean.
If I make any of the bound components read-only the corresponding property of the bound object is set to null.
Why is this? Is there a work-around for this? If there is not I will not be able to make use of the propertybinding feature and I will have to populate and retrieve from components manually.
I have tested this using different components and setting up binding in multiple ways - through "data binding" and through "property binding" directly to the text field of the component.
Thanks,I have been working with my issue for a little bit and I've learned that binding to an object (or Bean) can be dangerous for the object.
In SessionBean1 I have instantiated two objects of my bean TransferMethod, tm1 and tm2. tm2 is a "copy" of tm1 in that it contains all the same data, but in separate memory.
I've bound tm1 to text fields on my jsp page. tm2 is not bound to anything.
My page has a table, and edit area and several buttons. When I load my page it populates the table with data. I select a row from the table and click my "Edit" button. This instantiates the tm1 and tm2 objects and populates them with data from the row.
As my text fields are bound to tm1 the text fields are now populated when the page is re-displayed. The name field is bound to the name property and the component is set to readonly. The description field is bound to the description property and has no other configuration.
When I click my "Save" button and interrogate my tm1 and tm2 objectsm all properties in my tm1 object are reset to default values with the exception of the description field. All properties of the tm2 object are still populated with original data.
This tells me that binding an object to components is not feasible if you expect to continually work with that object on a single page.
My work around will be to manually assign the properties of my object to my textfields and vice-versa.
Hopefully the new version of Creator will address this issue.
Rebecca -
Property binding for size produces wrong results on size change
Hi,
I've a small class extending from BorderPane. This class contains a simple Rectangle whichs size is bound to the size of the BorderPane minus 20:
package com.example;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
public class InnerBorder extends BorderPane {
private Rectangle r = null;
public InnerBorder() {
this.r = new Rectangle();
r.widthProperty().bind(this.widthProperty().subtract(20));
r.heightProperty().bind(this.heightProperty().subtract(20));
r.setStrokeWidth(0.5f);
r.setFill(null);
r.setStroke(Color.BLACK);
this.setCenter(r);
}Used in a small application:
package com.example;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public class Example extends Application {
public static void main(String[] args) {
launch(args);
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Hello World!");
BorderPane root = new BorderPane();
root.setCenter(new InnerBorder());
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();
}When I change the size of the window, the size of the rectangle changes also. But the result looks a little bit strange. When a change the size too fast, the size of the rectangle will not be changed correctly. The rectangle will became larger than the window and is then, of course, not longer visible. Changing then the window a little bit slower will again result in a correct rectangle. Until the next too fast window size changing.
Is there anything wrong on my code?
When I use the same implementation (property binding) in a Control with a Skin, the result is even more strange. If the subtract is too small (< ~40), the size grows endless. Of course the window size doesnt grows, but the property value grows on every size change, even if the window will be smaller. This code is a little bit more, so I will post it if no one could show me an error in my sourcecode above.
Kind regardsHi. I did some modifications. Now it looks OK.
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
public class InnerBorder extends BorderPane {
// private Rectangle r = null;
public Rectangle r = null;
public InnerBorder() {
this.r = new Rectangle();
// r.widthProperty().bind(this.widthProperty().subtract(20));
// r.heightProperty().bind(this.heightProperty().subtract(20));
r.setStrokeWidth(0.5f);
r.setFill(null);
r.setStroke(Color.BLACK);
this.setCenter(r);
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public class Example extends Application {
public static void main(String[] args) {
launch(args);
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Hello World!");
BorderPane root = new BorderPane();
InnerBorder inb = new InnerBorder();
inb.r.widthProperty().bind(root.widthProperty().subtract(20));
inb.r.heightProperty().bind(root.heightProperty().subtract(20));
root.setCenter(inb);
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();
} -
Difference between Property binding, Aggregation Binding and Element binding?
what is difference between Property binding, Aggregation Binding and Element binding?
HI Rajesh,
Firstly ,
A binding path can either be absolute (starting with a slash), or relative (starting with a name token)
1. Element Binding:
Here we specify the refrenced object.
eg if you bind company object to a layout, like
var oMatrixLayout = new sap.ui.commons.layout.MatrixLayout();
oMatrixLayout.bindElement("/company");
then all the children of this layout can refer to the context of this object. like suppose company has name attribute, then we can directly pass it to the child like:
oMatrixLayout.createRow(
new sap.ui.commons.Label({text: "Name:"}),
new sap.ui.commons.TextField({value: "{name}"})
All the relative bindings within the control and all of its children are resolved relatively
2. Property binding is similar to the context mapping in WebdnyPro. We bind it to a property of the UI. It is automatically updated when its vlaue is changed.
3. Aggregation binding (basically a list) defines a template(a model which others can copy) and this template is cloned for each entry of the list. When we make an entry in the list, a clone of the template is created.When the clone is created, the context is set to the entry in the list. Thus all the binding to the template are resolved relative to the entry. This is maily used for large data sets where we will only clone the current entry and not the complete list.
Regards,
Nikhil -
Property binding between custom control and its aggregations
Hi,
I have a custom control with some properties, e.g., visible, and I would like to bind these properties to its aggregated controls without losing the two-way binding functionality. For example, imagine the following control:
sap.ui.core.Control.extend('dev.view.control.MyControl', {
metadata: {
properties: {
'visible': {type: 'boolean', defaultValue: false},
aggregations : {
_innerTable : {type : 'sap.m.Table', multiple : false, visibility: 'hidden'}
So in this example, I would like to bind the "visible" property of the _innerTable to the "visible" property of MyControl without losing two-way binding. That means that I do not want to read the "visible" property once in a constructor or so and set it on the inner table. Instead I want _innerTable to react on changes of the "visible" property of MyControl so that I can bind it, for example, with "visible={/model/visible}" on an instance of MyControl and _innerTable changes when the model changes.
Does anyone know if such a "piping" or "chaining" of properties is possible and how it would be done?It's close to my case, but you pass the label to your custom control from outside, where you also perform the data binding. In this case, you know which path should be bound to the label property.
In my case, the control is hidden inside my control, so I do not know which path from the model should be bound to the inner control. I want to somehow connect the property of my control with the property of the inner control.
So taking part of your example, the control would look like:
sap.ui.core.Control.extend('xcontrol', {
metadata: {
properties: {
'visible': {type: 'boolean', defaultValue: true}
aggregations : {
_header : {type : 'sap.m.Label', multiple : false, visibility: 'hidden'}
init: function() {
this.setAggregation('_header', new sap.m.Label({
visible: <????>
renderer: function(oRm, oControl) {
oRm.write("<div");
oRm.writeControlData(oControl);
var header = oControl.getAggregation('_header');
if (header) {
oRm.renderControl(header);
oRm.write('</div>');
At point <????> I want to somehow bind the visible attribute of the label to the visible property of xcontrol without losing the two-way binding, i.e., the label should react on changes of the visible property just like xcontrol would. -
Is there any way to read the field name,through the property binded to it.
Hi
I want to know that,is there any method exits with which i can find the field names of the screen,if i have the property attribute with me.
as my req is to make the validation for the property attr,& check how many fields are binded with the single property attr,i have read the property attr dynamically,now need to find the fields linked,& need to check how many fields have not field value,& through the error msg.just read the attribute binded to properties using code wizard ( Control + F7).
Code generalted will be like :
DATA lo_nd_cn_check TYPE REF TO if_wd_context_node.
DATA lo_el_cn_check TYPE REF TO if_wd_context_element.
DATA ls_cn_check TYPE wd_this->element_cn_check.
DATA lv_ca_check LIKE ls_cn_check-ca_check.
navigate from <CONTEXT> to <CN_CHECK> via lead selection
lo_nd_cn_check = wd_context->get_child_node( name = wd_this->wdctx_cn_check ).
get element via lead selection
lo_el_cn_check = lo_nd_cn_check->get_element( ).
get single attribute
lo_el_cn_check->get_attribute(
EXPORTING
name = `CA_CHECK`
IMPORTING
value = lv_ca_check ).
Here i have read attribute CA_CHECK. -
Checkbox group selected property binding not working
Hi,
I've been through all the threads and tutorials relating to this problem and none of them help.
The Situation
I have a checkbox group which I have bound the items items property to a MySQL database (value field = int, display field = String). I have bound the Selected property to a sessionbean field which is an int[] array.
I have a processValueChange event for my checkbox group which grabs the selected boxes values (ie the int value of the checkbox id). Based on these values it does some other processing.
The Problem
When the page loads everything is displayed ok. When I select a checkbox within the checkbox group the getSelected() method returns the int value of the selected checkbox and perform other processing as necessary... so far so good.
However, when the page finishes processing and reloads the selected checkboxes are not ticked. I'm sure it has something to do with the Selected property of the checkboxgroup but I can't for the life of me work out why. For multiselect objects the Selected property must be bound to an array which I have done with my int[] array. I've tried preloading the array with default values (1, 2, etc) to mimic the int values from the database. I've tried changing the array to a boolean array but this throws exceptions. So basically i'm stuck.
The Source
Session Bean
private int[] extras;
public int[] getExtras() {
return this.extras;
public void setExtras(int[] extras) {
this.extras = extras;
Page JSP
<ui:checkboxGroup binding="#{book_package.extras}"
converter="#{book_package.extrasConverter}" id="extras"
items="#{book_package.extrasDataProvider.options['extras.ExtrasID,extras.Name']}"
onClick="common_timeoutSubmitForm(this.form, 'table:tr:td:table:tr:td:table:tr:td:div:div:table:tr:td:extras');"
selected="#{SessionBean1.extras}" valueChangeListener="#{book_package.extras_processValueChange}"/>
Page Java
public void extras_processValueChange(ValueChangeEvent event) {
// TODO: Replace with your code
getSessionBean1().setExtrasTotal(0);
try {
int[] extra = (int[])extras.getSelected();
int extrasId = 0;
int extraPrice = 0;
if (extra.length != 0) {
for (int i=0; i < extra.length; i++) {
extrasDataProvider.cursorFirst();
do {
extrasId = new Integer(extrasDataProvider.getValue("ExtrasId").toString()).intValue();
if (extrasId == extra) {
extraPrice = getSessionBean1().getExtrasTotal() + new Integer(extrasDataProvider.getValue("Price").toString()).intValue();
getSessionBean1().setExtrasTotal(extraPrice);
break;
} while (extrasDataProvider.cursorNext());
} catch (Exception e) {
log("Exception occurred!!", e);
error("Error: "+e.getMessage());
getSessionBean1().setTotalPrice(getSessionBean1().getPackagePrice() + getSessionBean1().getExtrasTotal());
Any help appreciated.
Thanks.ok, i found the problem. MySQL int value is treated as an Integer in Creator. I changed my SessionBean array from int[] to Integer[] and now it works properly... phew!!!
-
Binding to an indexed property
Hi
Not sure if this is the correct way to do this, but I created
an indexed property ( String array ) in the session bean
with the intention of binding a TextField value to an
indexed position on the indexed property. When attempting
to perform the Property Binding for the TextField component
I don't see the indexed property to bind to.
Is this possible ?
ThanksHi Colinodo,
I am just interacting with people so as to where an external customer can view the filed bugs.
Once i get the link I would be providing you the reference number and the link.
Regards. -
XAML Binding for relationship property
hi,
I'm trying to bind a relationship property to a TextBox in a XAML form.
<ListView VerticalAlignment="Top" x:Name="listviewtest" MinHeight="350" ItemsSource="{Binding Path=componentalias, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
<ListView.View>
<GridView>
<GridViewColumn Header="Field1"
DisplayMemberBinding="{Binding Path=field1}"
Width="Auto" />
<GridViewColumn Header="Field2"
DisplayMemberBinding="{Binding field2}"
Width="Auto" />
<GridViewColumn Header="Field3"
Width="Auto">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Path=relationshipproperty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
What am I missing?
thanks!Sorry about that! Folks tend to use "relationship" and "property" interchangeably.
Are you using the console API (The IDataItem stuff)? If so, I'm not sure if relationship property binding is supported. The console API does have interfaces for relationship objects (in the form of the EnterpriseManagementRelationshipObjectDataType class),
however, I'm not sure how (or even if) they exist within an IDataItem or BindableCachedDataItem projection.
For reference, the windows computer form displays an Installed Software item's "Installed Date" which is a relationship property. However, the windows computer form exposes that property via a viewmodel proxy. It doesn't get the InstalledDate from
the IDataItem..instead, it queries the SDK (technically the DAS) for the relationship's properties, then loads them into the viewmodel proxy. Only one-way binding is supported though..there's no mechanism to update the installed date from the form. In
order to update a relationship property with the proxy method, you would have to update the relationship properties later via the standard SDK..which would be problematic at best (it would probably cause collisions), and would be convoluted to implement anyway.
Mixing Console API updates and SDK updates is rarely a good idea.
I'll dig into the console API a little bit and see if relationship properties/binding are supported at all. I'm curious now. -
Model Binding and Calculated Field Syntax for "class" Attribute
Hi,
I tried to use the calculated field syntax from SAP UI5 to change the CSS class attribute of an element based on some model property, i.e., I wanted to change the class in the corresponding formatter function based on the currently bound value. However, my formatter function is not called. When I use the same syntax on a text attribute, it works.
I also tried to use normal property binding, but it did not work on the class attribute either (it just put class="{property}" in the rendered HTML).
Is there anything I missed or is it just not possible to use property binding and calculated field syntax for class attributes? Did anybody try something like this before?
I think it is a standard use case to change the CSS class based on some model property. So, if anybody knows how to do that, could you give a short example?
Best regards
SvenjaThey have a class property. At least, I can do the following in an XML view:
<Button
icon="sap-icon://add"
press="onButtonPress"
class="my-button-class" />
I would expect the following to work as well, but for me it did not:
<Button
icon="sap-icon://add"
press="onButtonPress"
class="{/customClass}" />
This renders the following HTML (cropped to the important parts):
<button type="button" class="sapMBtn {/customClass}">
</button>
It seems like the class attribute is something special although I don't see a reason why. Other HTML templating engines, for example, support things like that. -
OutputText : why both bind and value attribute and other gripes
Hi
gripe1
I have started using creator and I'm a bit confused as to why creator insists on the binding attribute being in place to link the outputText field to the default managed bean -
like most of us I want to set the value via a resource bundle. ( as shown blelow). If I delete the binding atttribute then outputText Field doesn't get displayed in the Visual Design tab. aaaaaaah!
<h:outputText binding="#{DemographicInformation.nameLabel}" id="nameLabel" value="#{bundle.userName_label}"/>
gripe2
When you declare a resource bundle; either through editing the source directly or dragging from the advanced palette you can't seem to be able place the contained "names" in this the individual outputText field values via value property->bind to object->select from property file. i.e you do don't see to be able to expand the f: loadBundle. This results in a lot of tedious typing
which I thought this tool was all about preventing!
Regards
DanielRe gripe 1:
Why do you want to remove the binding attribute? The binding attribute has nothing to do with the value - you can certainly display values from resource files without removing the binding attribute. One of the online tutorials (the Sign On example) shows a Creator project using bundle files.
Re gripe 2:
The designtime experience for using bundle files in the web app has been improved in the next version of Creator.
-- Tor
http://blogs.sun.com/tor -
Where is detailed description of what data binding language can do?
Where in the documentation does it clearly spell out exactly what you can do with
the data binding language (the stuff between "{...}")? I'm trying to understand
what is happening in the SamplesApp, in the "repeaterTag" module, in XMLString.jsp
and repeaterTagController.jpf.
In particular, in XMLString.jsp, it references an expression like this:
<netui-data:repeater dataSource="{pageContext.xml.employee}">
I can't figure out how this is working. I can see that the "callPageFlow" tag
just before this is putting the result of "getXMLStr()" into the "xml" variable.
This string looks like this:
<employees>
<employee title=\"CEO\"><first>Mary</first><last>Smith</last></employee>
<employee title=\"President\"><first>Mark</first><last>Jones</last></employee>
<employee title=\"Vice President\"><first>Matt</first><last>Nelson</last></employee>
<employee title=\"Salesperson\"><first>John</first><last>Doe</last></employee>
<employee title=\"Office Manager\"><first>Jane</first><last>Doe</last></employee>
</employees>
This usage of the data binding language is a little unusual, but I would assume
it's documented somewhere, right?I had already read that description. It has just about one sentence that covers
the ability to reference elements of an XML string, but without giving any usable
details. I was already convinced that this and direct variable references were
worth avoiding, I just wanted to understand the extent of the available features
first. I guess the lack of any documentation on referencing elements in XML strings
will make it easier to deprecate :) .
Eddie O'Neil <[email protected]> wrote:
David--
A general data binding description is here:
http://edocs.bea.com/workshop/docs81/doc/en/workshop/guide/netui/guide/conDatabindingXScript.html
This help topic describes the NetUI data binding contexts and how
properties / objects are
accessed using them. As far as property binding, a question that came
up in the group earlier,
public properties always win over JavaBean properties, so if you expose
data on any Java object
(page flow, global app, form bean, repeated data item) like this:
::::: Controller.jpf
public String foo = "foo";
private String anotherFoo = "another foo";
public String getFoo()
return anotherFoo;
and bind to this in a JSP:
<netui:label value="{pageFlow.foo}"/>
the value "foo" will display in your page because it is a public property.
The specific example that you mention below is a sample of using the
XScript capabilities in the
8.1 NetUI data binding language to bind directly to parts of an XML document
without having turned
the document itself into a JavaBean.
Frankly, I'd encourage you to use a JavaBean centric approach as we
will likely deprecate this
feature in the future in favor of a more XMLBean / JavaBean centric binding
model. The JavaBean
property binding model is also much more in-line with the JSP 2.0 expression
language.
In the same vein, I'd also suggest following the best practice of
exposing JavaBean properties on
your objects instead of using direct binding to fields.
If you have additional specific questions, feel free to post them
here and we can address them as
they come up.
Hope that helps...
Eddie
David Karr wrote:
Where in the documentation does it clearly spell out exactly what youcan do with
the data binding language (the stuff between "{...}")? I'm tryingto understand
what is happening in the SamplesApp, in the "repeaterTag" module,in XMLString.jsp
and repeaterTagController.jpf.
In particular, in XMLString.jsp, it references an expression like this:
<netui-data:repeater dataSource="{pageContext.xml.employee}">
I can't figure out how this is working. I can see that the "callPageFlow"tag
just before this is putting the result of "getXMLStr()" into the "xml"variable.
This string looks like this:
<employees>
<employee title=\"CEO\"><first>Mary</first><last>Smith</last></employee>
<employee title=\"President\"><first>Mark</first><last>Jones</last></employee>
<employee title=\"Vice President\"><first>Matt</first><last>Nelson</last></employee>
<employee title=\"Salesperson\"><first>John</first><last>Doe</last></employee>
<employee title=\"Office Manager\"><first>Jane</first><last>Doe</last></employee>
</employees>
This usage of the data binding language is a little unusual, but Iwould assume
it's documented somewhere, right? -
Good morning,
I already implemented a application that loads images from a directory to a listbox. All ok but the loading takes about 5 seconds to display around 20-30 images. Is there a way to decrease the time needed for the images to be loaded. Or is it correct to
display an loading image in front of the UI so the user knows images are loading? Thank you in advance for the help. Below is my xaml code for the listbox.
<ListBox Name="Images" ListBox.SelectionChanged="lstImagesChange_Click" Grid.Column="1"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" VirtualizingStackPanel.IsVirtualizing="false"
VirtualizingStackPanel.VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
<ListBox.Resources>
<Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
<Style.Triggers>
<Trigger Property="Orientation" Value="Vertical">
<Setter Property="Width" Value="20"/>
<Setter Property="Height" Value="Auto" />
</Trigger>
</Style.Triggers>
</Style>
</ListBox.Resources>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" Orientation="Horizontal" FlowDirection="LeftToRight" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderThickness="2" BorderBrush="#bb62d8" Background="Black" Width="200" Height="200" Margin="5,5,10,5" CornerRadius="10">
<Image Source="{Binding Path=Path, Converter={StaticResource UriToBitmapConverter}}" Tag="{Binding ImageID}" />
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
and below is the code loading the images
if (!(images == null))
Images.ItemsSource = images;Hmm, so are your images really 150x150 or are they larger than that?
Anyway, here's one solution to show a "loading" image and not block the UI while all images are loading. You seem to already have some class with a Path property which you use as image Source. Let's say ImageItem
public class ImageItem : INotifyPropertyChanged
private static ImageSource loadingImage;
private ImageSource image;
private Task loadingTask;
private string path;
public string Path
get { return path; }
set { path = value; }
public ImageSource Image {
get {
if (image == null) {
if (loadingTask == null) {
if (loadingImage == null)
loadingImage = new BitmapImage(new Uri("loading.png", UriKind.Relative));
image = loadingImage;
loadingTask = Task.Run<BitmapImage>(() => {
var bi = new BitmapImage();
bi.BeginInit();
bi.DecodePixelWidth = 64;
bi.CacheOption = BitmapCacheOption.OnLoad;
bi.UriSource = new Uri(path);
bi.EndInit();
bi.Freeze();
return bi;
}).ContinueWith(t => {
Image = t.Result;
loadingTask = null;
}, TaskScheduler.FromCurrentSynchronizationContext());
return image;
private set {
if (image == value)
return;
image = value;
OnPropertyChanged("Image");
private void OnPropertyChanged(string propertyName)
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
public event PropertyChangedEventHandler PropertyChanged;
In summary:
there's a new Image property, bind Image.Source to that instead of Path
when the Image property is read for the first time it will start a task which loads the actual image and return loadingImage instead of the real image
when the loading task completes it will set the Image property to the loaded image. This will raise a property changed notification that will update the Image control in the UI.
of course, the converter is no longer needed
"loading.png" must be part of the project and in the same folder as the XAML file
Caveats:
This works well for a relatively small number of images like 20-30. For more images you'd really need a WrapPanel that supports virtualization, that would allow images to be loaded as the user scrolls through the list. Without virtualization all images will
be loaded and even if the UI doesn't lock up you'll saturate the CPU for a long time with so many tasks. -
Hi all ,
I am getting below error while calling existing RESTful webservice from BPEL SOA composite, using HTTP Binding:
*“null schema location for ns=null [Cause=null schema location for ns=null] at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:575)”*
WSDL file for HTTP service is
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="CASPaymentService"
targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/http/HelloWorldServlet/CSGetPaymentProvABCS/CASPaymentService"
xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/http/HelloWorldServlet/CSGetPaymentProvABCS/CASPaymentService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<plt:partnerLinkType name="Request_Response_plt">
<plt:role name="Request-Response_role">
<plt:portType name="tns:Request_Response_ptt"/>
</plt:role>
</plt:partnerLinkType>
<wsdl:types>
*<schema xmlns="http://www.w3.org/2001/XMLSchema">*
*<include schemaLocation="xsd/InputOutputFault.xsd"/>*
*</schema>*
</wsdl:types>
*<wsdl:message name="envelope_msg_in">*
*<wsdl:part name="input" element="envelope"/>*
*</wsdl:message>*
*<wsdl:message name="envelope_msg_out">*
*<wsdl:part name="envelope" element="envelope"/>*
*</wsdl:message>*
<wsdl:portType name="Request_Response_ptt">
<wsdl:operation name="Request-Response">
<wsdl:input message="tns:envelope_msg_in"/>
<wsdl:output message="tns:envelope_msg_out"/>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>
Input schema ( InputOutputFault.xsd) is like below: Please note it has no namespace
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="envelope">
</xsd:element>
</xsd:schema>
binding in composite.xml is :
<reference name="GetPaymentCAS" ui:wsdlLocation="GetPaymentCAS.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/pcbpel/adapter/http/HelloWorldServlet/GetPaymentCASServiceCall/GetPaymentCAS#wsdl.interface(Request_Response_ptt)"/>
<binding.ws port="http://xmlns.oracle.com/pcbpel/adapter/http/HelloWorldServlet/GetPaymentCASServiceCall/GetPaymentCAS#wsdl.endpoint(GetPaymentCAS/Request_Response_pt)"
location="GetPaymentCAS.wsdl" supports="http">
<property name="http.verb" type="xs:string" many="false">POST</property>
<property name="endpointURI" type="xs:string" many="false">http://testaia:9111/CAS/servlets/PaymentServicesServlet</property>
<property name="http.payload" type="xs:string" many="false">xml</property>
</binding.ws>
</reference>
It seems like HTTP binding in 11g works with XSD with some namespace only. And if we provide the schema details in either <wsdl:types> or via “including schema in wsdl” as shown above, at runtime it still try to look for schema file.
Any workaround/solution for same is highly appreciated.
Thanks & Regards
Pintoohi,
I depolyd my ProvideABCS into EM here i ubable to invoke the serveses i get below error
webservices invoikesfail:
The selected operation ProcessEcoproduct could not be invoked.
An exception occured while invoking the webservice operation. Please see logs for more details.
oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : oracle.fabric.common.FabricInvocationException: java.lang.NullPointerException
addtionalinfo:
java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : oracle.fabric.common.FabricInvocationException: java.lang.NullPointerException at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:808) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:384) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:301) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.el.parser.AstValue.invoke(Unknown Source) at com.sun.el.MethodExpressionImpl.invoke(Unknown Source) at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53) at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256) at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96) at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96) at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.emSDK.license.LicenseFilter.doFilter(LicenseFilter.java:101) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446) at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177) at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.help.web.rich.OHWFilter.doFilter(Unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.emas.fwk.MASConnectionFilter.doFilter(MASConnectionFilter.java:41) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.AuditServletFilter.doFilter(AuditServletFilter.java:179) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.EMRepLoginFilter.doFilter(EMRepLoginFilter.java:203) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.core.model.targetauth.EMLangPrefFilter.doFilter(EMLangPrefFilter.java:158) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.core.app.perf.PerfFilter.doFilter(PerfFilter.java:141) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:542) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119) at java.security.AccessController.doPrivileged(Native Method) at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315) at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442) at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103) at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171) at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:178) Caused by: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : oracle.fabric.common.FabricInvocationException: java.lang.NullPointerException at oracle.sysman.emSDK.webservices.wsdlapi.dispatch.DispatchUtil.invoke(DispatchUtil.java:362) at oracle.sysman.emSDK.webservices.wsdlparser.OperationInfoImpl.invokeWithDispatch(OperationInfoImpl.java:1004) at oracle.sysman.emas.model.wsmgt.PortName.invokeOperation(PortName.java:750) at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:802) ... 79 more Caused by: oracle.j2ee.ws.client.jaxws.JRFSOAPFaultException: Client received SOAP Fault from server : oracle.fabric.common.FabricInvocationException: java.lang.NullPointerException at oracle.j2ee.ws.client.jaxws.DispatchImpl.throwJAXWSSoapFaultException(DispatchImpl.java:1040) at oracle.j2ee.ws.client.jaxws.DispatchImpl.invoke(DispatchImpl.java:826) at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.synchronousInvocationWithRetry(OracleDispatchImpl.java:235) at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.invoke(OracleDispatchImpl.java:106) at oracle.sysman.emSDK.webservices.wsdlapi.dispatch.DispatchUtil.invoke(DispatchUtil.java:358) ... 82 more
please help on it
Maybe you are looking for
-
I am looking for a good easy app like quicken 2007 I mostly do my checking
I am looking for a easy checkbook app that is formated like the old quicken 2007
-
Macbook Pro 13" just won't start from original dvd
My MacBook 13", mid 2011, started to slow down, freeze. Tried to start up in safe mode, after that it just won't boot at all. Tried with the original DVD holding down "C" but no disk boot. What to do? Rgds
-
Raise purchase order in me21n for 100 goods
HI, i have problem. i raise purchase order in me21n for 100 goods.for that purchase order in MIGO i received 75 goods.when the invoice verification i found only 50 goods.how to clear in gr/ir in the month end process. please someone help me. regards
-
Upgrading Thumbnails- Which "IMG_0001.jpg" is missing??
iPhoto is "Upgrading Thumbnails" and finding dozens of missing photos. But the names of the photos are not distinctive, they're camera names, and I have a huge library which at times has as many as 6 or 7 of the exact same name. So I have no way of
-
Adobe usability study - get an Amazon gift card
Adobe is currently doing a number of usability tests for various products.We're looking for participants for a brief (~1 hour) online work observation and interview. Compensation will be a $100 Amazon gift card. The study I'm working on involves user