0

HTML Button OnClick

asked 2016-08-23 06:25:19 +0800

kleponboy gravatar image kleponboy flag of Indonesia
54 5
http://stupidprogrammers....

updated 2016-08-23 06:25:54 +0800

Hi,

Is It Possible to call mvvm onClick command in Java Classes via HTML Button?

like this :

zul :

 <input type="button" onClick="@command('test')">Sign in</button>

Java :

 @Command
 public void test(){
    System.out.print("test");
 {

I tried adding xmlns:zk = "zk" then zk:onClick="@command('test') but still didn't get any result.

pls help.

Regards,

Klepon

delete flag offensive retag edit

3 Answers

Sort by ยป oldest newest most voted
1
link publish delete flag offensive edit
1

answered 2016-08-23 14:44:30 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

In my bootstrap environment i do such things with <a>

<zk xmlns="http://www.zkoss.org/2005/zul" xmlns:h="http://www.w3.org/1999/xhtml"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:w="http://www.zkoss.org/2005/zk/client"
    xmlns:n="http://www.zkoss.org/2005/zk/native"
    xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">


<h:a class="btn btn-sm btn-danger fa fa-times btn-group-btn pull-right"
     title="Delete"
     onClick="@command('onDelete')" />

best Stephan

link publish delete flag offensive edit

Comments

Stephan, the a is xhtml, not native. The poster didn't mention what he used but maybe add it to the answer?

chillworld ( 2016-08-23 20:59:21 +0800 )edit
0

answered 2016-11-07 06:55:56 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

Hi Childworld

Can you give me a example. I am also tryign the same

<h:input oncheck="@command('goBack')" id="checkbox2" type="checkbox"/> <n:label for="checkbox2">Primary</n:label>
link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2016-08-23 06:25:19 +0800

Seen: 115 times

Last updated: Nov 07 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More