Skip to content

Commit

Permalink
Fix #321
Browse files Browse the repository at this point in the history
  • Loading branch information
whitemx committed May 18, 2015
1 parent a91c023 commit ac602b0
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 55 deletions.
20 changes: 17 additions & 3 deletions sampler-app/CustomControls/UnpBootFormEditor.xsp
Expand Up @@ -23,11 +23,25 @@
<xp:panel styleClass="modal-header">
<xp:panel styleClass="btn-group pull-left">
<xp:this.rendered><![CDATA[#{javascript:compositeData.showbuttons != false}]]></xp:this.rendered>
<a href="#" class="btn btn-danger"
data-dismiss="modal">
<xp:panel tagName="a" styleClass="btn btn-danger">
<xp:this.attrs>
<xp:attr>
<xp:this.name><![CDATA[#{javascript:if (compositeData.fullpagemode != true){
return "data-dismiss";
}else{
return "onclick";
}}]]></xp:this.name>
<xp:this.value><![CDATA[#{javascript:if (compositeData.fullpagemode != true){
return "modal";
}else{
return "history.go(-1);";
}}]]></xp:this.value>
</xp:attr>
<xp:attr name="href" value="#"></xp:attr>
</xp:this.attrs>
<i class="fa fa-times" />
&#160;Cancel
</a>
</xp:panel>
</xp:panel>


