-
FEATURED COMPONENTS
First time here? Check out the FAQ!
As title state, is it possible to make it possible?
example on the button on list cell, I need to take id from the models, but now I use autag for it
<template name="model">
<listitem>
<listcell label="${each.id}" />
<listcell label="${each.name}" />
<listcell label="${each.pricing}" />
<listcell>
<button label="Edit Query Param" autag="${each.id}" sclass="btnEdit" />
<button label="Edit Path" autag="${each.id}" sclass="btnEditParam" />
</listcell>
</listitem>
</template>
I'm thinking like on MVVM, like Parameters or @BindingParam (org.zkoss.bind.annotation.BindingParam), or it's not possible with the MVC approach in zul?
Like Example if we use MVVM we can use zul
<menuitem label="Index" onClick="@command('GoToUrl', url='/')" />
and get it using @BindParam for url variable
@Command
public void GoToUrl(@BindingParam("url") String url)
{
Executions.sendRedirect(url);
}
For Now I'm using autag and it ends up with horrible code like this
@Listen("onClick = listcell > button.btnEdit; onOK = window")
public void goToEdit(MouseEvent event)
{
var p = (Button) event.getTarget();
String id = p.getAutag();
Executions.sendRedirect("/product/edit?id="+id);
}
@Listen("onClick = listcell > button.btnEditParam; onOK = window")
public void goToEditParam(MouseEvent event)
{
var p = event.getTarget();
String id = p.getAutag();
Executions.sendRedirect("/product/edit/"+id);
}
I'm thinking like
@Listen("onClick = listcell > button.btnEditParam; onOK = window")
public void goToEditParam(MouseEvent event, @BindingParam Integer id)
{
var p = event.getTarget();
String id = p.getAutag();
Executions.sendRedirect("/product/edit/"+id);
}
I still can't think how to map it from the zul or GUI part.
Asked: 2023-11-10 15:49:06 +0800
Seen: 1 times
Last updated: Nov 10
Sending array to server: Too much recursion
bug with intboxes on mobile devices
zk keikai-how to add custom button/label to formulabar?
zk-keikai- update multiple cells parallel at same time asynchronously
zk-keikai-How to auto fit column width based on text
zk-keikai-ClipboardPateEvent-called twice
Reference a spring bean from VariableResolver