Facelets + smthing
idyoshin Dec 7, 2009 4:39 PMGood day community,
sorry if wrong forum. But I'm writting this using seam. so maybe here somebody can explain me.
I need to implement input field for mine database objects. I've created a simple facelet using richfaces suggestionbox component:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:c="http://java.sun.com/jstl/core">
<h:panelGrid>
<h:panelGroup>
<h:inputText id="suggest_input" />
<a4j:commandButton value="Обнулити"
reRender="__descriptionInfo" immediate="true">
<f:setPropertyActionListener target="#{value}" value="#{null}" />
</a4j:commandButton>
<s:link view="/crud/spr/contragents/spr_fiz_lic/edit.xhtml" target="contragentEdit"
value="Створити нового" immediate="true" bypassUpdates="true"/>
</h:panelGroup>
<rich:suggestionbox for="suggest_input" minChars="3" width="500"
var="_fiz_lico_suggest"
fetchValue="#{_fiz_lico_suggest.description}"
nothingLabel="нічого не знайдено"
suggestionAction="#{sprFizLicSearch.autoComplete}"
disableDefault="true" ignoreDupResponses="true" immediate="true"
reRender="__descriptionInfo">
<h:column>
<h:panelGroup>
<h:panelGrid columns="2">
<h:outputText value="ПІБ"/> <b><h:outputText value="#{_fiz_lico_suggest.description}" /></b>
<h:outputText value="Дата народження"/> <b><h:outputText value="#{_fiz_lico_suggest.denRojd}><s:convertDateTime pattern="dd.MM.yyyy"/></h:outputText></b>
<h:ouptutText value="Ідентифікаційний код"/> <b><h:outputText value="#{_fiz_lico_suggest.identifCod}"/></b>
</h:panelGrid>
</h:panelGroup>
</h:column>
<a4j:queue name="q1" />
<a4j:support event="onselect"
reRender="__descriptionInfo" eventsQueue="q1" immediate="true">
<f:setPropertyActionListener value="#{_fiz_lico_suggest}" target="#{value}" />
</a4j:support>
</rich:suggestionbox>
<a4j:outputPanel id="__descriptionInfo" ajaxRendered="true">
<ui:decorate template="/crud/spr/contragents/spr_fiz_lic/output.xhtml">
<ui:param name="value" value="#{value}" />
</ui:decorate>
</a4j:outputPanel>
<a4j:outputPanel>
<rich:simpleTogglePanel >
</rich:simpleTogglePanel>
</a4j:outputPanel>
</h:panelGrid>
</ui:composition>And i'm using this like :
<s:decorate template="/crud/spr.contragents/spr_fiz_lic/input.xhtml">
<ui:param name="value" value="#{zayavaWizard.currentPoliciObject.client}" />
</s:decorate>As you can see simple setValue methods... and open new window for creating new. After saving new - back and find the created value.
What I'd like to achieve - is to create an input form for this object inside of this wizard for creating new. And if it's called save - the newly created object comes back to and sets value.
Is this possible with SEAM and Facelets. Where can I look for information? Maybe someone solved similar problems... Anyway any suggestion would be great!
Best regards,
Ilya Dyoshin