
<?xml version="1.0" encoding="utf-8"?>
<SimpleControl name="Navbar" descriptors="xworker.http.controls.SimpleControl">
<actions>
<GroovyAction name="doAction">
<code><![CDATA[def form = """<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>""";
def rightItems = [
[label:"链接", href:"#", type:"link"],
[label:"下拉列表", href:"#", type:"link",
childs:[
[label:"动作", href:"#", type:"link"],
[label:"分隔符", type:"separator"],
[label:"更多", href:"#", type:"link"]
]
],
[label:"表单", type:"content", content:form.toString()]
];
actionContext.getScope(0).put("rightItems", rightItems);
return "success";]]></code>
</GroovyAction>
</actions>
<view title="导航条测试">
<otherHeads><![CDATA[<meta http-equiv="content-type" content="text/html; charset=utf-8">
<LINK REL ="stylesheet" TYPE="text/css" HREF="fckeditor/2_6beta1/editor/css/fck_editorarea.css" TITLE="Style"/>
<script type="text/javascript" src="js/xworker/InnerBrowserUtil.js"></script>]]></otherHeads>
<JQuery descriptors="xworker.html.jquery.JQuery" version="jquery-2.0.3.min.js"></JQuery>
<Bootstrap>
<Navbar id="navbar" rightBarVar="rightItems" fluid="false" fixed="static-top" navbar-inverse="true" brandLabel="公司名">
<LeftBar>
<Item name="Link" descriptors="xworker.html.bootstrap.template.Navbar/@RightBar/@Item"></Item>
<Item name="Dropdown" descriptors="xworker.html.bootstrap.template.Navbar/@RightBar/@Item" id="dddd">
<Item name="Action"></Item>
<Item name="ac1" label="Another action"></Item>
<Item name="ac2" label="Something else here"></Item>
<Item type="separator"></Item>
<Item name="ac2" _xmeta_id_="ac21" label="Separated link"></Item>
<Item _xmeta_id_="Item1" type="separator"></Item>
<Item name="more" label="One more separated link"></Item>
</Item>
</LeftBar>
</Navbar>
</Bootstrap>
</view>
<result name="success" value="xworker.example.web.bootstrap.jsplugin.Navbar/@view"></result>
</SimpleControl>