How to control object in multiple zul files - zk

I need to control a gmaps (in gmaps.zul file) from a button in another zul file (top.zul).
Both files are included in root.zul.
When I push my button ZK show me a popup error message: "Name is empty or target is null."
Here's my code:
*root.zul *
<?link rel="stylesheet" type="text/css" href="/resources/css/style.css"?>
<zk>
<borderlayout hflex="1" vflex="1">
<north height="100px" border="none" >
<include id="northPanel" src="/top.zul"></include>
</north>
<center id="mainContent" autoscroll="true">
<include src="/gmaps.zul" ></include>
</center>
</borderlayout>
</zk>
*gmaps.zul *
<zk>
<div>
<gmaps id="map" width="500px" height="500px" lat="35" lng="-110" />
</div>
</zk>
** top.zul **
<zk>
<div apply="test.TestComposer">
<button id="btn" label="add marker" />
</div>
</zk>
** TestComposer.java **
public class TestComposer extends GenericForwardComposer {
private Gmaps map;
private double lat = 35;
private double lng = -110;
public void onClick$btn() {
Events.echoEvent("onAddMarker", map, null);
}
public void onAddMarker$map() {
Gmarker marker = new Gmarker();
lat += 0.001;
lng += 0.001;
marker.setLat(lat);
marker.setLng(lng);
marker.setParent(map);
}
}

You need to wire your map:
#Wire
private Gmaps map;

Related

How to show/hide an element in real time (Blazor)?

