Parsing dataset and spry variable
Hi there,
Some curiosity of mine, can we parse spry dataset and
variable to another function? something like parsing a dataset so
we can save a lot code, example:
quote:
function reload(dataSource){ //dataSource was spry data set
object
dataSource.loadData();
dataSource.setCurrentRow(0);
and parsing spry variable, example i want to use Google
Visualization API
quote:
function drawGraph(dataSource){
//preprocessing and loop code here... i dunno how to create
it with spry
data.setValue(x, y, '{dataSource::value1}');
//end loop
so we just parse dataset and loop until last variable value
to draw graph
thanks,
Dels
Thanks,
That was i need, btw how about question no 1? say i want to
do something with my multiple dataset, in this case change url and
reloading data
quote:
reload(ds1, 'new1.xml'); //spry dataset
reload(ds2, 'new2.xml'); //spry dataset
function reload(dataSource,url){ //dataSource was spry data
set object
dataSource.setUrl(url);
dataSource.loadData();
dataSource.setCurrentRow(0);
i have tried that and it couldn't work... (maybe because i
tried to pass object into function)
Similar Messages
-
Using Multiple Datasets and Spry in DW CS3
Hi there, I am currently trying to get an XML file pushed
into a HTML page by using Spry in Dreamweaver CS3.
However it uses three datasets. The schema is like this:
funds-and-headings
----> properties+
------------> region
------------> reference
------------> known-as
------------> funds+
---------------------> type
---------------------> heads+
-----------------------------> description
(where there is a + this means a heading)
but I am struggling to pull in the data.
If I highlight 'properties' I can pull in the first 3 records
but funds gives an 'unspecified' error message.
I just want to know how I can then pull in the other fields
all into one line and return all the results from the XML.
Any hlep most welcome and sorry if I missed anything out that
would help.Thought I'd drop a url so that my issue is more clear. :)
This is in Alpha, but a url would be:
http://center4spine.com.s11267.gridserver.com/how_we_help/spinal_decompression/
. You'll see the categories on the left; clicking a title changes
the content on the right. The first category's content is displayed
initially. I need to be able to link directly to the FAQ. How do I
get that page to show up with the FAQ loading first via a
hyperlink? I hope that's more clear! -
Parse XML and Output to JSP page
I have a number of XML documents which are all formatted in the same way, just with different information in the fields.
I wish to parse the XML documents using DOM and output them to an XML page.
How would i go about doing this?
If you could write a small example or any websites that you think might help.
Thanks.I have the parsing working but i cant seem to figure out how to get information out of the parsed document and into variables.
This is a sample of my XML file
<?xml version="1.0"?>
<product code="QB-1226-AB">
<productName>Professional Floodlights</productName>
<description>PIR floodlights that are designed for professional installation. A faulty light requiring a return visit will cost far more than a quality light does in the first place. 3 year guarantee.</description>
<price>120</price>
<manufacturer>Black and Decker</manufacturer>
</product>I can get the productCode value out without any problems using
String name = attrs.getValue("code");
But if i try the same for any of the others i get null. I can accomplish this using DOM easily but i cant find anything at all about getting values out of it using SAX.
Any help would be greatly appreciated. -
Problem w/ Nested Datasets and Master/Detail regions
Hi, I'm being using spry for a couple of applications and
really love it. This is the first time I've tried to utilize a
nested dataset and I'm having some difficulty loading the nested
data. I'm getting a js 'Object does not support this property or
method' error in IE and a 'Failed to retrieve data set (dsCreds)
for spry:repeat' in FF.
I've tried to map examples to my application but of course
it's slightly different. I have a master/detail region dynamically
generated from a .php file and part of the detail region has the
nested dataset. Maybe (hopefully) it's something obvious. I've
broken out a test case that demonstrates what's happing - If anyone
could take a look I would be extremely grateful!
The .htm file is on:
htm
file
The .PHP file that generates the dynamic XML is on:
PHP
file
A sample .XML (generated from the .PHP file is
Sample XML
file
Even without the Nested set getting generated the
Master/Detail section works fine.
Thanks so much for any help!
Edit - Apologies for all the inline css - still developing
:)Hi,
The dataset name in the NestedDataSet constructor does not go
in quotes.
Try var dsCreds = new Spry.Data.NestedXMLDataSet(dsAgents,
"credentials/cred");
and see if that helps.
Don -
PreparedStatement and bind variable
We are experiencing some werid performance break downs where database server looks healthy and our java applications are down to their knees.
I was wondering if someone could help me clarify the comparison between PreparedStatement and bind variable. When I execute a PreparedStatement in java through the JDBC thin driver, would the database consider it a dynamic SQL or is it a SQL using bind variable? If this same statement is executed 100000 times, is it parsed 100000 times? We are using JDK131. How does it work?
Is there any memory leak in PreparedStatement implementation in JDBC thin driver? Is there any known symptom to this problem? What is the recommended solution?
Thank you very much!If PreparedStatement is parsed and cached, why is there setting to set implicit statement caching and explicit statement caching? Our DBA insists that it is parsed every single time. How would I find out for sure?
The SQLs have not been changed. This sudden performance degradation started when a new client went live and we experienced higher than usual volumn. We are connecting using JDBC thin client from weblogic server to Oracle 8.1.7. It's been happening everyday since the client went live and the only way to get the performance back is to shutdown and restart the database server.
I tried to search JDBC related issues. The only complain that I've found so far is that there may be some potential memory leak for a PreparedStatement. However, I have not found anything from Oracle's website that concurs to that.
What is my best bet? -
How could i parse string and link its model with my files in eclipse project?
How could i parse string and link its model with my files in eclipse project?, as i read that we dont have to use standalone mode while working with eclipse projects.
Example of what i want to do:
I have file1.dsl in my project which contains some statements but the declaration of these statements are not in another file, i need to put them only in my codeHi Stefan,
I have eclipse project contains 2 files, file1.dsl and file2.dsl, you can see the contents of the files below.
file1.dsl contains some statements as shown below and file2.dsl contains the declarations of the variables. (like in C++ or Java we have declarations and usage)
At this step file1.dsl and file2.dsl will be parsed successfully without any errors.
Lets imagine that we will delete this project and will create another one and the new project will contain only file1.dsl (which contains the usage)
At this step this file (file1.dsl) will contains some errors after parsing it, because we are using variables without declarations.
So what i need is to parse the content of file2.dsl directly without adding this file to the project.
I need to add the content of file2.dsl directly as a string in the code and parse it. just like that ( "int a;int b;" )
And link file1.dsl with the model generated after parsing my string
file1.dsl
a++;
b++;
file2.dsl
int a;
int b;
Thanks -
Trying to pass and object variable to a method
I have yet another question. I'm trying to display my output in succession using a next button. The button works and I get what I want using test results, however what I really want to do is pass it a variable instead of using a set number.
I want to be able to pass the object variables myProduct, myOfficeSupplies, and maxNumber to method actionPerformed so they can be in-turn passed to the displayResults method which is called in the actionPerformed method. Since there is no direct call to actionPerformed because it is called within one of the built in methods, I can't tell it to receive and pass those variables. Is there a way to do it without having to pass them through the built-in methods?
import javax.swing.JToolBar;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;
import javax.swing.JPanel;
import java.net.URL;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Panel extends JPanel implements ActionListener
protected JTextArea myTextArea;
protected String newline = "\n";
static final private String FIRST = "first";
static final private String PREVIOUS = "previous";
static final private String NEXT = "next";
public Panel( Product myProduct, OfficeSupplies myOfficeSupplies, int maxNumber )
super(new BorderLayout());
int counter = 0;
//Create the toolbar.
JToolBar myToolBar = new JToolBar( "Still draggable" );
addButtons( myToolBar );
//Create the text area used for output.
myTextArea = new JTextArea( 450, 190 );
myTextArea.setEditable( false );
JScrollPane scrollPane = new JScrollPane( myTextArea );
//Lay out the main panel.
setPreferredSize(new Dimension( 450, 190 ));
add( myToolBar, BorderLayout.PAGE_START );
add( scrollPane, BorderLayout.CENTER );
myTextArea.setText( packageData( myProduct, myOfficeSupplies, counter ) );
setCounter( counter );
} // End Constructor
protected void addButtons( JToolBar myToolBar )
JButton myButton = null;
//first button
myButton = makeNavigationButton( FIRST, "Display first record", "First" );
myToolBar.add(myButton);
//second button
myButton = makeNavigationButton( PREVIOUS, "Display previous record", "Previous" );
myToolBar.add(myButton);
//third button
myButton = makeNavigationButton( NEXT, "Display next record", "Next" );
myToolBar.add(myButton);
} //End method addButtons
protected JButton makeNavigationButton( String actionCommand, String toolTipText, String altText )
//Create and initialize the button.
JButton myButton = new JButton();
myButton.setActionCommand( actionCommand );
myButton.setToolTipText( toolTipText );
myButton.addActionListener( this );
myButton.setText( altText );
return myButton;
} // End makeNavigationButton method
public void actionPerformed( ActionEvent e )
String cmd = e.getActionCommand();
// Handle each button.
if (FIRST.equals(cmd))
{ // first button clicked
int counter = 0;
setCounter( counter );
else if (PREVIOUS.equals(cmd))
{ // second button clicked
counter = getCounter();
if ( counter == 0 )
counter = 5; // 5 would be replaced with variable maxNumber
setCounter( counter );
else
counter = getCounter() - 1;
setCounter( counter );
else if (NEXT.equals(cmd))
{ // third button clicked
counter = getCounter();
if ( counter == 5 ) // 5 would be replaced with variable maxNumber
counter = 0;
setCounter( counter );
else
counter = getCounter() + 1;
setCounter( counter );
displayResult( counter );
} // End method actionPerformed
private int counter;
public void setCounter( int number ) // Declare setCounter method
counter = number; // stores the counter
} // End setCounter method
public int getCounter() // Declares getCounter method
return counter;
} // End method getCounter
protected void displayResult( int counter )
//Test statement
// myTextArea.setText( String.format( "%d", counter ) );
// How can I carry the myProduct and myOfficeSupplies variables into this method?
myTextArea.setText( packageData( product, officeSupplies, counter ) );
myTextArea.setCaretPosition(myTextArea.getDocument().getLength());
} // End method displayResult
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event dispatch thread.
public void createAndShowGUI( Product myProduct, OfficeSupplies myOfficeSupplies, int maxNumber )
//Create and set up the window.
JFrame frame = new JFrame("Products");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Add content to the window.
frame.add(new Panel( myProduct, myOfficeSupplies, maxNumber ));
//Display the window.
frame.pack();
frame.setVisible( true );
} // End method createAndShowGUI
public void displayData( Product myProduct, OfficeSupplies myOfficeSupplies, int maxNumber )
JTextArea myTextArea = new JTextArea(); // textarea to display output
JFrame JFrame = new JFrame( "Products" );
// For loop to display data array in a single Window
for ( int counter = 0; counter < maxNumber; counter++ ) // Loop for displaying each product
myTextArea.append( packageData( myProduct, myOfficeSupplies, counter ) + "\n\n" );
JFrame.add( myTextArea ); // add textarea to JFrame
} // End For Loop
JScrollPane scrollPane = new JScrollPane( myTextArea ); //Creates the JScrollPane
JFrame.setPreferredSize(new Dimension(350, 170)); // Sets the pane size
JFrame.add(scrollPane, BorderLayout.CENTER); // adds scrollpane to JFrame
JFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); // Sets program to exit on close
JFrame.setSize( 350, 170 ); // set frame size
JFrame.setVisible( true ); // display frame
} // End method displayData
public String packageData( Product myProduct, OfficeSupplies myOfficeSupplies, int counter ) // Method for formatting output
return String.format( "%s: %d\n%s: %s\n%s: %s\n%s: %s\n%s: $%.2f\n%s: $%.2f\n%s: $%.2f\n%s: $%.2f",
"Product Number", myOfficeSupplies.getProductNumber( counter ),
"Product Name", myOfficeSupplies.getProductName( counter ),
"Product Brand",myProduct.getProductBrand( counter ),
"Number of Units in stock", myOfficeSupplies.getNumberUnits( counter ),
"Price per Unit", myOfficeSupplies.getUnitPrice( counter ),
"Total Value of Item in Stock is", myOfficeSupplies.getProductValue( counter ),
"Restock charge for this product is", myProduct.restockingFee( myOfficeSupplies.getProductValue( counter ) ),
"Total Value of Inventory plus restocking fee", myOfficeSupplies.getProductValue( counter )+
myProduct.restockingFee( myOfficeSupplies.getProductValue( counter ) ) );
} // end method packageData
} //End Class Panelmultarnc wrote:
My instructor has not been very forthcoming with assistance to her students leaving us to figure it out on our own.Aren't they all the same! Makes one wonder why they are called instructors. <sarcasm/>
Of course it's highly likely that enough information was imparted for any sincere, reasonably intelligent student to actually figure it out, and learn the subject in the process.
And if everything were spoonfed, how would one grade the performance of the students? Have them recite from memory
public class HelloWorld left-brace
indent public static void main left-parenthesis String left-bracket right-bracket args right-parenthesis left-brace
And everywhere that Mary went
The lamb was sure to go
db -
Open/Transfer/close Dataset and delimiting
Hi people hi have a situation regarding open/transfer/close dataset and delimits.
I have a submit program that calls any other via variants. It works fine with using list_to_memory, convert to ascii, and open dataset. I can download the report in excel format to an application server.
Problem is that the reports arent delimited properly in the excel report. Usually there is a vertial line "|" placed after each column and it would be eazy to mauiplate it during viewing the actual file.
However I want this done automatically. My question is, is there a way to delimit the list before/during using open/transfer/close dataset?
My solution before was to convert the vertical lines to a comma and just save the file as a CSV file. Problem here is the data could be affected as comma is being used normally. So the excel report would get messed up.
Hope I get some help soon. Thanks guys and good day.Lets say you have fields A, B, C and D to be transfered to the dataset. You can use the below logic.
concatenate a b c d into l_text separated by '$'.
transfer l_text to dsn.
Now, when you open the text file in excel it would ask you whether the file is delimeted or fixed width...if you select delimited..in the next screen you would be able to select the delimiter.
Regards
Anurag -
Open dataset and close dataset
Hi
I need to write log file in fileshare.
I am using the following FM to create the file.
Z_FILE_OPEN_OUT_UNICODE'
I have following qns
1. do i need to use open dataset and close dataset stmts, even I create the files with the FM?Hi,
you can fill in the name of the FM in transaction SE37, then click 'Display' and look at the source code and the 'Tables' tab.
It's a custom build FM, so you might have to look at the import parameters it needs... ( Tab 'Import' and 'Tables' ).
To answer your question, as the name of the FM suggests it will write the file for you, so no open/close dataset. Please doublecheck tab 'Source code' and you might find these statements there...
hope that helps,
Rolf -
Use of Return and Notify_url variables offered by PayPal
I have been integrating PayPal into my application (ASP NET MVC) where I made some analysis about PayPal (went through their documentation about the integration). Created a PayPal sandbox account and can transfer the amount.What I want to know is about the `return` and `notify_url` variables. I have enabled `auto return` in my account and also enabled `PDT`. My form variable is like this:<input type="hidden" name="notify_url" value="http://localhost:xxx/xx/Notify">
<input type="hidden" name="return" value="http://localhost:xx/xx/Return">As I have surfed in net, what they state about `Return` and `notify_url` is:> The "return" URL to which PayPal redirects buyers’ browser after they complete their payments. For example, specify a URL on your site that displays a “Thank you for your payment” page. Default is nothing is specified – PayPal redirects the browser to a PayPal webpage. Note, you must have "Auto Return" enabled in your Account Profile settings in order for this variable to work.
>PayPal returns data back to your site via what they call IPN. Its really just a callback to a URL you specify. You can set this URL via the variable `notify_url` you can send to PayPal.From the above quotes what I understand is that PayPal will post `IPN` variables to `notify action` once the payment done before auto redirecting to the page I set (I mean customer may go the application page or they may close the session).But only return action alone hitting not the `Notify_url`.Correct me if I misunderstood the concept and let me know if it was still Unclear.Yes, it's not present in the code I have posted but I have tried this as well.
It didn't work, as expected, because soap/axis is on top of http and not https and because my proxy uses http as well (or at least that's what I have learned so far).
In fact, I have tried all combinations between http.\*, https.\*, and Authenticator without success.
I think the problem is more soap/axis related. The solution for axis2 seems somewhat 'trivial' (and well explained over the web) while it's not for axis1.
Regards
Rob
Edited by: RobR on Nov 29, 2007 4:37 AM
Edited by: RobR on Nov 29, 2007 9:56 AM -
Open module for managing property file and environment variables
Looking for an open module for managing property files and environment variables (like CLASSPATH) set in a shell script. For handeling properties (preserving comments, supporting includes, appending new entries, and more) I have looked at SuperProperties from openadaptor but find certain functionality lacking. As for interfacing with common shell scripts/files containing setting for CLASSPATH, JAVA_HOME, other system/application variables another type of object editor is needed. Maybe JFIG?
Any ideas are greatly welcomed.You seem wright, you hit a brick wall here with Air to find the location
of the command console on windows...
So in fact I never build an exe tool, but this little problem was a nice
case to test it and I tried it.:
I downloaded monodevelop
-GTK# for .NET 2.12.10*
-MonoDevelop 2.4.2*
from http://monodevelop.com/Download
created a console project and had an exe in 5 minutes !
You can download the findconsole tool and the projectfiles here:
http://greencollective.nl/temp/dump/findconsole_monoproject.zip
findconsole.exe will reveal the path/location of cmd.exe on a windows system.
Cheers,
Latcho -
Report in new page does not know of session and presentation variables
I have a question about GOURL.
I am using GOURL as a column function in one report (report A), so that when i click on that column it takes me to another report(report B) that open in new popup window.
the first report (A) also uses some session and presentation variables, which is also used by Report B as filters. I am curious that if I add these filters which are using variables to report B, why can't report B get the value of these, (it just errors out ) because it didn't found any value to those variables in the filter.
Becuase I am ending up with passing all these variables in GOURL and setting them as 'isprompted'.
Does this report (B) knows nothing else than what it finds in GOURL?
thanksIn a nutshell, if u use gourl then its parameters will be only using in navigated report. This is functionality
-
How to change value of instance variable and local variable at run time?
As we can change value at run time using debug mode of Eclipse. I want to do this by using a standalone prgram from where I can change the value of a variable at runtime.
Suppose I have a class, say employee like -
class employee {
public String name;
employee(String name){
this.name = name;
public int showSalary(){
int salary = 10000;
return salary;
public String showName()
return name;
i want to change the value of instance variable "name" and local variable "salary" from a stand alone program?
My standalone program will not use employee class; i mean not creating any instance or extending it. This is being used by any other calss in project.
Can someone tell me how to change these value?
Please help
Regards,
Sujeet SharmaThis is the tutorial You should interest in. According to 'name' field of the class, it's value can be change with reflection. I'm not sure if local variable ('salary') can be changed - rather not.
-
Financial Reporting and substitution variable
Hello,
i have a problem with FR and substitution variable. I create the substitution variable in Essbase for example antYear but i dont'see in dimension layout in FR studio and workspace.
Thanks.You'll need to restart FR studio, after you have created the substitution variables. As the studio only performs one read of the sub var database on startup.
It also won't show up unless you assign a member to it.
Hope this helps.
Iain -
Publish Dataset and history in sap lumira server
Hi Experts
I'm trying to publish a dataset and story from the sap Lumira desktop to Lumira server.
Tools used
SAP HANA DATABASE REV.80 INSTANCIA EN WINDOWS AZURE
SAP LUMIRA DESTOP V1.18
SAP LUMIRA SERVER V1.18
The process I followed is as follows:
1. Create Users:
CONFIG: Assign the role sap.bi.admin :: BI_CONFIGURATOR. Some other role or privilege required?
TECNICO: Assign the role sap.bi.common :: BI_TECH_USER. Some other role or privilege required?
ANALISTA: Assign the role sap.bi.common :: BI_DATA_ANALYST. This user is the one that has the role to publish in Lumira sap server. Some other role or privilege required?
2. Entry to http: // <HOSTNAME> 80 <INSTANCE> / sap / hana / xs / FormLogin /
I sign in with the password created in hana studio for each user and then make the change the password of each user CONFIG - TECNICO – ANALISTA
3. Entry to http://<HOSTNAME>:80<INSTANCE>/sap/bi/launchpad/fiori
I sign in with the user CONFIG and in the catalag administration of sap Lumira server income in the field Enter technical user TECNICO, so I confirm the sql connection.
4. Entry to http: // <HOSTNAME> 80 <INSTANCE> / sap / hana / xs / admin
I sign in with the user CONFIG sap.bi.launchpad.logic.v2 following path of the package and confirm that the sql connection is for the user TECNICO
5. Entry to Sap lumira Desktop, sign in with the user ANALISTA to access the dataset, I create visualization and history, the last step is to publish the dataset and story in SAP Lumira server, for this I sign in with the user ANALISTA but when I clic on the button PUBLISH IN SAP LUMIRA SERVER is show me this error:
Error - The dataset could not be published to SAP Lumira Server because publishing to the SAP HANA layer failed. Reason is ''. (HDB 11009)
I searched many blogs of sap and tested with the following options but None of the above helped me to solve the problem.
http://scn.sap.com/community/lumira/blog/2014/06/10/how-to-install-sap-lumira-server
http://scn.sap.com/community/lumira/blog/2014/06/21/sap-lumira-server-on-hana--part-2
http://scn.sap.com/thread/3532168
http://www.saptechies.com/access-privileges-required-sap-lumira-from-sap-hana/
http://scn.sap.com/thread/3523762
http://scn.sap.com/community/lumira/blog/2014/06/16/sap-lumira-server-sap-fiori-launchpad-integration
http://www.saptechies.com/security-settings-run-lumira-hana-online-shl-views/
http://scn.sap.com/community/lumira/blog/2014/06/16/sap-lumira-server-post-install-configuration
6. Another issue is when I access to Lumira server http: // <HOSTNAME> 80 <INSTANCE> / sap / bi / launchpad / and I sign in with the user ANALISTA, I find a number of the dataset in lumira server but when I run any for create a compose can not access hana dataset.
Shows me the following error
Please help me with this issues
ThanksHi John,
I also forwarded the incident to SAP and as suggested by SAP, after assigning sap.hana.xs.lm.roles::Administrator my issue was resolved.
Regards,
Abhijit
Maybe you are looking for
-
I am working on a project that needs a Rich-Text Editor with ability to insert tables, images, and more complex editing features such as what FCKEditor provides but ideally that was built with Flex in mind. Is there such an editor available? I have s
-
ITunes no longer plays my MP3!
Hey there! I recently reformatted my Windows machine which contains all my music. I tried playing an album I had ripped to MP3 and iTunes did not want to play it. I tried loading the file in Quicktime and I would get a "-2048: the file is not a movie
-
White screen of death after 3 mins of usage
Hiyah, so my iphone got the so called "White screen of death" after 3 minutes of usage, i've tried restore and all of that but without success. What should i do? Send it in for repair? (seems really ridicilous if have to since it was bought the same
-
Hi Experts, While creating credit note from credit memo request,I am unable to get the same price as credit memo request. and in copy control I have maintained the Pricing type as " D ". So request you to kindly advise that how to get same value(Cred
-
Tree Control Double Click Functionality
Hi All, I'm trying to get a tree control to operate a case structure, and I cannot seem to get the Double Click invoke node to output my tags from the tree. Anyone know what I may be doing wrong?! Thanks, Derek Solved! Go to Solution. Attachments: