Kod stranice je ispod:
Code:
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
template="layout/template.xhtml">
<ui:define name="body">
<div id="page">
<div id="content">
<div class="post">
<h1 class="title">TM Project</h1>
<h:form id="tmProject">
<rich:spacer height="22">
<a4j:status>
<f:facet name="start">
<h:graphicImage value="/images/ajax/loading.gif"/>
</f:facet>
</a4j:status>
</rich:spacer>
<rich:panel>
<rich:panel><f:facet name="header">Input section</f:facet>
<h:panelGrid columns="3" cellpadding="7" cellspacing="7" >
<h:outputText value="Role" />
<rich:inplaceSelect value="#{userBean.inputValue}" defaultLabel="Click here to select Role" id="inplaceSelect">
<s:selectItems var="_role" value="#{roleList}" label="#{_role.name}" />
<s:convertEntity/>
<a4j:support event="onviewactivated" reRender="showname" />
</rich:inplaceSelect>
<h:commandLink value="#{msgs.addRole}" action="/members/addRole.seam"/>
<h:outputText value="Duration" />
<h:inputText id="duration" value="#{userBean.duration}">
<f:validateLength minimum="3" maximum="10"/>
<a4j:support event="onkeyup" reRender="outD" />
</h:inputText>
<rich:message for="duration">
<f:facet name="passedMarker">
<h:graphicImage value="/images/ajax/passed.gif" />
</f:facet>
<f:facet name="errorMarker">
<h:graphicImage value="/images/ajax/error.gif" />
</f:facet>
</rich:message>
<h:outputText value="Rate" />
<h:inputText id="rate" value="#{userBean.rate}">
<f:validateLength minimum="3" maximum="10"/>
<a4j:support event="onkeyup" reRender="outR" status="commonstatus"/>
</h:inputText>
<rich:message for="rate">
<f:facet name="passedMarker">
<h:graphicImage value="/images/ajax/passed.gif" />
</f:facet>
<f:facet name="errorMarker">
<h:graphicImage value="/images/ajax/error.gif" />
</f:facet>
</rich:message>
</h:panelGrid>
</rich:panel>
<rich:spacer height="10" />
<rich:panel><f:facet name="header">Values for input</f:facet>
<rich:effect event="onclick" type="BlindUp" params="duration:0.8" />
<rich:effect event="onclick" for="bubox" type="Appear" params="delay:3.0,duration:0.5" />
<h:panelGrid columns="2" cellspacing="7" cellpading="7">
<h:outputText value="Role Description:" />
<h:outputText id="showname" value="#{userBean.inputValue.description}" />
<h:outputText value="Role Duration:" />
<h:outputText id="outD" value="#{userBean.duration}" />
<h:outputText value="Role Rate:" />
<h:outputText id="outR" value="#{userBean.rate}" />
</h:panelGrid>
</rich:panel>
<br></br>
<a4j:commandButton id="transferButton" value="#{userBean.roleList}" reRender="out" />
<p />
<h:panelGroup id="out">
<h:form>
<a4j:region>
<rich:dataTable id="roleTable" width="100%" rows="1" value="#{roleList}" var="_roleTable">
<f:facet name="header">
<h:outputText value="Values for input into database"/>
</f:facet>
<rich:column>
<f:facet name="header">
<h:outputText value="Role" />
</f:facet>
<h:outputText id="showname" value="#{userBean.inputValue.description}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Duration" />
</f:facet>
<h:outputText id="outtextDuration" value="#{userBean.duration}" render="outD"/>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Rate" />
</f:facet>
<h:outputText id="outtextRate" value="#{userBean.rate}" render="outR" />
</rich:column>
<rich:column>
<f:facet name="header">Actions</f:facet>
<a4j:commandLink ajaxSingle="true" id="editlink"
oncomplete="#{rich:component('editPanel')}.show()">
<h:graphicImage value="/images/ajax/edit.gif" style="border:0"/>
<f:setPropertyActionListener value="#{category}"
target="#{dataTableScrollerBean.currentItem}" />
<f:setPropertyActionListener value="#{row}"
target="#{dataTableScrollerBean.currentRow}" />
</a4j:commandLink>
<rich:toolTip for="editlink" value="Edit"/>
<a4j:commandLink ajaxSingle="true" id="deletelink"
oncomplete="#{rich:component('deletePanel')}.show()">
<h:graphicImage value="/images/ajax/delete.gif" style="border:0"/>
<f:setPropertyActionListener value="#{row}"
target="#{dataTableScrollerBean.currentRow}" />
</a4j:commandLink>
<rich:toolTip for="deletelink" value="Delete"/>
</rich:column>
<f:facet name="footer">
<rich:datascroller renderIfSinglePage="false" maxPages="5" />
</f:facet>
</rich:dataTable>
</a4j:region>
</h:form>
</h:panelGroup>
</rich:panel>
<rich:spacer height="15" />
<br></br>
<h:commandButton value="#{msgs.finish}" action="#{identity.login}"/>
<h:commandButton value="#{msgs.clear}" action="#{identity.logout}"/>
</h:form>
</div>
</div>
<h:form id="login">
<div id="sidebar">
<h:messages styleClass="message"/>
</div>
<div id="sidebar">
<ul>
<li id="search">
<h2>Login</h2>
<h:outputLabel for="username"><h:outputText value="#{msgs.userName}"/></h:outputLabel>
<br></br><h:inputText id="username" value="#{identity.username}"/>
<br></br><h:outputLabel for="password"><h:outputText value="#{msgs.password}"/></h:outputLabel>
<br></br><h:inputSecret id="password" value="#{identity.password}"/>
<h:outputLabel for="rememberMe"><h:outputText value="#{msgs.rememberMe}"/></h:outputLabel>
<h:selectBooleanCheckbox id="rememberMe" value="#{identity.rememberMe}"/>
<br></br><h:commandButton value="#{msgs.login}" action="#{identity.login}"/>
<h:commandButton value="#{msgs.logout}" action="#{identity.logout}"/>
</li>
</ul>
</div>
</h:form>
</div>
<div style="clear: both;"></div>
</ui:define>
</ui:composition>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
template="layout/template.xhtml">
<ui:define name="body">
<div id="page">
<div id="content">
<div class="post">
<h1 class="title">TM Project</h1>
<h:form id="tmProject">
<rich:spacer height="22">
<a4j:status>
<f:facet name="start">
<h:graphicImage value="/images/ajax/loading.gif"/>
</f:facet>
</a4j:status>
</rich:spacer>
<rich:panel>
<rich:panel><f:facet name="header">Input section</f:facet>
<h:panelGrid columns="3" cellpadding="7" cellspacing="7" >
<h:outputText value="Role" />
<rich:inplaceSelect value="#{userBean.inputValue}" defaultLabel="Click here to select Role" id="inplaceSelect">
<s:selectItems var="_role" value="#{roleList}" label="#{_role.name}" />
<s:convertEntity/>
<a4j:support event="onviewactivated" reRender="showname" />
</rich:inplaceSelect>
<h:commandLink value="#{msgs.addRole}" action="/members/addRole.seam"/>
<h:outputText value="Duration" />
<h:inputText id="duration" value="#{userBean.duration}">
<f:validateLength minimum="3" maximum="10"/>
<a4j:support event="onkeyup" reRender="outD" />
</h:inputText>
<rich:message for="duration">
<f:facet name="passedMarker">
<h:graphicImage value="/images/ajax/passed.gif" />
</f:facet>
<f:facet name="errorMarker">
<h:graphicImage value="/images/ajax/error.gif" />
</f:facet>
</rich:message>
<h:outputText value="Rate" />
<h:inputText id="rate" value="#{userBean.rate}">
<f:validateLength minimum="3" maximum="10"/>
<a4j:support event="onkeyup" reRender="outR" status="commonstatus"/>
</h:inputText>
<rich:message for="rate">
<f:facet name="passedMarker">
<h:graphicImage value="/images/ajax/passed.gif" />
</f:facet>
<f:facet name="errorMarker">
<h:graphicImage value="/images/ajax/error.gif" />
</f:facet>
</rich:message>
</h:panelGrid>
</rich:panel>
<rich:spacer height="10" />
<rich:panel><f:facet name="header">Values for input</f:facet>
<rich:effect event="onclick" type="BlindUp" params="duration:0.8" />
<rich:effect event="onclick" for="bubox" type="Appear" params="delay:3.0,duration:0.5" />
<h:panelGrid columns="2" cellspacing="7" cellpading="7">
<h:outputText value="Role Description:" />
<h:outputText id="showname" value="#{userBean.inputValue.description}" />
<h:outputText value="Role Duration:" />
<h:outputText id="outD" value="#{userBean.duration}" />
<h:outputText value="Role Rate:" />
<h:outputText id="outR" value="#{userBean.rate}" />
</h:panelGrid>
</rich:panel>
<br></br>
<a4j:commandButton id="transferButton" value="#{userBean.roleList}" reRender="out" />
<p />
<h:panelGroup id="out">
<h:form>
<a4j:region>
<rich:dataTable id="roleTable" width="100%" rows="1" value="#{roleList}" var="_roleTable">
<f:facet name="header">
<h:outputText value="Values for input into database"/>
</f:facet>
<rich:column>
<f:facet name="header">
<h:outputText value="Role" />
</f:facet>
<h:outputText id="showname" value="#{userBean.inputValue.description}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Duration" />
</f:facet>
<h:outputText id="outtextDuration" value="#{userBean.duration}" render="outD"/>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Rate" />
</f:facet>
<h:outputText id="outtextRate" value="#{userBean.rate}" render="outR" />
</rich:column>
<rich:column>
<f:facet name="header">Actions</f:facet>
<a4j:commandLink ajaxSingle="true" id="editlink"
oncomplete="#{rich:component('editPanel')}.show()">
<h:graphicImage value="/images/ajax/edit.gif" style="border:0"/>
<f:setPropertyActionListener value="#{category}"
target="#{dataTableScrollerBean.currentItem}" />
<f:setPropertyActionListener value="#{row}"
target="#{dataTableScrollerBean.currentRow}" />
</a4j:commandLink>
<rich:toolTip for="editlink" value="Edit"/>
<a4j:commandLink ajaxSingle="true" id="deletelink"
oncomplete="#{rich:component('deletePanel')}.show()">
<h:graphicImage value="/images/ajax/delete.gif" style="border:0"/>
<f:setPropertyActionListener value="#{row}"
target="#{dataTableScrollerBean.currentRow}" />
</a4j:commandLink>
<rich:toolTip for="deletelink" value="Delete"/>
</rich:column>
<f:facet name="footer">
<rich:datascroller renderIfSinglePage="false" maxPages="5" />
</f:facet>
</rich:dataTable>
</a4j:region>
</h:form>
</h:panelGroup>
</rich:panel>
<rich:spacer height="15" />
<br></br>
<h:commandButton value="#{msgs.finish}" action="#{identity.login}"/>
<h:commandButton value="#{msgs.clear}" action="#{identity.logout}"/>
</h:form>
</div>
</div>
<h:form id="login">
<div id="sidebar">
<h:messages styleClass="message"/>
</div>
<div id="sidebar">
<ul>
<li id="search">
<h2>Login</h2>
<h:outputLabel for="username"><h:outputText value="#{msgs.userName}"/></h:outputLabel>
<br></br><h:inputText id="username" value="#{identity.username}"/>
<br></br><h:outputLabel for="password"><h:outputText value="#{msgs.password}"/></h:outputLabel>
<br></br><h:inputSecret id="password" value="#{identity.password}"/>
<h:outputLabel for="rememberMe"><h:outputText value="#{msgs.rememberMe}"/></h:outputLabel>
<h:selectBooleanCheckbox id="rememberMe" value="#{identity.rememberMe}"/>
<br></br><h:commandButton value="#{msgs.login}" action="#{identity.login}"/>
<h:commandButton value="#{msgs.logout}" action="#{identity.logout}"/>
</li>
</ul>
</div>
</h:form>
</div>
<div style="clear: both;"></div>
</ui:define>
</ui:composition>
Znaci, pri prijenosu vrijednosti, koraci su slijedeci: u najgornjoj formi se odabira i unosi vrijednost, koja se sa: <a4j:support event="onkeyup" reRender="outR" status="commonstatus"/> kopira u formu; odakle bi na button: <a4j:commandButton id="transferButton" value="#{userBean.roleList}" reRender="out" /> trebalo da unosi podatke u scrollable tabelu ispod, sto i radi ali problem je u dodavanju sledece vrijednosti (vrste), posto se samo prepise postojeca. Ako moze neki prijedlog, bio bih zahvalan.