This page (revision-6) was last changed on 17-Dec-2010 13:24 by Dieter Käppel

This page was created on 22-Oct-2010 16:11 by Dieter Käppel

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
6 17-Dec-2010 13:24 3 KB Dieter Käppel to previous
5 17-Dec-2010 13:24 3 KB Dieter Käppel to previous | to last
4 16-Dec-2010 16:50 3 KB Dieter Käppel to previous | to last
3 04-Nov-2010 16:02 3 KB Dieter Käppel to previous | to last
2 02-Nov-2010 18:43 1 KB Dieter Käppel to previous | to last
1 22-Oct-2010 16:11 630 bytes Dieter Käppel to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 54 added 103 lines
!Paging DataModel für DataTable
{{{
public class PageableDataModel extends SerializableDataModel {
private Long rowKey;
@Override
public Long getRowKey() {
return rowKey;
}
@Override
public void setRowKey(Object key) {
this.rowKey = (Long)key;
}
@Override
public int getRowIndex() {
return 0;
}
@Override
public void setRowIndex(int rowIndex) {
}
@Override
public Object getWrappedData() {
throw new UnsupportedOperationException();
}
@Override
public void setWrappedData(Object data) {
throw new UnsupportedOperationException();
}
@Override
public int getRowCount() {
return backend.size();
}
@Override
public Object getRowData() {
if (rowKey == null)
return null;
return backend.get(rowKey);
}
@Override
public boolean isRowAvailable() {
return backend.containsKey(rowKey);
}
@Override
public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) throws IOException {
SequenceRange sequenceRange = (SequenceRange)range;
int firstRow = sequenceRange.getFirstRow();
int toIndex = sequenceRange.getFirstRow() + sequenceRange.getRows();
for (int index = firstRow; index < toIndex; ++index) {
Data data = backend.get(index);
visitor.process(context, data.getKey(), argument);
}
}
@Override
public void update() {
}
@Override
public SerializableDataModel getSerializableModel(Range range) {
return this;
}
}
}}}
!Validierung prüfen bei Ajax-Submit im Modal-Panel
Facelet:
{{{
<rich:modalPanel id="modalPanel">
<h:form id="form">
<h:inputText value="#{bean.value}"/>
...
<a4j:commandButton value="Submit"
oncomplete="if (#{i:validated()}) Richfaces.hideModalPanel('modalPanel');"
</h:form>
</rich:modalPanel>
}}}
Funktion:
{{{
public static boolean validated() {
Severity severity = FacesContext.getCurrentInstance().getMaximumSeverity();
return severity == null || severity == FacesMessage.SEVERITY_INFO;
}
}}}
intersult.taglib.xml:
{{{
<function>
<function-name>validated</function-name>
<function-class>com.intersult.Functions</function-class>
<function-signature>boolean validated()</function-signature>
</function>
}}}
!Aktuelle Table Page merken
{{{
<rich:dataScroller page="#{bean.page}"/>
}}}