How do you add a brand new attribute to a node in an OpenLaszlo XML dataset?
How do you add a new attribute to a dataset node in OpenLaszlo platform?
190 Views Asked by Kmeixner At
1
There are 1 best solutions below
Related Questions in OPENLASZLO
- Flash Media - refresh camera list on the fly
- Openlaszlo WebSocket not working
- I want to type cast in openlaszlo?
- OpenLaszlo 4.9 DHTML login servlet forwards but never loads page
- Clearing dataset takes lot of time in Openlaszlo
- Openlaszlo 5.0.x getattribute, rotation
- How to add or change API in openmeeting?
- how to run openlaszlo 4.9.0 in ubuntu12.04?
- OpenLaszlo 5.x - Deleting Imported Libraries
- How do you add a new attribute to a dataset node in OpenLaszlo platform?
- What is the proper syntax to databind a class attribute in the OpenLaszlo language?
- OpenLaszlo 5.0.x - HTML5 compile issues
- openlaszlo Button and Radiogroup inerference
- Openlaszlo compilation issue in linux
- OpenLaszlo drag and rotate issue
Related Questions in LZX
- How to decode Base64 encoded binary(encoded using LZX algorithm) back to original string
- How do I modify openmeetings pages?
- OpenLaszlo 5.x - Deleting Imported Libraries
- How do you add a new attribute to a dataset node in OpenLaszlo platform?
- What is the proper syntax to databind a class attribute in the OpenLaszlo language?
- Openlaszlo compilation issue in linux
- How to reference an element of a XSD / how to build a link to an element of a XSD file to reference its documentation?
- OpenLaszlo drag and rotate issue
- OpenLaszlo font rendering not consistent for 3.x and 5.0 when using embedded fonts
- OpenLaszlo scrolling issue
- Openlaszlo bringtoFront is not working properly
- Is OpenLaszlo supported in custom browsers that are created through adobe air?
- Scrollbar issue in scrolledittext openlaszlo
- Focus issue in scroll edit text openlaszlo
- Openlaszlo DHTML custom cursor issue
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The way to do this is to use the lz.datapointer.setNodeAttribute() function. If you use the setNodeAttribute() function with an attribute name that does not already appear on the node, a new one will be created.
In the sample OpenLaszlo application below, if you press the button titled [displayXML] after you compile the program, you will see the XML dataset before any changes are made does not contain any "fav_saying" attribute.
After you click the [updateAttribute] button to add the favorite saying for Homer via the setNodeAttribute() method, you can then click the [displayXML] button again and you will see that an attribute called 'fav_saying' has been added to the XML dataset.
<dataset name="myData">
<myXML>
<person firstname="Homer" lastname="Simpson" />
<person firstname="Marge" lastname="Simpson" />
<person firstname="Montgomery" lastname="Burns" />
</myXML>
</dataset>
<button text="displayXML">
</button>
<button text="updateAttribute">
</button>
</canvas>
You will also see that multiple calls to setNodeAttribute() will not add additional 'fav_saying' attributes. If the program used a different value for the saying every time then the value in the 'fav_saying' attribute would change but there would still only be one 'fav_saying' attribute.