[JBoss JIRA] Created: (RF-4302) Added ShowValueInView attribute to InplaceSelect (see desc for details)
by Greg Zoller (JIRA)
Added ShowValueInView attribute to InplaceSelect (see desc for details)
------------------------------------------------------------------------
Key: RF-4302
URL: https://jira.jboss.org/jira/browse/RF-4302
Project: RichFaces
Issue Type: Patch
Reporter: Greg Zoller
Fix For: 3.2.2
(code mods made to 3.2.2.BETA5)
Have you ever wanted a select widget that would allow for verbose labels in the pull-down but show only the (shorter) value in the input field after the user makes a selection? This is a big deal if you need editable selection fields in a data table or other space-constrained display. Before the addition of this feature you had the option only of seeing labels or values (by not specifying labels in your SelectItems), but not the ability to mix both.
For example I have a table that includes a field holding a code, selectable from an InplaceSelect widget. There's not enough real estate to explain what the code is though. With my new ShowValueInView attribute set true I can show the user verbose, descriptive labels in the pull-down but only the code (the value) when they make their selection. Cool.
I'm not sure how to make an official patch, so here's a list of the modded files (just 3):
inplaceselect.xml -- Added new <property> clause:
<property>
<name>showValueInView</name>
<classname>boolean</classname>
<description>
If true show the SelectItem labels in the InplaceSelect's pull-down list but display the value in the field in view mode once an item is selected
</description>
<defaultvalue>false</defaultvalue>
</property>
inplaceselect.js -- Added 1 'if' statement to ApplyTmpValue:
applyTmpValue : function() {
if (this.comboList.activeItem) {
var userLabel = this.comboList.activeItem.innerHTML.unescapeHTML();
this.currentItemValue = this.comboList.activeItem.value;
if( this.attributes.showValueInView == true ) {
userLabel = this.currentItemValue;
}
this.tempValueKeeper.value = userLabel;
this.comboList.selectedItem = this.comboList.activeItem;
}
},
inplaceselect.jspx -- modifed 2 sections:
(1) -- scriptlet near top of file, added 1 'if' statement:
<jsp:scriptlet>
<![CDATA[
Object value = component.getSubmittedValue();
if(value == null) {
value = component.getAttributes().get("value");
value = getConvertedStringValue(context, component,value);
}
String fieldLabel = getSelectedItemLabel(context, component);
String fieldValue = (String)value;
if( ((Boolean)component.getAttributes().get("showValueInView")).booleanValue() == true ) {
fieldLabel = fieldValue;
}
(2) Around line 218 or so...added showValueInView attribute to list passed to Richfaces.InplaceSelect constructor
new Richfaces.InplaceSelect(new Richfaces.InplaceSelectList('list#{clientId}', 'listParent#{clientId}', true,
Richfaces.InplaceSelect.CLASSES.COMBO_LIST, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', #{this:getItemsTextAsJSArray(context, component,items)}, null,
'#{clientId}inplaceTmpValue', 'shadow#{clientId}', 0, 0, #{encodedFieldValue}),
'#{clientId}', '#{clientId}inplaceTmpValue',
'#{clientId}inplaceValue', '#{clientId}tabber',
{defaultLabel : '#{component.attributes["defaultLabel"]}',
showControls : #{component.attributes["showControls"]},
editEvent : '#{component.attributes["editEvent"]}',
verticalPosition : '#{component.attributes["controlsVerticalPosition"]}',
horizontalPosition : '#{component.attributes["controlsHorizontalPosition"]}',
inputWidth : '#{component.attributes["selectWidth"]}',
minInputWidth : '#{component.attributes["minSelectWidth"]}',
maxInputWidth : '#{component.attributes["maxSelectWidth"]}',
openOnEdit: #{component.attributes["openOnEdit"]},
showValueInView: #{component.attributes["showValueInView"]},
closeOnSelect: true},
{oneditactivation : #{this:getAsEventHandler(context, component, "oneditactivation")},
onviewactivation : #{this:getAsEventHandler(context, component, "onviewactivation")},
oneditactivated : #{this:getAsEventHandler(context, component, "oneditactivated")},
onviewactivated : #{this:getAsEventHandler(context, component, "onviewactivated")},
onchange : #{this:getAsEventHandler(context, component, "onchange")}},
Richfaces.InplaceSelect.CLASSES,
['#{clientId}bar', '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons', '#{clientId}btns_shadow'], '#{clientId}inselArrow');
That's it!
I hope others will find this little tweak as useful as I did. So far I haven't found any other select-type widget that allows this hibrid approach.
My apologies if this isn't the right way to submit code. First time :-)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 2 months
[JBoss JIRA] Created: (RF-3619) org.ajax4jsf.webapp.WebXml doesn't respect namespaces within the web.xml
by Gena Batalski (JIRA)
org.ajax4jsf.webapp.WebXml doesn't respect namespaces within the web.xml
------------------------------------------------------------------------
Key: RF-3619
URL: http://jira.jboss.com/jira/browse/RF-3619
Project: RichFaces
Issue Type: Bug
Affects Versions: 3.2.0, 3.2.0.SR1, 3.2.1, 3.2.2
Environment: richfaces from SVN, SAP Netweaver CE 7.1 JEE
Reporter: Gena Batalski
Hello,
the SAP deployer checks the web.xml for errors and enriches the file with xml namespaces. The deployed file is also correct, but it can not be correctly recognised by org.ajax4jsf.webapp.WebXml. The line
dig.setNamespaceAware(false)
in init(..) method of WebXml prevents richfaces from correct parsing of web.xml in this case. I think, it could be possible to parse both flavour of web.xml, with and without namespaces, also if the usage of namespaced version is unusual.
Setting dig.setNamespaceAware(true) resolved the problem but i didn't test it on a web.xml without namespaces.
Gena
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 2 months
[JBoss JIRA] Created: (RF-961) Drag'n Drop: dragValue is null, when dragging across different regions
by Maksim Kaszynski (JIRA)
Drag'n Drop: dragValue is null, when dragging across different regions
----------------------------------------------------------------------
Key: RF-961
URL: http://jira.jboss.com/jira/browse/RF-961
Project: RichFaces
Issue Type: Bug
Affects Versions: 3.1.0
Reporter: Maksim Kaszynski
Assigned To: Maksim Kaszynski
Fix For: 3.2.0
On the following page, dragValue is null.
In terms of JSF concepts, everything is correct - other regions just don't get processed.
maybe, we should hack it in some way.
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/drag-drop" prefix="rich"%>
<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/panel" prefix="p"%>
<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/dataTable" prefix="t"%>
<html>
<head>
</head>
<body>
<f:view>
<center><rich:dragIndicator id="indicator"></rich:dragIndicator>
<h:form>
<h:panelGrid styleClass="generalTable">
<a4j:region>
<p:panel>
<t:dataTable id="iItems" value="#{PjCreationDataBean.initItems}" var="item">
<t:column>
<a4j:outputPanel style="border:1px;">
<rich:dragSupport dragType="item" dragIndicator=":indicator"
dragValue="#{item}">
<rich:dndParam name="label" value="#{item.item}" />
</rich:dragSupport>
<h:outputText value="#{item.item}" />
</a4j:outputPanel>
</t:column>
</t:dataTable>
</p:panel>
</a4j:region>
<a4j:region>
<p:panel>
<rich:dropSupport acceptedTypes="item"
dropListener="#{WeaponDropListener.processDrop}"
dropValue="#{PjCreationDataBean.selectedItems}" reRender="sItems">
</rich:dropSupport>
<t:dataTable id="sItems"
value="#{PjCreationDataBean.selectedItems}" var="item">
<t:column>
<a4j:outputPanel style="border:1px;">
<h:outputText value="#{item.item}" />
</a4j:outputPanel>
</t:column>
</t:dataTable>
</p:panel>
</a4j:region>
</h:panelGrid>
<center>
</h:form>
</f:view>
</body>
</html>
public class WeaponDropListener implements DropListener{
public void processDrop(DropEvent event) {
Dropzone dropZone = (Dropzone) event.getComponent();
ArrayList<InitItem> selected = (ArrayList) dropZone.getDropValue();
System.err.print(selected.size());
Object ob = event.getDragValue();
System.out.println("DragValue " + event.getDragValue());
System.out.println("DropValue " + event.getDropValue());
if(ob == null)
System.err.print("objeto nulo");
selected.add((InitItem) event.getDragValue());
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 2 months
[JBoss JIRA] Created: (RF-3670) Modal Panel preventFocus JS function slow
by Tom Tamulewicz (JIRA)
Modal Panel preventFocus JS function slow
-----------------------------------------
Key: RF-3670
URL: http://jira.jboss.com/jira/browse/RF-3670
Project: RichFaces
Issue Type: Bug
Affects Versions: 3.1.5
Environment: Windows XP, Sun RI 1.2
Reporter: Tom Tamulewicz
I have a page with a 500 row table. Each row has a "delete" link that brings up a modal panel. The modal panel takes 4-5 seconds (with CPU spiked) to appear under MSIE 6 or 7. The time it takes to show up is proportional to how many rows in the table. If I have a small number, the modal panel shows quickly. The problem appears to be due to slowness in the modalPanel.js preventFocus() function, which is called from the show() function.
My test page wasn't very complicated, with a bean providing a list of 500 objects.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
<body>
<!-- The text above will not be rendered. -->
<ui:composition>
<h:form id="testForm">
<rich:modalPanel id="confirmModal" height="200" width="425" zindex="2000" resizeable="false">
<table width="100%">
<tr>
<td align="center" colspan="3">
<h:commandButton id="yes" value="yes"/>
</td>
<td align="center" colspan="3">
<h:commandButton id="no" value="no"/>
</td>
</tr>
</table>
</rich:modalPanel>
<rich:dataTable id="testTable" value="#{testList.dataList}" var="element">
<rich:column>
<h:outputText value='#{element.index}' />
</rich:column>
<rich:column>
<h:outputText value='#{element.name}' />
</rich:column>
<rich:column id="deleteObjectColumn" width="10%" sortable="false">
<a4j:commandLink value="delete" id="commandDialogLink"
onclick="Richfaces.showModalPanel('confirmModal',{width:425, top:200});"/>
</rich:column>
</rich:dataTable>
</h:form>
</ui:composition>
<!-- The text below will not be rendered. -->
</body>
</html>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 2 months