|
Processing... Researchers have demonstrated a caterpillar-like soft robot that can move forward, backward and dip under narrow spaces. The caterpillar-bot's movement is driven by a novel pattern of silver nanowires that use heat to control the way the robot bends, allowing users to steer the robot in either direction.
Description & Source Code
This demo fetches the RSS subscription and binds the content to the ZUL page using ZK's data-binding feature.
rss_reader.zul
<window apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('demo.misc.rss_reader.RSSViewModel')" width="100%" height="500px"> <style src="/widgets/miscellaneous/rss_reader/style.css" /> <borderlayout width="100%" height="100%"> <west width="200px" collapsible="true" title="Subscription Title"> <vlayout height="100%"> <image src="@load(vm.selectedFeed.feedImageLink)" width="100%" /> <separator/> <listbox id="newsListBox" vflex="1" model="@load(vm.selectedFeed.feedEntries)" width="100%" selectedItem="@bind(vm.selectedEntry)"> <template name="model" var="feed"> <listitem label="@load(feed.title)" /> </template> </listbox> </vlayout> </west> <center> <groupbox hflex="1" vflex="1" closable="false" mold="3d"> <caption label="@load(vm.selectedEntry.title)"> <div width="70px"><a sclass="link" href="@load(vm.selectedEntry.link)" target="_zkdemo">Full Article</a></div> </caption> <div hflex="1" vflex="1" style="overflow:auto"> <html class="desc" content="@load(vm.selectedEntry.descValue)" /> </div> </groupbox> </center> </borderlayout> </window> RSSViewModel.java
package demo.misc.rss_reader; import org.zkoss.bind.annotation.Init; import org.zkoss.zrss.RssBinder; import org.zkoss.zrss.RssEntry; import org.zkoss.zrss.RssFeed; public class RSSViewModel { private RssFeed selected; private RssEntry selectEntry; @Init public void init() throws Exception { selected = new RssBinder().lookUpFeed("https://www.sciencedaily.com/rss/matter_energy/engineering.xml"); selectEntry = selected.getFeedEntries().get(0); } public RssFeed getSelectedFeed() { return selected; } public RssEntry getSelectedEntry() { return selectEntry; } public void setSelectedEntry(RssEntry selectedEntry) { this.selectEntry = selectedEntry; } }
Copyright © 2005-2023 Potix Corporation All rights reserved.
|
Processing... |