Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
323 lines (291 sloc) 8.28 KB
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="../xsl/model-webforms-layout.xsl" output-base-path="../../templates/generated/" output-file="*"?>
<model xmlns="urn:schemas-nreco:webforms:layout:v2">
<views>
<view name="BookList">
<action name="load">
<databind/>
</action>
<command name="SetRating">
<action name="massSetBookRating">
<dataitem/>
<listselectedkeys name="BookList"/>
</action>
<databind/>
</command>
<updatepanel>
<list datakey="id" add="true" edit="true" name="BookList">
<datasource>
<dalc from="dsDalc" tablename="books" id="bookDS">
<condition>
1=1 @filter_title[and title like "filter_title:%{0}%":var]
@filter_relex[and {0}]
</condition>
<relation name="author_ids" datakeyname="id">
<mapper table="book_to_author" fromfield="book_id" tofield="author_id"/>
</relation>
</dalc>
</datasource>
<operations>
<dialoglink caption="Set Rating" url="~/bookListSetRating.aspx" class="btn btn-default">
<callback command="SetRating"/>
<dialog height="200"/>
</dialoglink>
</operations>
<filter>
<field name="filter_title" caption="Title">
<editor>
<textbox/>
</editor>
</field>
<!-- install NReco.Dsm.WebForms.ConditionBuilder and uncomment conditionbuilder -->
<!--field name="filter_condition" caption="Custom Filter">
<editor>
<conditionbuilder relexfield="filter_relex" conditionfield="filter_condition_json" expressionfield="filter_expression_json">
<field name="title" caption="Title">
<editor>
<textbox/>
</editor>
</field>
<field name="description" caption="Description">
<editor>
<textbox/>
</editor>
</field>
<field name="rating" caption="Rating">
<editor>
<numbertextbox/>
</editor>
</field>
</conditionbuilder>
</editor>
</field-->
<field>
<renderer>
<linkbutton command="Filter" validate="false" caption="Filter"/>
<linkbutton caption="Reset" validate="false" command="Reset"/>
</renderer>
</field>
</filter>
<field name="title" caption="Title">
<renderer>
<link>
<url>
<format str="~/book.aspx?id={0}"><field name="id"/></format>
</url>
<caption>
<field name="title"/>
</caption>
</link>
</renderer>
<editor>
<textbox/>
<validators>
<required/>
</validators>
</editor>
</field>
<field name="description" caption="Description">
<editor>
<textarea rows="3"/>
</editor>
</field>
<field name="rating" caption="Rating">
<editor>
<textbox datatype="integer" empty-is-null="true" suffix=" stars"/>
</editor>
</field>
<field name="available" caption="Avail?">
<editor>
<checkbox/>
</editor>
</field>
<field name="author_ids" caption="Authors">
<renderer>
<ul>
<data><field name="author_ids"/></data>
<item>
<expression>
<lookup name="getAuthorName"><dataitem/></lookup>
</expression>
</item>
</ul>
</renderer>
<editor>
<checkboxlist>
<lookup name="getAuthorsList" text="name" value="id" group="sex"/>
</checkboxlist>
</editor>
</field>
<field edit="false" add="false">
<renderer>
<linkbutton command="Edit" caption="Inline Edit" validate="true"/>
<linkbutton command="Delete" caption="Delete"/>
</renderer>
</field>
<field view="false" edit="false">
<renderer>
<linkbutton command="Insert" caption="Add" validate="true"/>
</renderer>
</field>
<field view="false" add="false">
<renderer>
<linkbutton command="Update" caption="Save" validate="true"/>
<linkbutton command="Cancel" caption="Cancel" validate="true"/>
</renderer>
</field>
</list>
</updatepanel>
<placeholder>
<renderer>
<link caption="Add Book" url="~/book.aspx?id=-1" class="btn btn-default"/>
</renderer>
</placeholder>
<placeholder>
<renderer>
<expression>
<listrowcount name="BookList"/>
</expression>
</renderer>
</placeholder>
</view>
<view name="BookForm">
<action name="load">
<setdatacontext name="id"><request name="id"/></setdatacontext>
</action>
<updatepanel>
<form datakey="id" view="false" add="true">
<datasource>
<dalc from="dsDalc" tablename="books" id="bookFormDS">
<condition>id="id":var</condition>
<relation name="author_ids" datakeyname="id">
<mapper table="book_to_author" fromfield="book_id" tofield="author_id"/>
</relation>
</dalc>
</datasource>
<action name="cancel">
<redirect>
<const>~/</const>
</redirect>
</action>
<action name="inserted">
<redirect>
<const>~/</const>
</redirect>
</action>
<action name="updated">
<redirect>
<const>~/</const>
</redirect>
</action>
<field name="title" caption="Title">
<editor>
<textbox/>
<validators>
<required/>
</validators>
</editor>
</field>
<field name="description" caption="Description">
<editor>
<textarea rows="3"/>
</editor>
</field>
<field name="rating" caption="Rating">
<editor>
<textbox datatype="integer" empty-is-null="true" suffix=" stars"/>
</editor>
</field>
<field name="available" caption="Avail?">
<editor>
<checkbox/>
</editor>
</field>
<field name="author_ids" caption="Authors">
<renderer>
<expression>
<code>DataBinder.Eval(Container.DataItem, "author_ids.Length")</code>
</expression>
</renderer>
<editor>
<checkboxlist>
<lookup name="getAuthorsList" text="name" value="id" group="sex"/>
</checkboxlist>
</editor>
</field>
<field name="country_id" caption="Country">
<editor>
<dropdownlist>
<lookup name="getCountriesList" text="name" value="id"/>
<notselected text="- not selected -"/>
</dropdownlist>
</editor>
</field>
<field name="city_id" caption="City">
<editor>
<dropdownlist>
<lookup name="getCitiesByCountryList" text="name" value="id">
<control name="country_id"/>
</lookup>
<notselected text="- not selected -"/>
</dropdownlist>
</editor>
</field>
<footer add="false" view="false">
<linkbutton caption="Update" command="Update" validate="true"/>
<linkbutton caption="Cancel" command="Cancel" validate="false"/>
</footer>
<footer add="true" edit="false" view="false">
<linkbutton caption="Add" command="Insert" validate="true"/>
<linkbutton caption="Cancel" command="Cancel" validate="false"/>
</footer>
</form>
</updatepanel>
</view>
<view name="BookListSetRating">
<action name="load">
<setdatacontext name="jscallback"><request name="jscallback"/></setdatacontext>
</action>
<command name="Set">
<jscallback close="true">
<function><datacontext name="jscallback"/></function>
<arg>
<field name="rating"/>
</arg>
</jscallback>
</command>
<updatepanel>
<actionform name="ratingForm">
<field name="rating" caption="Set Rating">
<editor>
<textbox datatype="integer" empty-is-null="true" suffix=" stars"/>
<validators>
<required/>
</validators>
</editor>
</field>
<footer>
<linkbutton caption="Set" validate="true" command="Set"/>
</footer>
</actionform>
</updatepanel>
</view>
</views>
<settings>
<services>
<datasetfactory name="dsFactory"/>
</services>
<linkbutton class="btn btn-default"/>
<list>
<styles>
<listtable class="table" pagerrowclass="pagerrow"/>
<filter class="listViewFilter form-inline" fieldclass="listViewFilterField form-group" />
</styles>
</list>
<form>
<styles>
<table class="table FormView"/>
</styles>
</form>
</settings>
</model>