How to bind ProgressBar ?
Hello ,
I want to use ProgressBar to indicate progress how much data are downloaded ;
How to bind ProgressBar with property and then to setProgress() method with this property.
You had two problems in your code. First, the input stream "bis" had already been closed by the time the Task ran, thanks to the try-with-resources block closing everything for you. Second, the updateProgress was always producing values that would result in -1 (or a negative number) being produced for the progress.
Instead, you should open the streams (try-with-resources) within the task, fully in the background thread. And, you should pass the raw values into updateProgress instead of trying to compute a value between 0 and 100, and just let the updateProgress method do it for you.
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import javafx.application.Application;
import javafx.concurrent.Task;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
* @author idle
public class YourDownloader extends Application {
private final HBox hBox = new HBox();
private final VBox vBox = new VBox();
ProgressBar progress = new ProgressBar(0.01);
public static void main(String[] args) {
Application.launch(args);
@Override public void start(Stage primaryStage) {
primaryStage.setTitle("Your Dounloader");
Group root = new Group();
Scene scene = new Scene(root, 500, 250);
final TextField urlTextField = new TextField();
urlTextField.setPromptText("Add URL here");
urlTextField.setPrefWidth(scene.getWidth() - scene.getWidth() / 3);
Button btn = new Button();
btn.setText("Start Download");
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent event) {
try {
startDownload(urlTextField.getText());
} catch (IOException ex) {
System.err.println("There is a IOException !!! : " + ex);
hBox.getChildren().addAll(urlTextField, btn);
hBox.setPadding(new Insets(10, 5, 5, 10));
hBox.setSpacing(20);
vBox.getChildren().addAll(hBox, progress);
root.getChildren().add(vBox);
primaryStage.setScene(scene);
primaryStage.show();
public void startDownload(final String stringUrl) throws IOException {
final Task<Void> task = new Task<Void>() {
@Override public Void call() throws Exception {
URL url = new URL(stringUrl);
String fileName = url.getFile();
fileName = fileName.substring(fileName.lastIndexOf('/') + 1);
try (BufferedInputStream bis = new BufferedInputStream(url.openStream());
FileOutputStream fos = new FileOutputStream(fileName);
BufferedOutputStream bos = new BufferedOutputStream(fos, 1024))
// buffer of the downloaded data
byte[] data = new byte[1024];
int read = 0, totalRead = 0;
long contentLength = url.openConnection().getContentLength();
while ((read = bis.read(data, 0, 1024)) > 0) {
totalRead += read;
bos.write(data, 0, read);
updateProgress(totalRead, contentLength);
return null;
progress.progressProperty().bind(task.progressProperty());
new Thread(task).start();
}
Similar Messages
-
I am developing a desktop application in Wpf using MVVM and Entity Frameworks. I have the following tables:
1. Party (PartyId, Name)
2. Case (CaseId, CaseNo)
3. Petitioner (CaseId, PartyId) ............. Link Table
I am completely new to .Net and to begin with I download Microsoft's sample application and
following the pattern I have been successful in creating several tabs. The problem started only when I wanted to implement many-to-many relationship. The sample application has not covered the scenario where there can be a any-to-many relationship. However
with the help of MSDN forum I came to know about a link table and managed to solve entity framework issues pertaining to many-to-many relationship. Here is the screenshot of my application to show you what I have achieved so far.
And now the problem I want the forum to address is how to bind a combo box so that it retrieves Party.Name for the corresponding PartyId in the Link Table and also I want to populate it with Party.Name so that
users can choose one from the dropdown list to add or edit the petitioner.Hello Barry,
Thanks a lot for responding to my query. As I am completely new to .Net and following the pattern of Microsoft's Employee Tracker sample it seems difficult to clearly understand the concept and implement it in a scenario which is different than what is in
the sample available at the link you supplied.
To get the idea of the thing here is my code behind of a view vBoxPetitioner:
<UserControl x:Class="CCIS.View.Case.vBoxPetitioner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:v="clr-namespace:CCIS.View.Case"
xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
mc:Ignorable="d"
d:DesignWidth="300"
d:DesignHeight="200">
<UserControl.Resources>
<DataTemplate DataType="{x:Type vm:vmPetitioner}">
<v:vPetitioner Margin="0,2,0,0" />
</DataTemplate>
</UserControl.Resources>
<Grid>
<HeaderedContentControl>
<HeaderedContentControl.Header>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<TextBlock Margin="2">
<Hyperlink Command="{Binding Path=AddPetitionerCommand}">Add Petitioner</Hyperlink>
| <Hyperlink Command="{Binding Path=DeletePetitionerCommand}">Delete</Hyperlink>
</TextBlock>
</StackPanel>
</HeaderedContentControl.Header>
<ListBox BorderThickness="0" SelectedItem="{Binding Path=CurrentPetitioner, Mode=TwoWay}" ItemsSource="{Binding Path=tblParties}" />
</HeaderedContentControl>
</Grid>
</UserControl>
This part is working fine as it loads another view that is vPetioner perfectly in the manner I want it to be.
Here is the code of vmPetitioner, a ViewModel:
Imports Microsoft.VisualBasic
Imports System.Collections.ObjectModel
Imports System
Imports CCIS.Model.Party
Namespace CCIS.ViewModel.Case
''' <summary>
''' ViewModel of an individual Email
''' </summary>
Public Class vmPetitioner
Inherits vmParty
''' <summary>
''' The Email object backing this ViewModel
''' </summary>
Private petitioner As tblParty
''' <summary>
''' Initializes a new instance of the EmailViewModel class.
''' </summary>
''' <param name="detail">The underlying Email this ViewModel is to be based on</param>
Public Sub New(ByVal detail As tblParty)
If detail Is Nothing Then
Throw New ArgumentNullException("detail")
End If
Me.petitioner = detail
End Sub
''' <summary>
''' Gets the underlying Email this ViewModel is based on
''' </summary>
Public Overrides ReadOnly Property Model() As tblParty
Get
Return Me.petitioner
End Get
End Property
''' <summary>
''' Gets or sets the actual email address
''' </summary>
Public Property fldPartyId() As String
Get
Return Me.petitioner.fldPartyId
End Get
Set(ByVal value As String)
Me.petitioner.fldPartyId = value
Me.OnPropertyChanged("fldPartyId")
End Set
End Property
End Class
End Namespace
And below is the ViewMode vmParty which vmPetitioner Inherits:
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports CCIS.Model.Case
Imports CCIS.Model.Party
Imports CCIS.ViewModel.Helpers
Namespace CCIS.ViewModel.Case
''' <summary>
''' Common functionality for ViewModels of an individual ContactDetail
''' </summary>
Public MustInherit Class vmParty
Inherits ViewModelBase
''' <summary>
''' Gets the underlying ContactDetail this ViewModel is based on
''' </summary>
Public MustOverride ReadOnly Property Model() As tblParty
'''' <summary>
'''' Gets the underlying ContactDetail this ViewModel is based on
'''' </summary>
'Public MustOverride ReadOnly Property Model() As tblAdvocate
''' <summary>
''' Gets or sets the name of this department
''' </summary>
Public Property fldName() As String
Get
Return Me.Model.fldName
End Get
Set(ByVal value As String)
Me.Model.fldName = value
Me.OnPropertyChanged("fldName")
End Set
End Property
''' <summary>
''' Constructs a view model to represent the supplied ContactDetail
''' </summary>
''' <param name="detail">The detail to build a ViewModel for</param>
''' <returns>The constructed ViewModel, null if one can't be built</returns>
Public Shared Function BuildViewModel(ByVal detail As tblParty) As vmParty
If detail Is Nothing Then
Throw New ArgumentNullException("detail")
End If
Dim e As tblParty = TryCast(detail, tblParty)
If e IsNot Nothing Then
Return New vmPetitioner(e)
End If
Return Nothing
End Function
End Class
End Namespace
And final the code behind of the view vPetitioner:
<UserControl x:Class="CCIS.View.Case.vPetitioner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
mc:Ignorable="d"
Width="300">
<UserControl.Resources>
<ResourceDictionary Source=".\CompactFormStyles.xaml" />
</UserControl.Resources>
<Grid>
<Border Style="{StaticResource DetailBorder}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="Petitioner:" />
<ComboBox Grid.Column="1" Width="240" SelectedValuePath="." SelectedItem="{Binding Path=tblParty}" ItemsSource="{Binding Path=PetitionerLookup}" DisplayMemberPath="fldName" />
</Grid>
</Border>
</Grid>
</UserControl>
The problem, presumably, seems to be is that the binding path "PetitionerLookup" of the ItemSource of the Combo box in the view vPetitioner exists in a different ViewModel vmCase which serves as an ObservableCollection for MainViewModel. Therefore,
what I need to Know is how to route the binding path if it exists in a different ViewModel?
Sir, I look forward to your early reply bringing a workable solution to the problem I face.
Warm Regards,
Arun -
Hello,
on my page I have 2 items:checkbox and text area. How to bind its work processes together? For example, when checkbox is checked then Text area is disable and when not then enable.
Thanks' for help.
Karina.hi karina--
this, too, is javascript question. please see my answer to your previous post...
Multiselect list (LOV)
...regards,
raj -
How to bind a UI element to the context
Hi Experts,
I have a problem binding UI element to the context. In my code i have to create TabStrips dynamically and under this tabstrip number of UI elements would be there. For this i have a code like this..
IWDTransparentContainer theActionContainer =(IWDTransparentContainer)view.getElement("RootUIElementContainer");
IWDTabStrip ts = (IWDTabStrip) view.createElement(IWDTabStrip.class,"TabStrip");
IWDTab tab1 = (IWDTab) view.createElement(IWDTab.class,"Tab1");
IWDInputField in = (IWDInputField) view.createElement(IWDInputField.class,"in");
IWDCaption header1 = (IWDCaption) view.createElement(IWDCaption.class,"Header1");
header1.setText("Tab1");
tab1.setContent(in);
ts.addTab(tab1);
IWDTab tab2 = (IWDTab) view.createElement(IWDTab.class,"Tab2");
IWDInputField in2 = (IWDInputField) view.createElement(IWDInputField.class,"in2");
IWDCaption header2 = (IWDCaption) view.createElement(IWDCaption.class,"Header2");
header2.setText("Tab2");
tab2.setHeader(header2);
ts.addTab(tab2);
theActionContainer.addChild(ts);
<b>when i run this code it is giving following exceptions..</b>
The initial exception that caused the request to fail, was:
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Property 'value' of AbstractInputField with id 'in' in view 'LoginView' must be bound to the context
at com.sap.tc.webdynpro.clientserver.uielib.standard.impl.AbstractInputField.getValue(AbstractInputField.java:1260)
at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.InputFieldAdapter.getValue(InputFieldAdapter.java:582)
at com.sap.tc.ur.renderer.ie6.InputFieldRenderer.render(InputFieldRenderer.java:56)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:435)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:134)
... 63 more
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Property 'value' of AbstractInputField with id 'in' in view 'LoginView' must be bound to the context
at com.sap.tc.webdynpro.clientserver.uielib.standard.impl.AbstractInputField.getValue(AbstractInputField.java:1260)
at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.InputFieldAdapter.getValue(InputFieldAdapter.java:582)
at com.sap.tc.ur.renderer.ie6.InputFieldRenderer.render(InputFieldRenderer.java:56)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:435)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:134)
at com.sap.tc.ur.renderer.ie6.TabStripRenderer.renderTabStripItemContentFragment(TabStripRenderer.java:1867)
at com.sap.tc.ur.renderer.ie6.TabStripRenderer.renderTabStripFragment(TabStripRenderer.java:838)
From these exceptions what i understood is, i need to bind these UI elements to context.
Can any body tell me how to bind a UI element to the context if I understood the exceptions correct..
Thanks in Advance,
Murthy.HI,
lets say Ctx is your context attribute,
IWDAttributeInfo attrInfo = wdContext.getNodeInfo.getAttribute("Ctx");
then , as per your code,
IWDInputField in = (IWDInputField) view.createElement(IWDInputField.class,"in");
<b>in.bindValue(attrInfo);</b>
if your contex attribute is child of some other node then do like this,
IWDAttributeInfo attrInfo = wdContext.getNodeInfo.getChildNode("SalesOrder",0)getAttribute("Ctx");
//this is when Ctx is child of node SalesOrder, and we are taking Ctx from its 0th element
then ,
IWDInputField in = (IWDInputField) view.createElement(IWDInputField.class,"in");
<b>in.bindValue(attrInfo);</b>
include this in your code ,
let me know if you face any problem
regards
reward points if it helps -
How to bind an aggregated list to a variable in an IN or ANY clause
Hello, and thank you for helping -
I have a process that involves a parameter assertion, the result of which is a string for an IN or ANY clause. I am not able to figure out how to bind the result of the assertion to to executable SQL. The actual business process is long and laborious and, I decided, not worth explaining for the purpose of this forum. I have abstracted the process into some dummy data. The goal is to bind v_any_condition to :a. I could certainly build the SQL without the binding, but I would be very interested to know just the same what I am missing here (I'm sure something simple, or just a basic SQL rules that I have missed).
Thanks!
DECLARE
-- The goal is to bind v_any_condition in an ANY clause
v_any_condition VARCHAR2(30) DEFAULT '4,9,d'; -- the three rows to return from the sample data
-- v_any_condition VARCHAR2(30) DEFAULT DBMS_ASSERT.ENQUOTE_LITERAL('4')||','||
-- DBMS_ASSERT.ENQUOTE_LITERAL('9')||','||
-- DBMS_ASSERT.ENQUOTE_LITERAL('d');
v_sql varchar2(2048);
-- We'll create a simple cursor of VARCHAR2(1) just like DUAL.DUMMY
rc sys_refcursor;
rc_record dual%ROWTYPE;
v_counter NUMBER DEFAULT 0;
BEGIN -- Build the SQL. In this example, we decompose an aggregated string
-- containing the first 16 hex numbers. The result is a simple 16-row table
-- from which we will attempt to return the three rows by binding
-- v_any_condition to ANY in the SQL below.
v_sql := '
SELECT token
FROM ( -- materialize the list
WITH t AS (SELECT ''0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f'' AS txt FROM DUAL)
-- then decompose the list into rows
SELECT REGEXP_SUBSTR (txt, ''[^,]+'', 1, LEVEL) AS token
FROM t
CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(txt,''[^,]*''))+1
/* WHERE token = ANY(''4'',''9'',''d'') */ -- hardcoding works
WHERE token = ANY(:a) -- binding does not work; the goal is to get this to work '
OPEN rc FOR v_sql USING v_any_condition; -- when binding, we never even enter the loop
LOOP
v_counter := v_counter + 1;
FETCH rc INTO rc_record;
EXIT WHEN rc%NOTFOUND;
DBMS_OUTPUT.PUT_LINE (v_counter || ': '||rc_record.dummy);
END LOOP;
END;
Edited by: ltps on Jan 9, 2012 4:28 PMSuperb. Thank you very much.
For anyone who is interested in the solution I chose, here is the revised SQL that accepts a list as a bind variable after casting the list as a table. The "split string" code is below that. (What look like double quotes in the block below are actually consecutive single quotes.)
DECLARE
v_any_condition VARCHAR2(30) DEFAULT '4,9,d';
v_sql varchar2(2048);
rc sys_refcursor;
rc_record dual%ROWTYPE;
v_counter NUMBER DEFAULT 0;
BEGIN
v_sql := '
SELECT token
FROM (
WITH t AS (SELECT ''0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f'' AS txt FROM DUAL)
-- then decompose the list into rows
SELECT REGEXP_SUBSTR (txt, ''[^,]+'', 1, LEVEL) AS token
FROM t
CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(txt,''[^,]*''))+1
, TABLE(CAST(XX_SPLIT_STRING(:a,'','') AS XX_SPLIT_TABLE)) cst
WHERE cst.column_value = token'
OPEN rc FOR v_sql USING v_any_condition;
LOOP
v_counter := v_counter + 1;
FETCH rc INTO rc_record;
EXIT WHEN rc%NOTFOUND;
DBMS_OUTPUT.PUT_LINE (v_counter || ': '||rc_record.dummy);
END LOOP;
END;
-- And the main SQL, just for clarity:
SELECT token
FROM (
WITH t AS (SELECT '0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f' AS txt FROM DUAL)
SELECT REGEXP_SUBSTR (txt, '[^,]+', 1, LEVEL) AS token
FROM t
CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(txt,'[^,]*'))+1
, TABLE(CAST(XX_SPLIT_STRING('4,9,d',',') AS XX_SPLIT_TABLE)) cst
WHERE cst.column_value = token;
CREATE OR REPLACE FUNCTION XX_SPLIT_STRING (
p_string VARCHAR2
, p_delimiter VARCHAR2 DEFAULT ','
RETURN XX_SPLIT_TABLE PIPELINED
IS
l_idx PLS_INTEGER;
l_string VARCHAR2(32767) := p_string;
l_value VARCHAR2(32767);
BEGIN
LOOP
l_idx := INSTR ( l_string, p_delimiter );
IF l_idx > 0 THEN
pipe ROW ( SUBSTR ( l_string, 1, l_idx - 1 ) );
l_string := SUBSTR ( l_string, l_idx + LENGTH (p_delimiter) );
ELSE
PIPE ROW ( l_string);
EXIT;
END IF;
END LOOP;
RETURN;
END XX_SPLIT_STRING; -
How to bind JtextFields in Swing to Table fields in the database
Can some one give the code of how to bind JtextFields in Swing to Table fields in the database
Am really new to java programming and have interest in learningThe standard JDK doesn't do this for you. If you search on Google, you may find some 3rd party packages that will do this.
You need to create your own form add execute the appropriate SQL yourself. Read the tutorial on [url http://java.sun.com/docs/books/tutorial/]JDBC Database Access to get started. -
How to bind "Image Field" object on a database
Hi to all
I inserted into a dynamic PDF (Livecycle ES3 trial) an image field, but I don't understand how I can to bind a JPG into a database.
In (F5) preview... I'm able to open a image file on filesystem and visualize it on PDF form... but then? How to bind on database?
In my several tentatives I'm using a MS Access 2010 database table, where I defined a OLE object... but doesn't work.
Thank you at all.
visertHi,
I have not tried to do this, but this document provides some instructions.
http://partners.adobe.com/public/developer/en/livecycle/lc_designer_XML_schemas.pdfhttp://partners.adobe.com/public/developer/en/livecycle/lc_designer_XML_schemas.pdf
Hope it helps
Bruce -
How to bind a JTable in runtime.
Hello Guys,
Anyone know tell me how to bind a JTable adf Swing at Runtime?
In other words, I want to create the bindings when the application to be running.
Thanks in advanced.Try the static createAttributeListBinding() methods in JUTableBinding.
Sascha -
How to bind korean parameters in XSQL????
Hi,
I am binding english parameters in XSQL very well.
But when I am trying to bind japaneese or korean it is not displaying rows.
I am giving the sample code.
hello.xsql
<?xml version="1.0" encoding="euc-kr"?>
<xsql:query connection="scs" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:xsql="urn:oracle-xsql" row-element="ADDRESSES_ROW">
select * from emp where name='{@name}'
</xsql:query>
Request: http://hello.xsql?name=JOHN ::: working fine
Request: http://hello.xsql?name=koreanName :::Not working
Please help me in this regard.
How to bind name in korean in XSQL servlet..
Regards,
sudhiDo you have nlscharset_12.jar in your classpath?
what web server are you using XSQL with?
Have you tried using real bind variables like this:
<xsql:query bind-params="name">
select * from emp where ename = ?
</xsql:query>
Does a query like:
<xsql:query bind-params="name">
select * from emp
</xsql:query>
return the korean data to the browser correctly? -
How to bind Dimension data to SDK Component
Hi Guys,
I am trying to create a Cascading box component with the help of SDK development using eclipse.
I don't know how can I get the dimension data to my component.
when I am using data binding property type as "resultCellList" then I am able to bind the Measures' data to the component.
Can anybody suggest me how to bind dimension data to my SDK component?In the menu under Help Contents, there is an SDK section with examples that spell this out for you.
There is also an easier to read and print PDF on the SAP Help site here:
http://help.sap.com/businessobject/product_guides/AAD14/en/ds14SP02_dev_guide_en.pdf
Also premade samples here:
http://help.sap.com/businessobject/product_guides/AAD14/en/DS_14SP02_SDK_SAMPLES.zip
Main DS Help Site:
SAP BusinessObjects Design Studio 1.4 SP02 – SAP Help Portal Page
SDK Community Site with other examples and Open Source links:
SCN Design Studio SDK Development Community -
How to bind complex input/output types in web service data control
Hi,
I have created data control using external web service for simple input & output data type and its working fine.
But I don't know how it can be done for complex data types.
My external Web services have complex input & output types. Such as java object which contains another java object again it contains another java object or arry or java collection etc.
Each my service has one complex input data type and for this no user input is require so how I can do it without using any component for it.
I want to bind my page components with this input & output type.
What is the best approach to do this and how to bind screen component.
Regards,
DevangHi,
Thanks frank.
I already check this link before posting this so if you have any other link then kindly reply.
Regards,
Devang -
How to bind list data to XML Web service request
How do I bind specific columns in a DataGrid to the Web
service request? I'm having trouble finding any documentation that
addresses that specific pattern, i.e. sending a complex list to the
server via a Flex Web service send() command. I'm fairly new to
Flex programming and don't know if what I want to do is possible.
Here what I've been able to do so far.
1. Using a Web service called a service on the server and
retrieved a complex list.
2. Poplulated a DataGrid with the result
3. The user has selected multiple rows from the DataGrid
using a checkbox column
4. The user pressed a button that calls a Web service send().
This Web service should only send data from only two columns and
only for those rows the user has checked.
5. I can loop over the DataGrid and find the selected rows
and put them in another ArrayCollection called 'selectedRows'.
The issue is that I don't know how to bind 'selectedRows' to
the Web service. Right now I'm reading up on "Working with XML" in
the Programming with ActionScript 3.0 chapter. But I'm just fishing
here. No bites yet.Don't bind. Build the request object programatically, as you
are doing with your selectedRows AC, and send(myObject) that.
Tracy -
How to bind the database?
How to bind the database and to place the data of a field in a EditBox and to modify the data of a table.
Hi,
Here got one example.
Private oUserDataSource As SAPbouiCOM.UserDataSource
oNewItem = oForm.Items.Add("ET_GUID", SAPbouiCOM.BoFormItemTypes.it_EXTEDIT)
oEditText = oNewItem.Specific
oUserDataSource = oForm.DataSources.UserDataSources.Add("U_GUID", SAPbouiCOM.BoDataType.dt_LONG_TEXT, 60)
oEditText.DataBind.SetBound(True, "TableName", "FieldName")
Hope this helps,
Bruce. -
How to bind value to lov based on the output from other lov
HI all, i have 2 message choice Lov, i am selected a value from the 1st lov based on this value i am a executing a query, i want to display one of the attribute value from the query result in the second LOV. i am getting the attribute value correctly but i dont know how to bind that(display) in the 2nd LOV(at runtime).
Read the dev guide LOV section, it should give you details about this implementation.
-
How to bind dynamic data to JNet
Develop tools: NWDS 7.1
Server: Windows2000
Does anyone have experiences with using JNET within Webdynpro Project ?
In our case, we use JNet to generate a hierachical network diagram in the Webdypro's GUI. The data source is from the tables in a DB. However, till now, we only know how to let JNet generate the network diagram from a static XML file.
Since the data in the DB changes all the time, how to let the network diagram reflect the newest data status automatically? That is, how to bind JNet to a dynamic data source then?Hi,
Network UI element is related with Jnet. What you need to start up working with this is you need to create a context structure mentioned below.
Node:Source
Element--- xml -> this should be of type binary.
Place the following code in the init.
ISimpleTypeModifiable mod = wdContext.nodeSource().getNodeInfo().getAttribute("xml").getModifiableSimpleType();
IWDModifiableBinaryType bin = (IWDModifiableBinaryType)mod;
bin.setMimeType(new WDWebResourceType("xml", "application/octet-stream", false));
ISourceElement element =wdContext.nodeSource().createSourceElement();
wdContext.nodeSource().addElement(element);
try
fileName = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "jnettest.xml");
element.setXml(readFile(fileName));
catch (WDAliasResolvingException e)
You have to place the Jnet test.xml under the mimes folder of your application.
Place the network element in the view and in the data source specify the context attribute source.xml
if your xml file complies with the jnet schema your application will render it.
Pl go through this
Using the "Network" UI Element
Regards
Ayyapparaj
Maybe you are looking for
-
Windows 7 32 bit failed to start .A recent Hardware or software change might be the cause.To fix the Problem. 1.Insert your Windows Installation disc and restart your computer. 2.Choose your langauge settings and then click "Next". 3.click "Repair y
-
What are the best specs when building a PC for video & where to buy in US?
Our current video machine has died - a problem we have constantly battled over the years with our video machines, primarily from the heat generated in the system. These have been spacious, well spec'd out desktops, so while I'm budget concious I thou
-
New hard drive won't install in my macbook pro 13"
Hi everyone I have recently been having problems with my mac book where I was constantly seeing the spinning beachball. I had wiped the hard drive and was still having this problem so took my mac book to a "genius" at my local mac store who told me
-
Error with function module TABLE_COMPRESS?
Hi all, What is the alternate function module for TABLE_COMPRESS? This is going fine in 4.7 version. But in ECC 6.0, if we use this function module we r getting SLIN error (Obsolate statements) . How can we rectify this SLIN error? So we have to use
-
How can I sort pictures by date and than by time stamp ?
The approx. 2.000 pictures was taken by two cameras. Both cameras intern date and time where adjusted before the for session. It seems that Aperture 3.3.1 can´t manage it, can it? In the browser there is only one common field for date and time. I sho