JBoss Rich Faces SVN: r11463 - in trunk/test-applications: jsp/src/main/webapp/InplaceSelect and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tromanovich
Date: 2008-12-01 11:52:48 -0500 (Mon, 01 Dec 2008)
New Revision: 11463
Modified:
trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelectProperty.xhtml
trunk/test-applications/jsp/src/main/webapp/InplaceSelect/InplaceSelectProperty.jsp
Log:
setValue for inplaceSelect changing
Modified: trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelectProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelectProperty.xhtml 2008-12-01 16:52:22 UTC (rev 11462)
+++ trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelectProperty.xhtml 2008-12-01 16:52:48 UTC (rev 11463)
@@ -105,8 +105,8 @@
value="getValue"></a4j:commandLink>
<br />
<a4j:commandLink
- onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.setValue('passeds','passeds')"
- value="setValue('passeds','passeds')"></a4j:commandLink>
+ onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.setValue(event,{itemLabel:'passeds', itemValue:'passeds'})"
+ value="setValue(e,{params})"></a4j:commandLink>
<br />
<br />
<div style="FONT-WEIGHT: bold;">rich:findComponent</div>
Modified: trunk/test-applications/jsp/src/main/webapp/InplaceSelect/InplaceSelectProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/InplaceSelect/InplaceSelectProperty.jsp 2008-12-01 16:52:22 UTC (rev 11462)
+++ trunk/test-applications/jsp/src/main/webapp/InplaceSelect/InplaceSelectProperty.jsp 2008-12-01 16:52:48 UTC (rev 11463)
@@ -106,8 +106,8 @@
value="getValue"></a4j:commandLink>
<br />
<a4j:commandLink
- onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.setValue('passeds','passeds')"
- value="setValue"></a4j:commandLink>
+ onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.setValue(event,{itemLabel:'passeds', itemValue:'passeds'})"
+ value="setValue(e,{params})"></a4j:commandLink>
<br />
<f:verbatim>
@@ -136,8 +136,8 @@
</rich:componentControl>
<rich:componentControl attachTo="setValueID" event="onclick"
for="inplaceSelectID" operation="setValue">
- <f:param name="value" value="passeds"/>
- <f:param name="label" value="passeds"/>
+ <f:param name="itemValue" value="passeds"/>
+ <f:param name="itemLabel" value="passeds"/>
</rich:componentControl>
<br />
<br />
15 years, 5 months
JBoss Rich Faces SVN: r11462 - trunk/ui/pickList/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-12-01 11:52:22 -0500 (Mon, 01 Dec 2008)
New Revision: 11462
Modified:
trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java
Log:
add log message if can't find bundle properties files
Modified: trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java
===================================================================
--- trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java 2008-12-01 16:49:40 UTC (rev 11461)
+++ trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java 2008-12-01 16:52:22 UTC (rev 11462)
@@ -53,6 +53,8 @@
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.ajax4jsf.util.SelectUtils;
import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.richfaces.component.UIPickList;
import org.richfaces.component.util.HtmlUtil;
import org.richfaces.utils.PickListUtils;
@@ -60,6 +62,7 @@
public class PickListRenderer extends HeaderResourcesRendererBase {
private static final String HIDDEN_SUFFIX = "valueKeeper";
+ private static Log logger = LogFactory.getLog(PickListRenderer.class);
protected static final OrderingComponentRendererBase.ControlsHelper[] SHUTTLE_HELPERS = PickListControlsHelper.HELPERS;
protected final static String SHOW_LABELS_ATTRIBUTE_NAME = "showButtonsLabel";
private static final String MESSAGE_BUNDLE_NAME = PickListRenderer.class.getPackage().getName() + ".pickList";
@@ -378,25 +381,33 @@
locale = Locale.getDefault();
}
- try {
- if( null != (userBundleName = context.getApplication().getMessageBundle())) {
- bundle = ResourceBundle.getBundle(userBundleName,locale, getCurrentLoader(userBundleName));
- if (bundle != null) {
- label = bundle.getString(propertyId);
- }
- }
- } catch (MissingResourceException e) {
- }
-
- if(label == null && bundleName != null) {
- try {
- bundle = ResourceBundle.getBundle(bundleName ,locale, getCurrentLoader(bundleName));
- if (bundle != null) {
- label = bundle.getString(propertyId);
- }
- } catch (MissingResourceException e) {
- }
- }
+ if(locale != null) {
+ try {
+ if( null != (userBundleName = context.getApplication().getMessageBundle())) {
+ bundle = ResourceBundle.getBundle(userBundleName,locale, getCurrentLoader(userBundleName));
+ if (bundle != null) {
+ label = bundle.getString(propertyId);
+ }
+ }
+ } catch (MissingResourceException e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Can't find bundle properties file " + userBundleName + " " + locale.getLanguage() + " " + locale.getCountry()) ;
+ }
+ }
+ if(label == null && bundleName != null) {
+ try {
+ bundle = ResourceBundle.getBundle(bundleName ,locale, getCurrentLoader(bundleName));
+ if (bundle != null) {
+ label = bundle.getString(propertyId);
+ }
+ } catch (MissingResourceException e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Can't find bundle properties file " + bundleName + " " + locale.getLanguage() + " " + locale.getCountry()) ;
+ }
+
+ }
+ }
+ }
return label;
}
15 years, 5 months
JBoss Rich Faces SVN: r11461 - trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2008-12-01 11:49:40 -0500 (Mon, 01 Dec 2008)
New Revision: 11461
Modified:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
Log:
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-01 16:45:22 UTC (rev 11460)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-01 16:49:40 UTC (rev 11461)
@@ -67,7 +67,7 @@
em.merge(image);
if(parentChanged){
image.getAlbum().removeImage(image);
- Album album = (Album)em.createQuery("from Album a where a.name=:albumName and a.owner = : owner").setParameter("albumName", image.getAlbumName()).setParameter("owner", image.getAlbum().getOwner().getLogin()).getSingleResult();
+ Album album = (Album)em.createQuery("from Album a where a.name=:albumName and a.owner=:owner").setParameter("albumName", image.getAlbumName()).setParameter("owner", image.getAlbum().getOwner().getLogin()).getSingleResult();
album.addImage(image);
em.merge(album);
}
15 years, 5 months
JBoss Rich Faces SVN: r11460 - in trunk/test-applications/realworld: ejb/src/main/java/org/richfaces/realworld/service and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2008-12-01 11:45:22 -0500 (Mon, 01 Dec 2008)
New Revision: 11460
Modified:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Comment.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
trunk/test-applications/realworld/ejb/src/main/resources/import.sql
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/addComment.xhtml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/imagePrefs.xhtml
trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
trunk/test-applications/realworld/web/src/main/webapp/tree.xhtml
trunk/test-applications/realworld/web/src/main/webapp/userPrefs.xhtml
Log:
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2008-12-01 16:44:45 UTC (rev 11459)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2008-12-01 16:45:22 UTC (rev 11460)
@@ -278,4 +278,13 @@
public void setSharedOwners(List<User> sharedOwners) {
this.sharedOwners = sharedOwners;
}
+
+ public int getIndex(Image image) {
+ for(int i =0; i < this.images.size(); i++){
+ if(this.images.get(i).equals(image)){
+ return i;
+ }
+ }
+ return -1;
+ }
}
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Comment.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Comment.java 2008-12-01 16:44:45 UTC (rev 11459)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Comment.java 2008-12-01 16:45:22 UTC (rev 11460)
@@ -18,10 +18,13 @@
import org.hibernate.validator.Length;
import org.hibernate.validator.NotEmpty;
import org.hibernate.validator.NotNull;
+import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
@Entity
@Name("comment")
+(a)Scope(ScopeType.PAGE)
@Table(name = "comments")
public class Comment implements Serializable{
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java 2008-12-01 16:44:45 UTC (rev 11459)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java 2008-12-01 16:45:22 UTC (rev 11460)
@@ -36,4 +36,6 @@
public void addComment(Comment comment);
+ public abstract void editComment(Comment comment);
+
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-01 16:44:45 UTC (rev 11459)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-01 16:45:22 UTC (rev 11460)
@@ -67,7 +67,7 @@
em.merge(image);
if(parentChanged){
image.getAlbum().removeImage(image);
- Album album = (Album)em.createQuery("from Album a where a.name=:albumName").setParameter("albumName", image.getAlbumName()).getSingleResult();
+ Album album = (Album)em.createQuery("from Album a where a.name=:albumName and a.owner = : owner").setParameter("albumName", image.getAlbumName()).setParameter("owner", image.getAlbum().getOwner().getLogin()).getSingleResult();
album.addImage(image);
em.merge(album);
}
@@ -85,6 +85,12 @@
}
public void addComment(Comment comment){
-
+ comment.getImage().addComment(comment);
+ em.flush();
}
+
+ public void editComment(Comment comment) {
+ em.merge(comment);
+ em.flush();
+ }
}
Modified: trunk/test-applications/realworld/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-12-01 16:44:45 UTC (rev 11459)
+++ trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-12-01 16:45:22 UTC (rev 11460)
@@ -1,6 +1,6 @@
-INSERT INTO Users(user_id, obj_version, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (1, 0, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.gif', 'amarkhel', '12345', '1985-01-08');
-INSERT INTO Users(user_id, obj_version, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (2, 0, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.gif', 'root', '12345', '1985-01-08');
-INSERT INTO Users(user_id, obj_version, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (3, 0, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.gif', 'qqqq', '12345', '1985-01-08');
+INSERT INTO Users(user_id, obj_version, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (1, 0, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.jpg', 'amarkhel', '12345', '1985-01-08');
+INSERT INTO Users(user_id, obj_version, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (2, 0, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.jpg', 'root', '12345', '1985-01-08');
+INSERT INTO Users(user_id, obj_version, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (3, 0, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.jpg', 'qqqq', '12345', '1985-01-08');
INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (1, 0, 'Album 1', 'Simple Album', true, 1);
INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (2, 0, 'Album 2', 'Simple Album 2', false, 1);
INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (3, 0, 'Album 3', 'Simple Album 3', false, 1);
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-01 16:44:45 UTC (rev 11459)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-01 16:45:22 UTC (rev 11460)
@@ -1,5 +1,7 @@
package org.richfaces.realworld.tree;
+import java.util.Date;
+
import javax.faces.model.SelectItem;
import org.jboss.seam.ScopeType;
@@ -8,6 +10,7 @@
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Comment;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.fileupload.FileManager;
@@ -118,4 +121,21 @@
treeSelectionManager.setSelectedImage(imageItem.getImage());
treeSelectionManager.setSelectedAlbum(albumItem.getAlbum());
}
+
+ public void editComment(Comment comment) {
+ imageAction.editComment(comment);
+ }
+
+ public void addComment(Comment comment) {
+ imageAction.addComment(comment);
+ }
+
+ public void addAutoComment(User user, Image image) {
+ Comment comment = new Comment();
+ comment.setAuthor(user);
+ comment.setDate(new Date());
+ comment.setImage(image);
+ comment.setMessage("+1");
+ imageAction.addComment(comment);
+ }
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java 2008-12-01 16:44:45 UTC (rev 11459)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java 2008-12-01 16:45:22 UTC (rev 11460)
@@ -12,6 +12,11 @@
import java.util.List;
import java.util.Map;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.model.SelectItem;
+import javax.faces.model.SelectItemGroup;
import javax.imageio.ImageIO;
import org.ajax4jsf.context.AjaxContext;
@@ -21,6 +26,8 @@
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Synchronized;
+import org.richfaces.component.UIDataTable;
+import org.richfaces.component.UIDatascroller;
import org.richfaces.component.UIDragSupport;
import org.richfaces.component.UITree;
import org.richfaces.component.UITreeNode;
@@ -41,6 +48,8 @@
@Scope(ScopeType.SESSION)
public class TreeSelectionManager {
+ private static final FacesContext FacesContext = null;
+
@In
private User user;
@@ -50,8 +59,13 @@
private Album selectedAlbum;
+ private int selectedImageIndex = 1;
+
@In(create=true)
FileManager fileManager;
+
+ @In(create=true)
+ TreeActionManager treeActionManager;
private String nodeTitle;
@@ -75,19 +89,23 @@
for(int index = 0 ; index < images.size(); index++){
if(images.get(index) == this.getSelectedImage()){
this.setSelectedImage(images.get(index - 1));
+ this.setSelectedImageIndex(index);
}
}
} else if (event.getNewScrolVal().equals("last")) {
this.setSelectedImage(images.get(images.size() - 1));
+ this.setSelectedImageIndex(images.size());
} else if (event.getNewScrolVal().equals("next")) {
for(int index = 0 ; index < images.size(); index++){
if(images.get(index) == this.getSelectedImage()){
this.setSelectedImage(images.get(index + 1));
+ this.setSelectedImageIndex(index + 2);
return;
}
}
} else if (event.getNewScrolVal().equals("first")) {
this.setSelectedImage(images.get(0));
+ this.setSelectedImageIndex(1);
}
}
@@ -118,6 +136,60 @@
}
}
+ public synchronized void paintAvatar(OutputStream out, Object data) throws IOException{
+ if (null == data) {
+ return;
+ }
+ File imageResource = fileManager.getImage(user.getLogin() + fileManager.getFileSeparator() + "avatars" + fileManager.getFileSeparator() + data.toString());
+ if (imageResource != null) {
+ FileInputStream fileInputStream = new FileInputStream(imageResource);
+ BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
+ InputStream paintData = bufferedInputStream;
+ if (null == paintData) {
+ // throw new Exception("");
+ // TODO
+ }
+ try{
+ BufferedImage image = ImageIO.read(paintData);
+ ImageIO.write(image, "jpeg", out);
+ }catch(Exception e){
+
+ }finally{
+ fileInputStream.close();
+ bufferedInputStream.close();
+ paintData.close();
+ }
+ }
+ }
+
+ public synchronized void paintFriendAvatar(OutputStream out, Object data) throws IOException{
+ if (null == data) {
+ return;
+ }
+ String temp = data.toString();
+ String[] array = temp.split(":");
+ File imageResource = fileManager.getImage(array[0] + fileManager.getFileSeparator() + "avatars" + fileManager.getFileSeparator() + array[1]);
+ if (imageResource != null) {
+ FileInputStream fileInputStream = new FileInputStream(imageResource);
+ BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
+ InputStream paintData = bufferedInputStream;
+ if (null == paintData) {
+ // throw new Exception("");
+ // TODO
+ }
+ try{
+ BufferedImage image = ImageIO.read(paintData);
+ ImageIO.write(image, "jpeg", out);
+ }catch(Exception e){
+
+ }finally{
+ fileInputStream.close();
+ bufferedInputStream.close();
+ paintData.close();
+ }
+ }
+ }
+
public void dropListener(DropEvent dropEvent) {
// resolve drag destination attributes
@@ -125,7 +197,7 @@
UITree destTree = destNode != null ? destNode.getUITree() : null;
TreeRowKey dropNodeKey = (dropEvent.getDropValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent.getDropValue() : null;
TreeNode droppedInNode = dropNodeKey != null ? destTree.getTreeNode(dropNodeKey) : null;
-
+
// resolve drag source attributes
UITreeNode srcNode = (dropEvent.getDraggableSource() instanceof UITreeNode) ? (UITreeNode) dropEvent.getDraggableSource() : null;
UITree srcTree = srcNode != null ? srcNode.getUITree() : null;
@@ -175,6 +247,9 @@
AjaxContext ac = AjaxContext.getCurrentInstance();
ac.addRenderedArea("mainform:imageList");
+ Image draggedImage = ((TreeImageItem)draggedNode).getImage();
+ draggedImage.setAlbumName(((TreeAlbumItem)droppedInNode).getAlbum().getName());
+ treeActionManager.editImage(draggedImage);
// Add destination tree to reRender
try {
ac.addComponentToAjaxRender(destTree);
@@ -263,13 +338,18 @@
}
TreeNode<String> currentNode = tree.getModelTreeNode(tree.getRowKey());
if(currentNode instanceof TreeImageItem){
- this.setSelectedImage(((TreeImageItem)currentNode).getImage());
- if(((TreeAlbumItem)currentNode.getParent()).getAlbum() != this.getSelectedAlbum()){
- this.setSelectedAlbum(((TreeAlbumItem)currentNode.getParent()).getAlbum());
+ Image image = ((TreeImageItem)currentNode).getImage();
+ this.setSelectedImage(image);
+ Album album = ((TreeAlbumItem)currentNode.getParent()).getAlbum();
+ if(album != this.getSelectedAlbum()){
+ this.setSelectedAlbum(album);
}
+ int index = album.getIndex(image);
+ setDataScrollerIndex(index);
return;
}else if(currentNode instanceof TreeAlbumItem){
TreeAlbumItem node = (TreeAlbumItem)currentNode;
+ setDataScrollerIndex(0);
if (node.isLeaf()) {
this.setSelectedImage(null);
Album album = node.getAlbum();
@@ -285,6 +365,17 @@
}
}
+ public void updateScroller(ActionEvent event){
+ this.setDataScrollerIndex(this.selectedImageIndex - 1);
+ }
+
+ private void setDataScrollerIndex(int index) {
+ UIComponent component = FacesContext.getCurrentInstance().getViewRoot();
+ UIDatascroller scroller = (UIDatascroller)component.findComponent("mainform:sc1");
+ scroller.setPage(index+1);
+ this.setSelectedImageIndex(index+1);
+ }
+
public String getNodeTitle() {
return nodeTitle;
}
@@ -300,4 +391,20 @@
public void setMainArea(NavigationEnum mainArea) {
this.mainArea = mainArea;
}
+
+ public int getSelectedImageIndex() {
+ return selectedImageIndex;
+ }
+
+ public void setSelectedImageIndex(int selectedImageIndex) {
+ this.selectedImageIndex = selectedImageIndex;
+ }
+
+ public SelectItem[] getAvailableIndexOfImages(){
+ SelectItem[] group = new SelectItem[this.getSelectedAlbum().getImages().size()];
+ for(int i = 0; i < this.getSelectedAlbum().getImages().size(); i++){
+ group[i] = new SelectItem(i+1);
+ }
+ return group;
+ }
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java 2008-12-01 16:44:45 UTC (rev 11459)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java 2008-12-01 16:45:22 UTC (rev 11460)
@@ -1,5 +1,7 @@
package org.richfaces.realworld.util;
+import java.util.Date;
+
import javax.faces.event.ActionEvent;
import org.jboss.seam.ScopeType;
@@ -8,7 +10,9 @@
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Comment;
import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.tree.TreeActionManager;
@Name("modalPanelHelper")
@@ -28,6 +32,9 @@
@In(create=true, required=true)
private TreeActionManager treeActionManager;
+ @In(create=true, required=true) @Out
+ private Comment comment;
+
public String getCaption() {
return caption;
}
@@ -64,6 +71,19 @@
}
}
+ public void initModalPanelData( String actionName, String caption, Comment comment, User user, Image image){
+ this.caption = caption;
+ this.actionName = actionName;
+ if(null != comment){
+ this.comment = comment;
+ }else{
+ this.comment = new Comment();
+ this.comment.setAuthor(user);
+ this.comment.setImage(image);
+ this.comment.setDate(new Date());
+ }
+ }
+
public void addAlbum(ActionEvent event){
treeActionManager.addAlbum();
}
@@ -80,6 +100,14 @@
treeActionManager.deleteImage(this.image);
}
+ public void editComment(ActionEvent event){
+ treeActionManager.editComment(this.comment);
+ }
+
+ public void addComment(ActionEvent event){
+ treeActionManager.addComment(this.comment);
+ }
+
public void editImage(ActionEvent event){
treeActionManager.editImage(this.image);
}
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml 2008-12-01 16:44:45 UTC (rev 11459)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml 2008-12-01 16:45:22 UTC (rev 11460)
@@ -16,4 +16,8 @@
<tag-name>imagePrefs</tag-name>
<source>templates/imagePrefs.xhtml</source>
</tag>
+ <tag>
+ <tag-name>comment</tag-name>
+ <source>templates/addComment.xhtml</source>
+ </tag>
</facelet-taglib>
\ No newline at end of file
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/addComment.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/imagePrefs.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/tree.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/userPrefs.xhtml
===================================================================
(Binary files differ)
15 years, 5 months
JBoss Rich Faces SVN: r11459 - trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-01 11:44:45 -0500 (Mon, 01 Dec 2008)
New Revision: 11459
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
https://jira.jboss.org/jira/browse/RF-4805
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-12-01 15:55:41 UTC (rev 11458)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-12-01 16:44:45 UTC (rev 11459)
@@ -1914,7 +1914,7 @@
var d = new Date(this.selectedDate);
if (d.getMonth()==this.currentDate.getMonth() && d.getFullYear()==this.currentDate.getFullYear())
{
- if (!oldSelectedDate || oldSelectedDate.getDate()!=d.getDate())
+ if (!oldSelectedDate || (oldSelectedDate - this.selectedDate))
{
// find cell and change style class
var e = $(this.DATE_ELEMENT_ID+(this.firstDateIndex + this.selectedDate.getDate()-1));
15 years, 5 months
JBoss Rich Faces SVN: r11458 - trunk/ui/core/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-01 10:55:41 -0500 (Mon, 01 Dec 2008)
New Revision: 11458
Modified:
trunk/ui/core/src/main/config/component/queue.xml
Log:
https://jira.jboss.org/jira/browse/RF-5052
Modified: trunk/ui/core/src/main/config/component/queue.xml
===================================================================
--- trunk/ui/core/src/main/config/component/queue.xml 2008-12-01 15:03:09 UTC (rev 11457)
+++ trunk/ui/core/src/main/config/component/queue.xml 2008-12-01 15:55:41 UTC (rev 11458)
@@ -25,6 +25,9 @@
<classname>org.ajax4jsf.taglib.html.facelets.QueueHandler</classname>
</taghandler>
-->
+
+ &ui_component_attributes;
+
<property>
<name>size</name>
<classname>int</classname>
15 years, 5 months
JBoss Rich Faces SVN: r11457 - trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-01 10:03:09 -0500 (Mon, 01 Dec 2008)
New Revision: 11457
Modified:
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
Log:
small fix
Modified: trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2008-12-01 14:11:20 UTC (rev 11456)
+++ trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2008-12-01 15:03:09 UTC (rev 11457)
@@ -141,7 +141,7 @@
getEventTargetRow : function(event) {
var activeElem;
- if (event.rangeParent) {
+ if (event.target) {
//activeElem = event.rangeParent.parentNode;
activeElem = event.target;
} else {
15 years, 5 months
JBoss Rich Faces SVN: r11456 - in trunk/ui/combobox/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-01 09:11:20 -0500 (Mon, 01 Dec 2008)
New Revision: 11456
Modified:
trunk/ui/combobox/src/main/config/component/combobox.xml
trunk/ui/combobox/src/main/templates/combobox.jspx
Log:
https://jira.jboss.org/jira/browse/RF-3284
Modified: trunk/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- trunk/ui/combobox/src/main/config/component/combobox.xml 2008-12-01 12:37:22 UTC (rev 11455)
+++ trunk/ui/combobox/src/main/config/component/combobox.xml 2008-12-01 14:11:20 UTC (rev 11456)
@@ -98,6 +98,12 @@
<description></description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
+ <property>
+ <name>onfocus</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
<property>
<name>onlistcall</name>
<classname>java.lang.String</classname>
Modified: trunk/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/ui/combobox/src/main/templates/combobox.jspx 2008-12-01 12:37:22 UTC (rev 11455)
+++ trunk/ui/combobox/src/main/templates/combobox.jspx 2008-12-01 14:11:20 UTC (rev 11456)
@@ -216,6 +216,8 @@
readonly="#{enableManualInput}"
value="#{value}"
x:onblur="#{component.attributes['onblur']}"
+ onfocus = "#{component.attributes['onfocus']}"
+ onchange = "#{component.attributes['onchange']}"
style="width:#{correction}; #{inputInactiveStyle}"
autocomplete="off"
tabindex="#{component.attributes['tabindex']}"
15 years, 5 months
JBoss Rich Faces SVN: r11455 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-12-01 07:37:22 -0500 (Mon, 01 Dec 2008)
New Revision: 11455
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dnd/dndAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java
Log:
RF-5137 - RF-5142
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dnd/dndAutoTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dnd/dndAutoTest.xhtml 2008-12-01 12:31:34 UTC (rev 11454)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dnd/dndAutoTest.xhtml 2008-12-01 12:37:22 UTC (rev 11455)
@@ -23,7 +23,7 @@
<rich:dropSupport id="componentId" acceptedTypes="PHP" dropValue="PHP"
dropListener="#{autoTestBean.actionListener}"
immediate="#{autoTestBean.immediate}"
- ajaxSingle="#{autoTestBean.ajaxSingle}"
+ ajaxSingle="#{autoTestBean.ajaxSingle}"
reRender="#{autoTestBean.reRender}"
limitToList="#{autoTestBean.limitToList}"
bypassUpdates="#{autoTestBean.bypassUpdate}"
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java 2008-12-01 12:31:34 UTC (rev 11454)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java 2008-12-01 12:37:22 UTC (rev 11455)
@@ -53,7 +53,47 @@
return "c:/FFProfile";
}
+
+
@Test
+ public void testExternalValidationFailure(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+
+ tester.testExtrenalValidationFailure();
+ }
+
+
+ @Test
+ public void testImmediateWithInternalValidationFailed(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+
+ tester.testImmediateWithExternalValidationFailed();
+ }
+
+ @Test
+ public void testImmediate(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+
+ tester.testImmediate();
+ }
+
+
+
+ @Test
+ public void testAjaxSingleWithInternalValidationFailed(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+
+ tester.testAjaxSingleWithInternalValidationFailed();
+ }
+
+
+
+
+ @Test
public void testAjaxSingleTrue(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
@@ -61,7 +101,7 @@
tester.testAjaxSingle();
}
- //@Test
+ @Test
public void testOncomplete(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
@@ -69,7 +109,7 @@
tester.testOncomplete();
}
- //@Test
+ @Test
public void testRendered(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -86,7 +126,7 @@
}
- //@Test
+ @Test
public void testDragValue(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -102,7 +142,7 @@
}
- //@Test
+ @Test
public void testDropValue(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -120,7 +160,7 @@
testDropData();
}
- //@Test
+ @Test
public void testListeners(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -136,7 +176,7 @@
}
- //@Test
+ @Test
public void testEvents(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -153,7 +193,7 @@
assertEvents(eventsExpected);
}
- //@Test
+ @Test
public void testListenersIfTypeNotAccepted(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -173,7 +213,7 @@
assertListeners();
}
- //@Test
+ @Test
public void testEventsIfTypeNotAccepted(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -189,7 +229,7 @@
assertEvents(eventsExpected);
}
- // @Test
+ @Test
public void testNestedParameters(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
@@ -197,7 +237,7 @@
tester.testRequestParameters(parameters);
}
- //@Test
+ @Test
public void testByPassUpdate(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
@@ -205,7 +245,7 @@
tester.testBypassUpdate();
}
- //@Test
+ @Test
public void testReRender(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
@@ -213,7 +253,7 @@
tester.testReRender();
}
- //@Test
+ @Test
public void testLimit2List(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
15 years, 5 months
JBoss Rich Faces SVN: r11454 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-12-01 07:31:34 -0500 (Mon, 01 Dec 2008)
New Revision: 11454
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java
Log:
RF-5136
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java 2008-12-01 12:24:40 UTC (rev 11453)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java 2008-12-01 12:31:34 UTC (rev 11454)
@@ -54,6 +54,14 @@
}
@Test
+ public void testAjaxSingleTrue(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+
+ tester.testAjaxSingle();
+ }
+
+ //@Test
public void testOncomplete(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
15 years, 5 months