Expand Down
10 changes: 10 additions & 0 deletions sampler-app/CustomControls/UnpBootFormEditor.xsp-config
Expand Up @@ -59,5 +59,15 @@
<property-name>callback</property-name>
<property-class>string</property-class>
</property>
<property>
<property-name>fullpagemode</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<editor>com.ibm.std.Boolean</editor>
<default-value>false</default-value>
</designer-extension>
</property-extension>
</property>
</composite-component>
</faces-config>
122 changes: 70 additions & 52 deletions sampler-app/XPages/PersonEdit.xsp
Expand Up @@ -14,19 +14,22 @@
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xc="http://www.ibm.com/xsp/custom"
xmlns:unp="http://unplugged.teamstudio.com">
<unp:UnpBootFormEditor showbuttons="true"
footertext="Built with Bootcards - Form Editor Card" viewxpagename="FlatView.xsp"
formname="Person" title="Person" xp:key="facet_1" callback="savecallback">
footertext="Built with Bootcards - Form Editor Card"
viewxpagename="FlatView.xsp" formname="Person" title="Person"
xp:key="facet_1" callback="savecallback" fullpagemode="false">
<xp:this.facets>
<xp:panel id="list-group" xp:key="facet_1">
<div class="form-group">
<xp:label styleClass="col-xs-4 control-label" for="name"
value="First Name">
<xp:label styleClass="col-xs-4 control-label"
for="name" value="First Name">
</xp:label>
<div class="col-xs-8">
<xp:inputText id="firstname" value="#{docedit.firstname}"
<xp:inputText id="firstname"
value="#{docedit.firstname}"
styleClass="form-control required">
<xp:this.attrs>
<xp:attr name="placeholder" value="First Name">
<xp:attr name="placeholder"
value="First Name">
</xp:attr>
</xp:this.attrs>
</xp:inputText>
Expand All @@ -36,14 +39,15 @@
</div>
</div>
<div class="form-group">
<xp:label styleClass="col-xs-4 control-label" for="name"
value="Last Name">
<xp:label styleClass="col-xs-4 control-label"
for="name" value="Last Name">
</xp:label>
<div class="col-xs-8">
<xp:inputText id="lastname" value="#{docedit.lastname}"
styleClass="form-control required">
<xp:inputText id="lastname"
value="#{docedit.lastname}" styleClass="form-control required">
<xp:this.attrs>
<xp:attr name="placeholder" value="Last Name">
<xp:attr name="placeholder"
value="Last Name">
</xp:attr>
</xp:this.attrs>
</xp:inputText>
Expand All @@ -53,14 +57,15 @@
</div>
</div>
<div class="form-group">
<xp:label styleClass="col-xs-4 control-label" for="title"
value="Title">
<xp:label styleClass="col-xs-4 control-label"
for="title" value="Title">
</xp:label>
<div class="col-xs-8">
<xp:inputText id="title" value="#{docedit.Title}"
styleClass="form-control">
<xp:inputText id="title"
value="#{docedit.Title}" styleClass="form-control">
<xp:this.attrs>
<xp:attr name="placeholder" value="Title">
<xp:attr name="placeholder"
value="Title">
</xp:attr>
</xp:this.attrs>
</xp:inputText>
Expand All @@ -70,11 +75,13 @@
</div>
</div>
<div class="form-group">
<xp:label value="Date" id="datetime_initialcontactdatelabel"
for="initialcontactdate" styleClass="col-xs-4 control-label">
<xp:label value="Date"
id="datetime_initialcontactdatelabel" for="initialcontactdate"
styleClass="col-xs-4 control-label">
</xp:label>
<div class="col-xs-8">
<xp:inputText id="initialcontactdate" styleClass="form-control">
<xp:inputText id="initialcontactdate"
styleClass="form-control">
<xp:this.attrs>
<xp:attr name="datevalue">
<xp:this.value><![CDATA[#{javascript:try{
Expand All @@ -90,14 +97,16 @@
</div>
</div>
<div class="form-group">
<xp:label styleClass="col-xs-4 control-label" for="email"
value="Email">
<xp:label styleClass="col-xs-4 control-label"
for="email" value="Email">
</xp:label>
<div class="col-xs-8">
<xp:inputText id="email" value="#{docedit.Email}"
styleClass="form-control" type="email">
<xp:inputText id="email"
value="#{docedit.Email}" styleClass="form-control"
type="email">
<xp:this.attrs>
<xp:attr name="placeholder" value="Email">
<xp:attr name="placeholder"
value="Email">
</xp:attr>
</xp:this.attrs>
</xp:inputText>
Expand All @@ -107,8 +116,8 @@
</div>
</div>
<div class="form-group">
<xp:label value="Mobile Enabled?" id="mobilelabel" for="mobileenabled"
styleClass="col-xs-4 control-label">
<xp:label value="Mobile Enabled?" id="mobilelabel"
for="mobileenabled" styleClass="col-xs-4 control-label">
</xp:label>
<div class="col-xs-8">
<xp:panel id="toggle">
Expand All @@ -120,40 +129,47 @@ return out;}]]></xp:this.styleClass>
<div class="bootcards-toggle-handle"></div>
</xp:panel>
<xp:checkBox checkedValue="fredchecked"
uncheckedValue="barryunchecked" style="display: none;" value="#{docedit.mobileenabled}"
required="false" id="mobileenabled">
uncheckedValue="barryunchecked" style="display: none;"
value="#{docedit.mobileenabled}" required="false"
id="mobileenabled">
<xp:this.attrs>
<xp:attr name="checkedValue" value="fredchecked">
<xp:attr name="checkedValue"
value="fredchecked">
</xp:attr>
<xp:attr name="uncheckedValue" value="barryunchecked">
<xp:attr name="uncheckedValue"
value="barryunchecked">
</xp:attr>
</xp:this.attrs>
</xp:checkBox>
</div>
</div>
<div class="form-group">
<xp:label value="Company" id="companylabel" for="company"
styleClass="col-xs-4 control-label">
<xp:label value="Company" id="companylabel"
for="company" styleClass="col-xs-4 control-label">
</xp:label>
<div class="col-xs-8">
<xp:inputText id="company" value="#{docedit.Company}"
styleClass="required form-control typeahead" autocomplete="off">
<xp:inputText id="company"
value="#{docedit.Company}"
styleClass="required form-control typeahead"
autocomplete="off">
<xp:this.attrs>
<xp:attr name="jslist" value="companies">
<xp:attr name="jslist"
value="companies">
</xp:attr>
</xp:this.attrs>
</xp:inputText>
</div>
</div>
<div class="form-group">
<xp:label styleClass="col-xs-4 control-label" for="streetaddress"
value="Street Address">
<xp:label styleClass="col-xs-4 control-label"
for="streetaddress" value="Street Address">
</xp:label>
<div class="col-xs-8">
<xp:inputText id="streetaddress" value="#{docedit.streetaddress}"
styleClass="form-control">
<xp:inputText id="streetaddress"
value="#{docedit.streetaddress}" styleClass="form-control">
<xp:this.attrs>
<xp:attr name="placeholder" value="Street Address">
<xp:attr name="placeholder"
value="Street Address">
</xp:attr>
</xp:this.attrs>
</xp:inputText>
Expand All @@ -163,14 +179,15 @@ return out;}]]></xp:this.styleClass>
</div>
</div>
<div class="form-group">
<xp:label styleClass="col-xs-4 control-label" for="city"
value="City">
<xp:label styleClass="col-xs-4 control-label"
for="city" value="City">
</xp:label>
<div class="col-xs-8">
<xp:inputText id="city" value="#{docedit.city}"
styleClass="form-control">
<xp:this.attrs>
<xp:attr name="placeholder" value="City">
<xp:attr name="placeholder"
value="City">
</xp:attr>
</xp:this.attrs>
</xp:inputText>
Expand All @@ -180,27 +197,28 @@ return out;}]]></xp:this.styleClass>
</div>
</div>
<div class="form-group">
<xp:label styleClass="col-xs-4 control-label" for="country"
value="Country">
<xp:label styleClass="col-xs-4 control-label"
for="country" value="Country">
</xp:label>
<div class="col-xs-8">
<xp:comboBox id="country" value="#{docedit.Country}"
styleClass="form-control">
<xp:comboBox id="country"
value="#{docedit.Country}" styleClass="form-control">
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:@Unique(@DbColumn(@DbName(), "People By Country", 1))}]]></xp:this.value>
</xp:selectItems>
</xp:comboBox>
</div>
</div>
<div class="form-group">
<xp:label styleClass="col-xs-4 control-label" for="phone"
value="Phone">
<xp:label styleClass="col-xs-4 control-label"
for="phone" value="Phone">
</xp:label>
<div class="col-xs-8">
<xp:inputText id="phone" value="#{docedit.phone}"
type="tel" styleClass="form-control">
<xp:inputText id="phone"
value="#{docedit.phone}" type="tel" styleClass="form-control">
<xp:this.attrs>
<xp:attr name="placeholder" value="Phone">
<xp:attr name="placeholder"
value="Phone">
</xp:attr>
</xp:this.attrs>
</xp:inputText>
Expand Down

0 comments on commit ac602b0

Please sign in to comment.