0

How to set Children's through div and a tag.

asked 2015-01-27 14:33:41 +0800

sathishk gravatar image sathishk
17 5

updated 2015-01-28 07:04:03 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

Hai,

This is My Zul file

<div id="monthsDiv" children="@bind(vm.months)">
    <template name="children" var ="node">
        <h:li>
            <a id="showsImages" sclass="activator" onClick="@command('showImages', ref=self.label, iref = self.uuid )" label="@bind(node.mName)"> </a>
        </h:li>
    </template>
</div>

I need to set children's by using @wire Div and A tag, Please help me i am new at Zk.

I am trying this way,it's not working please help me :

@Wire
A showsImages;
@Wire
Div monthsDiv;

Div div = new Div();
A a = new A(filename.toString());
a.setParent(div);
showsImages.setLabel(filename.toString());
div.setParent(showsImages);

I am getting value on filename.toString(),but setting by @Wire variable not working.

delete flag offensive retag edit

Comments

1

Sorry if I'm rude but I'm not putting mine time in this question. Only 1 question is accepted by you, never up or down voted an answer if it (didn't) helped you. Never feedback why you didn't vote, cause maybe the answer wasn't good enough. As last, new at ZK if you have questions older then a year

chillworld ( 2015-01-27 14:55:24 +0800 )edit

sorry chillworld,i don't know about compulsory vote,i will vote now onwards.please help me.

sathishk ( 2015-01-28 05:04:08 +0800 )edit

are you working mvc or mvvm? older question by you was mvvm

chillworld ( 2015-01-28 05:58:14 +0800 )edit

now i am working on mvc.

sathishk ( 2015-01-28 06:33:43 +0800 )edit

are you sure? @bind, @command are MVVM commands. if you declared the controller as viewmodel the @Wire will not work. Don't forget taht the A has multiple instances in the div.

chillworld ( 2015-01-28 07:07:54 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-01-29 11:00:06 +0800

cor3000 gravatar image cor3000
6280 2 7

I took the freedom to update Chills answer to use <ul><li><a>... instead of vbox to get closer to the original design: http://zkfiddle.org/sample/1phndgi/2-clear-and-get-new-values

NOTE I am using the xhtml namespace instead of the native namespace.

link publish delete flag offensive edit

Comments

Thank you for solution.

sathishk ( 2015-02-02 06:31:14 +0800 )edit
0

answered 2015-01-28 10:52:28 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

updated 2015-01-29 10:10:30 +0800

Look at this update fiddle :

http://zkfiddle.org/sample/2m7g68o/37-Another-new-ZK-fiddle

Edit :

This fiddle shows you how to set the months under each other and clear the children when you change the combobox value.
You normally have enough info now to overcome your first problem.
The images is just setting them like the A we did in code.

http://zkfiddle.org/sample/1phndgi/1-clear-and-get-new-values

Greetz chill.

link publish delete flag offensive edit

Comments

Dear Childworld,single div it's working fine but i need to refresh when select year with a tag,like<div id="monthsDiv"> <template name="children" var ="node"> <h:li> <a id="showsImages" sclass="activator"> </a> </h:li> </template> </div>

sathishk ( 2015-01-28 14:34:45 +0800 )edit

well, you have the onlisten of the combobox, when you change the value=> clear the div and put it back with what you want, no?

chillworld ( 2015-01-28 14:40:18 +0800 )edit

Thanks for helping,Now check this link http://zkfiddle.org/sample/2m7g68o/39-Another-new-ZK-fiddle

sathishk ( 2015-01-29 04:52:02 +0800 )edit

looks like what you wanted, just need to clear the div before the others are inserted

chillworld ( 2015-01-29 05:14:21 +0800 )edit

when i select drop down on years,then refresh months, after months select then refresh images.In year dropdown selection ,months are visible with A tag.

sathishk ( 2015-01-29 06:46:48 +0800 )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: 2015-01-27 14:33:41 +0800

Seen: 63 times

Last updated: Jan 29 '15

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