-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MooTools added MTAjaxInPlace based on the original AjaxInPlace. Also …
…added an example of it's usage to the example project.
- Loading branch information
1 parent
4ae898c
commit e1c6e22
Showing
12 changed files
with
559 additions
and
4 deletions.
There are no files selected for viewing
89 changes: 89 additions & 0 deletions
89
Examples/Ajax/MooToolsExample/Components/MTAjaxInPlaceTestPage.wo/MTAjaxInPlaceTestPage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<wo:Main pageTitle = "Ajax In Place Port"> | ||
<h2>Ajax In Place...</h2> | ||
<hr /> | ||
<p> | ||
AjaxInPlace provides support for arbitrarily complex view and edit components. | ||
</p> | ||
<hr/> | ||
<h3>Simple AjaxInPlace</h3> | ||
<hr/> | ||
<webobject name = "ExampleInPlace"> | ||
<webobject name = "View">View: <webobject name = "Value" /></webobject> | ||
<webobject name = "Edit"><label>Edit:</label><webobject name = "ValueField" /></webobject> | ||
</webobject> | ||
<hr/> | ||
<h3>Simple AjaxInPlace with Manual Controls</h3> | ||
<hr/> | ||
<webobject name = "ExampleInPlaceManual"> | ||
<webobject name = "ViewManual"> | ||
View: <webobject name = "ManualValue"/> | ||
<br/> | ||
<webobject name = "ClickToEdit">click to edit</webobject> | ||
</webobject> | ||
<webobject name = "EditManual"> | ||
Edit: <webobject name = "ManualValueField"/> | ||
<br/> | ||
<webobject name = "ClickToSave">click to save</webobject> | ||
<webobject name = "ClickToCancel">click to cancel</webobject> | ||
</webobject> | ||
</webobject> | ||
<hr/> | ||
<h3>Fancier AjaxInPlace</h3> | ||
<hr/> | ||
<webobject name = "FancyInPlace"> | ||
<webobject name = "FancyView"> | ||
<div id = "fancyView"> | ||
<h2>Personal Information</h2> | ||
<table class = "table table-striped"> | ||
<tr> | ||
<th>First Name</th> | ||
<td><webobject name = "FirstName"/></td> | ||
</tr> | ||
|
||
<tr> | ||
<th>Last Name</th> | ||
<td><webobject name = "LastName"/></td> | ||
</tr> | ||
|
||
<tr> | ||
<th>Phone Number</th> | ||
<td><webobject name = "PhoneNumber"/></td> | ||
</tr> | ||
</table> | ||
<span class = "label label-info">click anywhere to edit</span> | ||
</div> | ||
</webobject> | ||
<webobject name = "FancyEdit"> | ||
<div id = "fancyEdit"> | ||
<fieldset> | ||
<legend>Edit Personal Information</legend> | ||
<div class="control-group"> | ||
<label class="control-label" for="firstName">First Name</label> | ||
<div class="controls"> | ||
<webobject name = "FirstNameField"/> | ||
<p class="help-block">Enter your first name here.</p> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<label class="control-label" for="lastName">Last Name</label> | ||
<div class="controls"> | ||
<webobject name = "LastNameField"/> | ||
<p class="help-block">Enter your last name here.</p> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<label class="control-label" for="phoneNumber">Phone Number</label> | ||
<div class="controls"> | ||
<webobject name = "PhoneNumberField"/> | ||
<p class="help-block">Enter your phone number here.</p> | ||
</div> | ||
</div> | ||
<div class = "form-actions"> | ||
<webobject name = "FancySave">save</webobject> or | ||
<webobject name = "FancyCancel">cancel</webobject> | ||
</div> | ||
</fieldset> | ||
</div> | ||
</webobject> | ||
</webobject> | ||
</wo:Main> |
123 changes: 123 additions & 0 deletions
123
Examples/Ajax/MooToolsExample/Components/MTAjaxInPlaceTestPage.wo/MTAjaxInPlaceTestPage.wod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
ClickToCancel : WOHyperlink { | ||
class = "btn"; | ||
href = "javascript:void(0)"; | ||
onclick = "ExampleInPlaceManualCancel()"; | ||
} | ||
|
||
ClickToEdit : WOHyperlink { | ||
class = "btn"; | ||
href = "javascript:void(0)"; | ||
onclick = "ExampleInPlaceManualEdit()"; | ||
} | ||
|
||
ClickToSave : WOHyperlink { | ||
class = "btn btn-primary"; | ||
href = "javascript:void(0)"; | ||
onclick = "ExampleInPlaceManualSave()"; | ||
} | ||
|
||
Edit : ERXWOTemplate { | ||
templateName = "edit"; | ||
} | ||
|
||
EditManual : ERXWOTemplate { | ||
templateName = "edit"; | ||
} | ||
|
||
ExampleInPlace : MTAjaxInPlace { | ||
cancelAction = valueCancelled; | ||
cancelClass = "btn btn-inverse"; | ||
formClass = "well form-inline"; | ||
saveClass = "btn btn-primary"; | ||
saveAction = valueSaved; | ||
} | ||
|
||
ExampleInPlaceManual : MTAjaxInPlace { | ||
cancelAction = valueCancelled; | ||
id = "ExampleInPlaceManual"; | ||
manualControl = true; | ||
saveAction = valueSaved; | ||
} | ||
|
||
FancyCancel : AjaxFunctionLink { | ||
class = "btn"; | ||
onclick = "fancyCancel()"; | ||
} | ||
|
||
FancyEdit : ERXWOTemplate { | ||
templateName = "edit"; | ||
} | ||
|
||
FancyInPlace : MTAjaxInPlace { | ||
formClass = "well"; | ||
id = "fancy"; | ||
manualEditControl = true; | ||
} | ||
|
||
FancySave : MTAjaxSubmitButton { | ||
class = "btn btn-primary"; | ||
onClick = "fancySave()"; | ||
value = "save"; | ||
} | ||
|
||
FancyView : ERXWOTemplate { | ||
templateName = "view"; | ||
} | ||
|
||
FirstName : WOString { | ||
value = firstName; | ||
} | ||
|
||
FirstNameField : WOTextField { | ||
class = "span3"; | ||
id = "firstName"; | ||
value = firstName; | ||
} | ||
|
||
LastName : WOString { | ||
value = lastName; | ||
} | ||
|
||
LastNameField : WOTextField { | ||
class = "span3"; | ||
id = "lastName"; | ||
value = lastName; | ||
} | ||
|
||
ManualValue : WOString { | ||
value = manualValue; | ||
} | ||
|
||
ManualValueField : WOTextField { | ||
value = manualValue; | ||
size = "30"; | ||
} | ||
|
||
PhoneNumber : WOString { | ||
value = phoneNumber; | ||
} | ||
|
||
PhoneNumberField : WOTextField { | ||
class = "span3"; | ||
id = "phoneNumber"; | ||
value = phoneNumber; | ||
} | ||
|
||
Value : WOString { | ||
value = value; | ||
} | ||
|
||
ValueField : WOTextField { | ||
id = "valueField"; | ||
onEnter = "alert('You hit enter and I am showing you an onEnter handler now.')"; | ||
selectAll = true; | ||
value = value; | ||
} | ||
|
||
View : ERXWOTemplate { | ||
templateName = "view"; | ||
} | ||
|
||
ViewManual : ERXWOTemplate { | ||
templateName = "view"; | ||
} |
4 changes: 4 additions & 0 deletions
4
Examples/Ajax/MooToolsExample/Components/MTAjaxInPlaceTestPage.wo/MTAjaxInPlaceTestPage.woo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"WebObjects Release" = "WebObjects 5.0"; | ||
encoding = "UTF-8"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...ax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxInPlaceTestPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package er.ajax.mootools.example.components; | ||
|
||
import com.webobjects.appserver.WOActionResults; | ||
import com.webobjects.appserver.WOContext; | ||
|
||
public class MTAjaxInPlaceTestPage extends Main { | ||
|
||
public String _manualValue; | ||
public String _value; | ||
public String _firstName; | ||
public String _lastName; | ||
public String _phoneNumber; | ||
|
||
public MTAjaxInPlaceTestPage(WOContext context) { | ||
super(context); | ||
_value = "ExampleInPlace Value"; | ||
_manualValue = "ExampleInPlaceManual Value"; | ||
_firstName = "Johnny"; | ||
_lastName = "Ajax"; | ||
_phoneNumber = "800-555-1212"; | ||
} | ||
|
||
public WOActionResults valueSaved() { | ||
System.out.println("InPlaceExample.valueSaved: saved!"); | ||
return null; | ||
} | ||
|
||
public WOActionResults valueCancelled() { | ||
System.out.println("InPlaceExample.valueCancelled: cancelled!"); | ||
return null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<wodefinitions> | ||
<wo class="MTAjaxInPlace" wocomponentcontent="true"> <binding name="button"/> | ||
<binding name="cancelAction"/> | ||
<binding name="cancelClass"/> | ||
<binding name="cancelLabel"/> | ||
<binding name="canEdit"/> | ||
<binding name="cancelUpdateContainerID"/> | ||
<binding name="canSave"/> | ||
<binding name="class"/> | ||
<binding name="disabled"/> | ||
<binding name="editAction"/> | ||
<binding name="editClass"/> | ||
<binding name="editing"/> | ||
<binding name="editOnly"/> | ||
<binding name="elementName"/> | ||
<binding name="formSerializer"/> | ||
<binding name="id"/> | ||
<binding name="manualControl"/> | ||
<binding name="manualEditControl"/> | ||
<binding name="manualViewControl"/> | ||
<binding name="onCancelClick"/> | ||
<binding name="onCancelFailure"/> | ||
<binding name="onCancelling"/> | ||
<binding name="onCancelSuccess"/> | ||
<binding name="onEditClick"/> | ||
<binding name="onEditFailure"/> | ||
<binding name="onEditing"/> | ||
<binding name="onEditSuccess"/> | ||
<binding name="onRefreshComplete"/> | ||
<binding name="onSaveClick"/> | ||
<binding name="onSaveFailure"/> | ||
<binding name="onSaveSuccess"/> | ||
<binding name="onSaving"/> | ||
<binding name="onSubmit"/> | ||
<binding name="saveAction"/> | ||
<binding name="saveClass"/> | ||
<binding name="saveLabel"/> | ||
<binding name="saveUpdateContainerID"/> | ||
<binding name="style"/> | ||
<binding name="submitOnSave"/> | ||
<binding name="formClass"/> | ||
</wo> | ||
</wodefinitions> |
46 changes: 46 additions & 0 deletions
46
Frameworks/Ajax/MooTools/Components/MTAjaxInPlace.wo/MTAjaxInPlace.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<webobject name = "UpdateContainer"> | ||
<webobject name = "IsNotEditingConditional"> | ||
<webobject name = "IsChangingToViewConditional"> | ||
<webobject name = "ScriptContainer"> | ||
MTAIP.cleanupEdit('<webobject name = "ID" />'); | ||
</webobject> | ||
</webobject> | ||
<webobject name = "EditFunction"></webobject> | ||
<webobject name = "ManualViewControlConditional"> | ||
<webobject name = "ViewComponent"></webobject> | ||
</webobject> | ||
<webobject name = "NotManualViewControlConditional"> | ||
<webobject name = "EditAction"><webobject name = "ViewComponent" /></webobject> | ||
</webobject> | ||
</webobject> | ||
<webobject name = "IsEditingConditional"> | ||
<webobject name = "EditForm"> | ||
<webobject name = "EditComponent" /> | ||
<webobject name = "IsChangingToEditConditional"> | ||
<webobject name = "ScriptContainer"> | ||
MTAIP.cleanupView('<webobject name = "ID"></webobject>'); | ||
</webobject> | ||
</webobject> | ||
<webobject name = "SubmitOnSaveConditional"> | ||
<webobject name = "SaveSubmitFunction"></webobject> | ||
</webobject> | ||
<webobject name = "LinkOnSaveConditional"> | ||
<webobject name = "SaveLinkFunction"></webobject> | ||
</webobject> | ||
<webobject name = "CancelFunction"></webobject> | ||
<webobject name = "NotManualEditControlConditional"> | ||
<webobject name = "ButtonConditional"> | ||
<webobject name = "SaveButtonAction"></webobject> | ||
</webobject> | ||
<webobject name = "LinkConditional"> | ||
<webobject name = "SaveLinkAction"> | ||
<webobject name = "SaveLabel" /> | ||
</webobject> | ||
</webobject> | ||
<webobject name = "CancelAction"> | ||
<webobject name = "CancelLabel"/> | ||
</webobject> | ||
</webobject> | ||
</webobject> | ||
</webobject> | ||
</webobject> |
Oops, something went wrong.