I have an image I would like to display only after a user has filled in all text fields.
I have tried using disabled attribute, but that does not seem to work. Any other insights?
Here is my current code:
<EditForm EditContext="#EditContext" style="max-width:800px;" onkeydown="javascript: DisableEnterKey();">
<FluentValidator />
<img src="images/approval-16-grey.ico" alt="Image" disabled="#OkayDisabled">
<p class="statp">How many families and/or individuals are living on your land?</p><br />
<label class="statlabel" for="amountOfFamilies">Amount of families:</label><br />
<InputNumber id="fams" for="indivNum" class="input" #bind-Value="#familyData.IndividualAmount" onwheel="this.blur()" placeholder="Families..." autofocus />
<ValidationMessage For="() => familyData.IndividualAmount" />
<br /><hr class="statHR" />
<label class="statlabel" for="amountOfIndividuals">Amount of single individuals: </label><br />
<InputNumber id="individuals" for="famNum" class="input" #bind-Value="#familyData.FamilyAmount" onwheel="this.blur()" placeholder="Individuals..."/>
<ValidationMessage For="() => familyData.FamilyAmount" />
<br /><hr class="statHR" />
<label class="statlabel" for="names"> Please enter all of the names here:</label><br />
<InputTextArea id="names" class="textArea" rows="4" cols="18" #bind-Value="#PersonName" placeholder="Names of all individuals..." />
<ValidationMessage For="() => familyData.PersonName" />
</EditForm>
</div>
</ul>
#code
{
private EditContext? EditContext;
public FamilyData Model = new FamilyData();
protected string OkayDisabled { get; set; } = "disabled";
protected override void OnInitialized()
{
EditContext = new EditContext(Model);
EditContext.OnFieldChanged += EditContext_OnFieldChanged;
base.OnInitialized();
}
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender);
SetOkDisabledStatus();
}
private void EditContext_OnFieldChanged(object? sender, FieldChangedEventArgs e)
{
SetOkDisabledStatus();
}
private void SetOkDisabledStatus()
{
if(EditContext.Validate())
{
OkayDisabled = null;
}
else
{
OkayDisabled = "disabled";
}
}
}
The hidden html attribute also works to hide an element.
<p hidden>This paragraph should be hidden.</p>
To bind to Model:
<p hidden="#HideLabel">I am Hidden When HideLabel == true</p>
<p hidden="#(!HideLabel)">I am Hidden when Hidelabel == false</p>
<button #onclick="#Toggle">Show/Hide</button>
#code {
private bool HideLabel {get;set;} = false;
private void Toggle()
{
HideLabel = !HideLabel;
}
}
Edit: You can also use a CSS class to hide/show an element:
<div class="font-italic #(HideLabel ? "d-none" : "d-show")">
I am Hidden When HideLabel == true
</div>
Change OkayDisabled to a bool, and then around your image do this
#if (!OkayDisabled)
{
<img src=".....whatever" etc />
}
You might also want to add #bind:event="oninput" wherever you use an #bind.
Instead of binding your flag to the disabled attribute (an image's disabled attribute just grays it out), I would bind it to a css class that has display: none;
.hidden {
display: none;
}
<img class="#(ShouldShowImage? "hidden" : string.Empty)">
didn't used it within editform but should work
#if(OkayDisabled)
{
<img src="images/approval-16-grey.ico" >

how to change segmented button to next on clicked

The segmented button is as follows:
<SegmentedButton width="98%">
<items>
<SegmentedButtonItem text="INDICATOR1" class="progress" id="before"/>
<SegmentedButtonItem text="INDICATOR2" class="progress" id="present"/>
<SegmentedButtonItem text="INDICATOR3" class="progress" id="after"/>
</items>
</SegmentedButton>
and Next button as:
<Button text="Next" press="onPressNext" enabled="true"></Button>
previous button as:
<Button text="Previous" press="onPressPrevious" enabled="true"></Button>
How to write the JS code so that when Next is pressed INDICATOR2 should be active and on second press INDICATOR3 should be active
And when on INDICATOR2 if Previous is pressed both INDICATOR2 and INDICATOR1(which is current one) should be active
I have no knowledge on JS at least to try , any help so that I would go through it and learn, TIA
You can grab the list of items from the SegmentedButton, get the next or previous item respecitively, and set it as the selected item.
(I added an id to the SegmentedButton in below example)
sap.ui.define("myController", [
"sap/ui/core/mvc/Controller"
], function(Controller) {
"use strict";
return Controller.extend("myController", {
onPressNext: function() {
var sb = this.byId("segmentButton1");
var items = sb.getItems().map(function(itm) { return itm.getId() });
var idx = items.indexOf(sb.getSelectedItem()) + 1;
if(idx < items.length) {
sb.setSelectedItem(items[idx]);
}
},
onPressPrevious: function() {
var sb = this.byId("segmentButton1");
var items = sb.getItems().map(function(itm) { return itm.getId() });
var idx = items.indexOf(sb.getSelectedItem()) - 1;
if(idx > -1) {
sb.setSelectedItem(items[idx]);
}
}
});
});
sap.ui.require(["sap/ui/core/mvc/XMLView"], function(XMLView) {
XMLView.create({
definition: $('#myView').html()
}).then(function(oView) {
oView.placeAt('content');
});
});
<html>
<head>
<meta charset="utf-8">
<script id='sap-ui-bootstrap' src='https://sapui5.hana.ondemand.com/resources/sap-ui-core.js' data-sap-ui-theme='sap_fiori_3' data-sap-ui-libs='sap.m'></script>
<script id="myView" type="sapui5/xmlview">
<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="myController">
<SegmentedButton width="98%" id="segmentButton1">
<items>
<SegmentedButtonItem text="INDICATOR1" class="progress" id="before" />
<SegmentedButtonItem text="INDICATOR2" class="progress" id="present" />
<SegmentedButtonItem text="INDICATOR3" class="progress" id="after" />
</items>
</SegmentedButton>
<Button text="Previous" press="onPressPrevious" enabled="true" />
<Button text="Next" press="onPressNext" enabled="true" />
</mvc:View>
</script>
</head>
<body class='sapUiBody'>
<div id='content'></div>
</body>
</html>
I think you create event like onclick and change OR add style class for example active attribute
<items>
<SegmentedButtonItem text="INDICATOR1" class="progress active" id="before"/>
<SegmentedButtonItem text="INDICATOR2" class="progress" id="present"/>
<SegmentedButtonItem text="INDICATOR3" class="progress" id="after"/>
</items>
and when you click next then you have to remove active class from INDICATOR1 and then append active class to next indicator
<items>
<SegmentedButtonItem text="INDICATOR1" class="progress" id="before"/>
<SegmentedButtonItem text="INDICATOR2" class="progress active" id="present"/>
<SegmentedButtonItem text="INDICATOR3" class="progress" id="after"/>
</items>
Please write an onclick function for the next button something like below
function onNextClick(){
//Make the css of INDICATOR1 normal and INDICATOR2 || INDICATOR3 active
}

how to get current page in wicket

i am trying to create dynamic navigation links in which current page link should be highlighted but i am unable to get desired outcome. i am using listview to display my menu items but unable to highlight the current page link.
please suggest necessary changes
public class SearchPage extends WebPage implements Serializable {
private static final long serialVersionUID = 1L;
Logger log = Logger.getLogger(SearchPage.class);
public SearchPage() {
List<HeaderListItems> headerPOJOItems = new ArrayList<HeaderListItems>();
HeaderListItems searchHLI = new HeaderListItems();
searchHLI.setLabel("Search");
searchHLI.setDestPage(SearchPage.class);
headerPOJOItems.add(searchHLI);
HeaderListItems jobsHLI = new HeaderListItems();
jobsHLI.setLabel("Jobs");
jobsHLI.setDestPage(Jobs.class);
headerPOJOItems.add(jobsHLI);
HeaderListItems urlHLI = new HeaderListItems();
urlHLI.setLabel("URL");
urlHLI.setDestPage(URL.class);
headerPOJOItems.add(urlHLI);
HeaderListItems syssettingsHLI = new HeaderListItems();
syssettingsHLI.setLabel("System Settings");
syssettingsHLI.setDestPage(Settings.class);
headerPOJOItems.add(syssettingsHLI);
HeaderListItems usersHLI = new HeaderListItems();
usersHLI.setLabel("Users");
usersHLI.setDestPage(User.class);
headerPOJOItems.add(usersHLI);
HeaderListItems logoutHLI = new HeaderListItems();
logoutHLI.setLabel("Logout");
logoutHLI.setDestPage(WebApp.get().getHomePage());
headerPOJOItems.add(logoutHLI);
add(new ListView("headerlistview", headerPOJOItems) {
#Override
protected void populateItem(ListItem item) {
final HeaderListItems headerlistitems = (HeaderListItems) item
.getModelObject();
log.info("Label: " + headerlistitems.getLabel() + " dest: "
+ headerlistitems.getDestPage());
Link newlink = new Link("newlink") {
#Override
public void onClick() {
setResponsePage(headerlistitems.getDestPage());
}
};
newlink.add(new Label("newlabel", headerlistitems.getLabel()));
newlink.add(new AttributeModifier("class",
new AbstractReadOnlyModel() {
#Override
public Object getObject() {
// TODO Auto-generated method stub
return getPage().getClass().equals(
headerlistitems.getDestPage()
.getClass()) ? "activeitem"
: AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE;
}
}));
item.add(newlink);
}
});
}
List is list of pojo item. my pojo has two fields label(String) and destPage(Class)
My Mark-up:
<html xmlns:wicket="http://wicket.apache.org">
<head>
<title>Search Page</title>
<link href="css/design.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="container">
<div class="header">
<div class="header_tab1">
<p align="center">Logo</p>
</div>
<div class="header_tab2"> </div>
<div class="header_tab3">
<table width="100%">
<tr>
<td wicket:id="headerlistview">
<ul>
<li><a href="#" wicket:id="newlink"><span
wicket:id="newlabel"></span></a></li>
</ul>
</td>
</tr>
</table>
</div>
</div>
</div>
</body>
</html>
I have a CSS class activeitem which i am using in attribute modifier
Thanks in advance
Change the class comparison to:
return getPage().getClass().equals(
headerlistitems.getDestPage()) ? "activeitem" : AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE;
The next step would be to extract the navigation into its own panel, so you can reuse it in your pages.
Good luck.

How to save form data from <t:dataTable> in JSF 1.2

I am trying to save the data edited in a t:dataTable object when a user clicks on a Save button h:commandButton. However, before the action is called, the postConstruct() method in the bean is called which tries to load the data for the table, but does not have the docId that was initially passed in. I have tried using f:param in the h:commandButton to pass in the docId, but that does not work. Does anyone have the correct strategy for loading the page with a docId, then saving the changes once the save button is clicked? The following is my current bean code and xhtml. I do not have the option of upgrading to JSF 2.0 yet unfortunately.
<h:form enctype="multipart/form-data">
<t:outputText value="Document: #{documentWorkflowCommentsBean.document.name}" />
<br/><br/>
<t:dataTable id="commentTable" sortable="false"
value="${documentWorkflowCommentsBean.document.workflowComments}"
var="comment"
styleClass="addmTable">
<t:column styleClass="commentId">
<f:facet name="header">
<h:outputText value="ID" />
</f:facet>
<t:outputText value="${comment.commentId}"/>
</t:column>
<t:column styleClass="cr624_wrap cr624_maxwidth200">
<f:facet name="header">
<h:outputText value="Reviewer" />
</f:facet>
<t:outputText value="${comment.reviewer}"/>
</t:column>
<t:column styleClass="charColumn">
<f:facet name="header">
<h:outputText value="Type" />
</f:facet>
<t:outputText value="${comment.commentType}"
rendered="${!documentWorkflowCommentsBean.editComments}"/>
<t:selectOneListbox id="typeList" title="Choose Comment type"
size="1" rendered="${documentWorkflowCommentsBean.editComments}"
value="${comment.commentType}">
<f:selectItems value="${documentWorkflowCommentsBean.commentTypes}"/>
</t:selectOneListbox>
</t:column>
<t:column styleClass="cr624_wrap cr624_maxwidth200">
<f:facet name="header">
<h:outputText value="Page" />
</f:facet>
<t:outputText value="${comment.pageNumber}"/>
</t:column>
<t:column styleClass="cr624_wrap cr624_maxwidth200">
<f:facet name="header">
<h:outputText value="Section/Paragraph" />
</f:facet>
<t:outputText value="${comment.sectionParagraph}"/>
</t:column>
<t:column styleClass="cr624_wrap cr624_maxwidth200">
<f:facet name="header">
<h:outputText value="Comment/Rationale" />
</f:facet>
<t:outputText value="${comment.commentRationale}"/>
</t:column>
<t:column styleClass="cr624_wrap cr624_maxwidth200">
<f:facet name="header">
<h:outputText value="PO Resolution" />
</f:facet>
<t:outputText value="${comment.poResolution}"
rendered="${!documentWorkflowCommentsBean.editComments}"/>
<t:inputTextarea id="poResolutionTextArea" value="${comment.poResolution}"
rendered="${documentWorkflowCommentsBean.editComments}"
rows="3" cols="20"/>
</t:column>
<t:column styleClass="charColumn">
<f:facet name="header">
<h:outputText value="Decision" />
</f:facet>
<t:outputText value="${comment.decision}"
rendered="${!documentWorkflowCommentsBean.editComments}"/>
<t:selectOneListbox id="decisionList" title="Choose Decision"
size="1" rendered="${documentWorkflowCommentsBean.editComments}"
value="${comment.decision}">
<f:selectItems value="${documentWorkflowCommentsBean.commentDecisions}"/>
</t:selectOneListbox>
</t:column>
</t:dataTable>
<br/>
<h:commandButton value="Save" action="#{documentWorkflowCommentsBean.saveDocumentComments}">
<f:param name="docId" value="#{documentWorkflowCommentsBean.documentId"/>
<f:param name="editComments" value="#{documentWorkflowCommentsBean.editComments}"/>
</h:commandButton>
<input type="button" value="Cancel" title="Close the dialog" onclick="closeModal();"/>
</h:form>
public class DocumentWorkflowCommentsBean extends PageBean {
private static final long serialVersionUID = -866249792018248429L;
private static final Logger log = LogManager.getLogger(DocumentWorkflowCommentsBean.class);
/**
* Holds a reference to the DocumentBusiness object.
*
* #uml.property name="docBiz"
*/
private DocumentBusiness docBiz;
/**
* This represents the documentId parameter passed
*
* #uml.property name="documentId"
*/
private long documentId;
/**
* This is the corresponding Document object represented by the documentId property
*
* #uml.property name="document"
*/
private Document document;
/**
* Determines if the Type, Resolution, and Decision fields are editable
*
* #uml.property name="editComments"
*/
private boolean editComments = false;
private static final List<SelectItem> COMMENT_TYPES = Arrays.asList(new SelectItem("C", "C"),
new SelectItem("M", "M"),
new SelectItem("S", "S"),
new SelectItem("A", "A"));
private static final List<SelectItem> COMMENT_DECISIONS = Arrays.asList(
new SelectItem("A", "A"),
new SelectItem("R", "R"),
new SelectItem("M", "M"));
/**
* This is called after all resources are injected
*/
#PostConstruct
public void postConstruct() {
docBiz = BusinessUtils.getDocumentBusiness();
// Get the parameters that are passed in
String docIdString = (String) getPassedParam("docId");
String editString = (String) getPassedParam("editComments");
// editComments will be null when closing dialog
if (editString != null) {
editComments = Boolean.parseBoolean(editString);
}
if (docIdString != null) {
try {
// Retrieve the Document object
documentId = Long.parseLong(docIdString);
} catch (NumberFormatException ignore) {
// do nothing
log.error("Invalid parameter - " + docIdString);
}
if (documentId > 0) {
//lazy load of workflow comments to be displayed
document = docBiz.getDocumentFetchWorkflowComments(documentId);
}
// Check to see that the Document exists
if (document == null) {
this.getAddmSessionBean().addPageErrorMessage("Cannot perform action - document has been deleted.");
}
}
}
public String saveDocumentComments() {
docBiz.updateDocument(document); //JPA merge call on document
return null;
}
public long getDocumentId() {
return documentId;
}
public void setDocumentId(long documentId) {
this.documentId = documentId;
}
public Document getDocument() {
return document;
}
public void setDocument(Document document) {
this.document = document;
}
public List<SelectItem> getCommentTypes() {
return COMMENT_TYPES;
}
public List<SelectItem> getCommentDecisions() {
return COMMENT_DECISIONS;
}
}
As you're apparently already using Tomahawk, you can just simulate the JSF 2.x view scope using <t:saveState>.
Put this somewhere in the view to make a JSF 1.x request scoped bean to behave like a JSF 2.x view scoped bean:
<t:saveState value="#{documentWorkflowCommentsBean}" />
This way the bean will live as long as you interact with the same view by postbacks returning void/null and it won't be reconstructed/reinitialized on every postback, exactly like as in JSF 2.x.

RichFaces 4 dataTable edit issue

I would like to do such table with editing like here -> http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=dataTable&sample=dataTableEdit&skin=blueSky . The problem ist that, when I do changes in editPane (popupPanel) they are not remembered in private OsobaTelefon edytujOsobe. This make update impossible via JPA. I have all getters and setters and class OsobaTelefon implements Serializable.
#ManagedBean(name = "administrator")
#ViewScoped
#SessionScoped
public class Administrator implements Serializable
#EJB
private UzytkownikFacade uzytkownikFacade;
private static final long serialVersionUID = 1L;
#EJB
private OsobaFacade osobaFacade;
private Osoba osobaAdmina;
private int numerStrony = 1;
private Uzytkownik uzytkownik;
private List<Osoba> listaOsob;
private static final int CLIENT_ROWS_IN_AJAX_MODE = 10;
private int clientRows;
private int wybranaOsoba;
private OsobaTelefon edytujOsobe; //it doesn't remember the changes made in editPane
private List<OsobaTelefon> osobyITelefony;
/**
* Creates a new instance of Administrator
*/
public Administrator() {
}
public void aktualizacjaWybranejOsoby() {
this.osobyITelefony.set(this.wybranaOsoba, this.edytujOsobe);
Osoba nowaOsoba = new Osoba();
List<Telefon> nowaListaTelefonow = new ArrayList<Telefon>();
OsobaTelefon osobaTelefon = this.osobyITelefony.get(this.wybranaOsoba);
int o = this.osobyITelefony.get(this.wybranaOsoba).getIdosoby();
int of = this.osobyITelefony.get(this.wybranaOsoba).getIdtelefonu();
System.out.println("Wybrana osoba ID " + o);
System.out.println("Wybrane ID fona " + of);
boolean znalezionoOsobe = false;
Iterator<Osoba> iteOs = this.listaOsob.iterator();
while (!znalezionoOsobe && iteOs.hasNext()) {
Osoba os = iteOs.next();
if (os.getIdosoba() == o) {
znalezionoOsobe = true;
nowaOsoba.setIdosoba(os.getIdosoba());
nowaOsoba.setImie(osobaTelefon.getImie());
nowaOsoba.setNazwisko(osobaTelefon.getNazwisko());
nowaOsoba.setKodpocztowy(osobaTelefon.getKodpocztowy());
nowaOsoba.setMiejscowosc(osobaTelefon.getMiejscowosc());
nowaOsoba.setUlica(osobaTelefon.getUlica());
nowaOsoba.setUzytkownikList(os.getUzytkownikList());
Telefon nowyTelefon = new Telefon();
for (Telefon tel : os.getTelefonList()) {
if (tel.getIdtelefon() == of) {
nowyTelefon.setFkIdosoba(nowaOsoba);
nowyTelefon.setIdtelefon(of);
nowyTelefon.setNumer(this.edytujOsobe.getNumer());
System.out.println("Nr tel. "+tel.getNumer());
nowyTelefon.setOpis(this.edytujOsobe.getOpis());
nowyTelefon.setZastrzezony(this.edytujOsobe.getZastrzezony());
nowaListaTelefonow.add(nowyTelefon);
} else {
nowaListaTelefonow.add(tel);
}
}
nowaOsoba.setTelefonList(nowaListaTelefonow);
this.osobaFacade.aktualizujOsoba(nowaOsoba);
this.pobierzOsobyDoTabeli();
}
}
}
public List<Osoba> pobierzOsobyDoTabeli() {
//getting people with phone to List<OsobaTelefon> works good
}
public void switchAjaxLoading(ValueChangeEvent event) {
this.clientRows = (Boolean) event.getNewValue() ? CLIENT_ROWS_IN_AJAX_MODE : 0;
}
public void zapelnijListeTelefonow() {
//getting people phone number to List<Phone> works good
}
public void usunOsobe() {
//deleting people works good
}
}
The XHTML
<a4j:status onstart="#{rich:component('statPane')}.show()" onstop="#{rich:component('statPane')}.hide()" />
<h:form id="formProjekty">
<rich:dataTable value="#{administrator.osobyITelefony}"
var="pr"
iterationStatusVar="ite"
id="table"
rows="8" >
<rich:column width="auto">
<f:facet name="header">Imię</f:facet>
<h:outputText value="#{pr.imie}" />
</rich:column>
<rich:column>
<a4j:commandLink styleClass="no-decor"
render="editGrid"
execute="#this"
oncomplete="#{rich:component('editPane')}.show()">
<h:graphicImage library="img" name="edit.gif" alt="Edycja"/>
<a4j:param value="#{ite.index}"
assignTo="#{administrator.wybranaOsoba}" />
<f:setPropertyActionListener target="#{administrator.edytujOsobe}"
value="#{pr}" />
</a4j:commandLink>
<a4j:commandLink styleClass="no-decor"
execute="#this"
render="#none"
oncomplete="#{rich:component('confirmPane')}.show()">
<h:graphicImage library="img" name="delete.gif" alt="Usuń"/>
<a4j:param value="#{ite.index}"
assignTo="#{administrator.wybranaOsoba}" />
<f:setPropertyActionListener target="#{administrator.edytujOsobe}"
value="#{pr}" />
</a4j:commandLink>
</rich:column>
<f:facet name="footer">
<rich:dataScroller page="#{administrator.numerStrony}" />
</f:facet>
</rich:dataTable>
<a4j:jsFunction name="remove"
action="#{administrator.usunOsobe()}"
render="table"
execute="#this"
oncomplete="#{rich:component('confirmPane')}.hide();" />
<a4j:jsFunction name="edycja"
action="#{administrator.aktualizacjaWybranejOsoby()}"
render="table"
execute="#this"
oncomplete="#{rich:component('editPane')}.hide();" />
<rich:popupPanel id="statPane" autosized="true">
<h:graphicImage library="img" name="ai.gif" alt="Czekaj"/>
Proszę czekać...
</rich:popupPanel>
<rich:popupPanel id="confirmPane" autosized="true">
Czy na pewno usunać?
<a4j:commandButton value="Tak" onclick="remove();
return false;" />
<a4j:commandButton value="Nie"
onclick="#{rich:component('confirmPane')}.hide();
return false;" />
</rich:popupPanel>
<rich:popupPanel header="Edycja Osoby"
id="editPane"
domElementAttachment="parent" width="180" height="420">
<h:panelGrid columns="1" id="editGrid">
<h:panelGroup >
<h:outputText value="Imię" /><br />
<h:inputText value="#{administrator.edytujOsobe.imie}" >
<f:validateLength maximum="32" minimum="3"/>
</h:inputText>
</h:panelGroup>
</h:panelGrid><br/>
<a4j:commandButton value="Aktualizuj"
onclick="edycja(); return false;"/>
<a4j:commandButton value="Anuluj"
onclick="#{rich:component('editPane')}.hide();
return false;" />
</rich:popupPanel>
</h:form>
if you can change it then make your Aktualizuj a4j-link a little bit easier. Just try that:
<a4j:commandButton value="Aktualizuj"
onclick="#{rich:component('editPane')}.hide();"
action="#{administrator.aktualizacjaWybranejOsoby()}" render="table"/>
and put an a4j:region about your inputText and your link to send only the required values:
<rich:popupPanel header="Edycja Osoby"
id="editPane"
domElementAttachment="parent" width="180" height="420">
<a4j:region>
<h:panelGrid columns="1" id="editGrid">
<h:panelGroup >
<h:outputText value="Imię" /><br />
<h:inputText value="#{administrator.edytujOsobe.imie}" >
<f:validateLength maximum="32" minimum="3"/>
</h:inputText>
</h:panelGroup>
</h:panelGrid><br/>
<a4j:commandButtonvalue="Aktualizuj" onclick="# {rich:component('editPane')}.hide();"action="#{administrator.aktualizacjaWybranejOsoby()}" render="table"/>
<a4j:commandButton value="Anuluj"
onclick="#{rich:component('editPane')}.hide();
return false;" />
</a4j:region>
</rich:popupPanel>
I also add a render="table" to the Aktualizuj a4j:link to update the value in the datatable