Re: Elegant way to modify parent component tag if child has errors

2013-10-26 Thread Ernesto Reinaldo Barreiro
I would do this with JavaScritpt

div class=PlaceHolder
input type=text wicket:id=userName /
/div


with a behaviors attached to to userName that whenever the field has
errors it finds a parent with class PlaceHolder and adds Error
class. And remove it if not. No need for a component for
userNamePlaceholder or find a component with a given name (e.g. if you
rename userName you will have to remember changing your behavior).


Re: Elegant way to modify parent component tag if child has errors

2013-10-26 Thread meduolis
When/how should I trigger JS to update attribute? I have never used pure JS
in my Wicket applications. I always try to use Wicket components/behaviors.

Also, to avoid problem you mentioned about path to child I can pass it as a
parameter which would be static field for both child component and behavior
parameter:




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Elegant-way-to-modify-parent-component-tag-if-child-has-errors-tp4661983p4661985.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Elegant way to modify parent component tag if child has errors

2013-10-26 Thread Ernesto Reinaldo Barreiro
There is a renderHead on behavior: you can use it to contribute JavaScript.
Sooner than later, if you want to have complex user interaction at client
side, you will end up using extra JavaScript features. There are many
examples out there of JavaScript integration with Wicket


On Sat, Oct 26, 2013 at 12:14 PM, meduolis meduol...@gmail.com wrote:

 When/how should I trigger JS to update attribute? I have never used pure JS
 in my Wicket applications. I always try to use Wicket components/behaviors.

 Also, to avoid problem you mentioned about path to child I can pass it as a
 parameter which would be static field for both child component and behavior
 parameter:




 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Elegant-way-to-modify-parent-component-tag-if-child-has-errors-tp4661983p4661985.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Regards - Ernesto Reinaldo Barreiro


Re: Displaying ListView After Being Hidden

2013-10-26 Thread Bas Gooren
That's precisely why that method/functionality exists. If you have a 
component which is not visible on the first render, how can wicket 
replace it on subsequent ajax renders?


When you call setOutputMarkupPlaceholderTag(true), wicket will render a 
tag with style=display:none which provides wicket's ajax library with 
a hook in the dom.


Suppose you don't call that method, there will be no element in the dom 
which can be replaced.


Met vriendelijke groet,
Kind regards,

Bas Gooren

schreef Jared Sol op 25-10-2013 23:03:

No problem. I'm not exactly sure. I just know when hiding an element and then 
unhiding it you have to tell the component to keep a placeholder so it doesn't 
lose access to the component when you hide it. Might have something to do with 
keeping it around in the dom and using display=none. I haven't looked into the 
details.

Sent from my iPhone


On Oct 25, 2013, at 11:45 AM, dhongyt davidhtr...@gmail.com wrote:

Thanks you! That worked for me. What is the reason for this? Is this so that
it would it would hold the placeholder with in wmc?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Displaying-ListView-After-Being-Hidden-tp4661963p4661972.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org