Hiding Components based on style

View: New views
7 Messages — Rating Filter:   Alert me  

Hiding Components based on style

by Rexxe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am using Wicket 1.3 and was wondering if there is a way to hide components
in the HTML itself.  Here's the issue, say I have two forms and two
different styles.  In one style I want to display all the form fields,
however in the other one I want to display only a couple of them.  I
currently have two HTML files, one for each style, but I can't seem to find
a way to hide the form fields aside from using CSS and adding display:none.
Is that the only way to do it?

Thanks!

Re: Hiding Components based on style

by igor.vaynberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

add(new textfield(..) { isvisible() { return
getsession.getstyle().equals("foo"); }});

-igor

On Thu, Jun 25, 2009 at 8:41 PM, Andrew Berman<atberman@...> wrote:

> I am using Wicket 1.3 and was wondering if there is a way to hide components
> in the HTML itself.  Here's the issue, say I have two forms and two
> different styles.  In one style I want to display all the form fields,
> however in the other one I want to display only a couple of them.  I
> currently have two HTML files, one for each style, but I can't seem to find
> a way to hide the form fields aside from using CSS and adding display:none.
> Is that the only way to do it?
>
> Thanks!
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Hiding Components based on style

by Rexxe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Right, I know that way, but I don't want to I don't want to do that though
Igor.  That seems like really bad practice as I add styles constantly and I
don't want to have to make a code change every time I add a style.  It's
much better for me to just modify the HTML and be done with it without
having to make code changes.  I really think there should be a way to do
this with some sort of comment tag or something.  Maybe there needs to be a
<wicket:comment> tag where the code inside is evaluated so there are no
errors but that the component is hidden.

Thanks for your help,

Andrew

On Thu, Jun 25, 2009 at 8:47 PM, Igor Vaynberg <igor.vaynberg@...>wrote:

> add(new textfield(..) { isvisible() { return
> getsession.getstyle().equals("foo"); }});
>
> -igor
>
> On Thu, Jun 25, 2009 at 8:41 PM, Andrew Berman<atberman@...> wrote:
> > I am using Wicket 1.3 and was wondering if there is a way to hide
> components
> > in the HTML itself.  Here's the issue, say I have two forms and two
> > different styles.  In one style I want to display all the form fields,
> > however in the other one I want to display only a couple of them.  I
> > currently have two HTML files, one for each style, but I can't seem to
> find
> > a way to hide the form fields aside from using CSS and adding
> display:none.
> > Is that the only way to do it?
> >
> > Thanks!
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

RE: Hiding Components based on style

by Rowe, Richard A. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew-

I use an attribute modifier to change styles on the fly. I create a css
with all my styles as "classes". Then I use the AttributeModifier class
to change the class attribute to be the style I want. Hope this helps.

Richard Rowe


-----Original Message-----
From: users-return-39080-RICHARD.A.ROWE=saic.com@...
[mailto:users-return-39080-RICHARD.A.ROWE=saic.com@...] On
Behalf Of Andrew Berman
Sent: Friday, June 26, 2009 2:13 PM
To: users@...
Subject: Re: Hiding Components based on style

Right, I know that way, but I don't want to I don't want to do that
though
Igor.  That seems like really bad practice as I add styles constantly
and I
don't want to have to make a code change every time I add a style.  It's
much better for me to just modify the HTML and be done with it without
having to make code changes.  I really think there should be a way to do
this with some sort of comment tag or something.  Maybe there needs to
be a
<wicket:comment> tag where the code inside is evaluated so there are no
errors but that the component is hidden.

Thanks for your help,

Andrew

On Thu, Jun 25, 2009 at 8:47 PM, Igor Vaynberg
<igor.vaynberg@...>wrote:

> add(new textfield(..) { isvisible() { return
> getsession.getstyle().equals("foo"); }});
>
> -igor
>
> On Thu, Jun 25, 2009 at 8:41 PM, Andrew Berman<atberman@...>
wrote:
> > I am using Wicket 1.3 and was wondering if there is a way to hide
> components
> > in the HTML itself.  Here's the issue, say I have two forms and two
> > different styles.  In one style I want to display all the form
fields,
> > however in the other one I want to display only a couple of them.  I
> > currently have two HTML files, one for each style, but I can't seem
to

> find
> > a way to hide the form fields aside from using CSS and adding
> display:none.
> > Is that the only way to do it?
> >
> > Thanks!
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


RE: Hiding Components based on style

by Rowe, Richard A. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew-

One more thing. I have already added my style sheet to the page like
this:

add(HeaderContributor.forCss("pathto/styles.css"));

Richard


-----Original Message-----
From: users-return-39080-RICHARD.A.ROWE=saic.com@...
[mailto:users-return-39080-RICHARD.A.ROWE=saic.com@...] On
Behalf Of Andrew Berman
Sent: Friday, June 26, 2009 2:13 PM
To: users@...
Subject: Re: Hiding Components based on style

Right, I know that way, but I don't want to I don't want to do that
though
Igor.  That seems like really bad practice as I add styles constantly
and I
don't want to have to make a code change every time I add a style.  It's
much better for me to just modify the HTML and be done with it without
having to make code changes.  I really think there should be a way to do
this with some sort of comment tag or something.  Maybe there needs to
be a
<wicket:comment> tag where the code inside is evaluated so there are no
errors but that the component is hidden.

Thanks for your help,

Andrew

On Thu, Jun 25, 2009 at 8:47 PM, Igor Vaynberg
<igor.vaynberg@...>wrote:

> add(new textfield(..) { isvisible() { return
> getsession.getstyle().equals("foo"); }});
>
> -igor
>
> On Thu, Jun 25, 2009 at 8:41 PM, Andrew Berman<atberman@...>
wrote:
> > I am using Wicket 1.3 and was wondering if there is a way to hide
> components
> > in the HTML itself.  Here's the issue, say I have two forms and two
> > different styles.  In one style I want to display all the form
fields,
> > however in the other one I want to display only a couple of them.  I
> > currently have two HTML files, one for each style, but I can't seem
to

> find
> > a way to hide the form fields aside from using CSS and adding
> display:none.
> > Is that the only way to do it?
> >
> > Thanks!
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Hiding Components based on style

by igor.vaynberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

so you want to include all possible components in the class, but
exclude some in the markup and not have an error? fine, just turn off
componentusecheck in debug settings.

-igor

On Fri, Jun 26, 2009 at 11:13 AM, Andrew Berman<atberman@...> wrote:

> Right, I know that way, but I don't want to I don't want to do that though
> Igor.  That seems like really bad practice as I add styles constantly and I
> don't want to have to make a code change every time I add a style.  It's
> much better for me to just modify the HTML and be done with it without
> having to make code changes.  I really think there should be a way to do
> this with some sort of comment tag or something.  Maybe there needs to be a
> <wicket:comment> tag where the code inside is evaluated so there are no
> errors but that the component is hidden.
>
> Thanks for your help,
>
> Andrew
>
> On Thu, Jun 25, 2009 at 8:47 PM, Igor Vaynberg <igor.vaynberg@...>wrote:
>
>> add(new textfield(..) { isvisible() { return
>> getsession.getstyle().equals("foo"); }});
>>
>> -igor
>>
>> On Thu, Jun 25, 2009 at 8:41 PM, Andrew Berman<atberman@...> wrote:
>> > I am using Wicket 1.3 and was wondering if there is a way to hide
>> components
>> > in the HTML itself.  Here's the issue, say I have two forms and two
>> > different styles.  In one style I want to display all the form fields,
>> > however in the other one I want to display only a couple of them.  I
>> > currently have two HTML files, one for each style, but I can't seem to
>> find
>> > a way to hide the form fields aside from using CSS and adding
>> display:none.
>> > Is that the only way to do it?
>> >
>> > Thanks!
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Hiding Components based on style

by Rexxe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Cool that's what I was looking for Igor.  Thank you!

Also, thank you Richard.  I know of the CSS route, but I really wanted to
not have it show up in the actual HTML as I didn't want someone hacking the
form or being able to turn on the link using something like Web Developer in
Firefox.

Thanks guys!

On Fri, Jun 26, 2009 at 11:24 AM, Igor Vaynberg <igor.vaynberg@...>wrote:

> so you want to include all possible components in the class, but
> exclude some in the markup and not have an error? fine, just turn off
> componentusecheck in debug settings.
>
> -igor
>
> On Fri, Jun 26, 2009 at 11:13 AM, Andrew Berman<atberman@...> wrote:
> > Right, I know that way, but I don't want to I don't want to do that
> though
> > Igor.  That seems like really bad practice as I add styles constantly and
> I
> > don't want to have to make a code change every time I add a style.  It's
> > much better for me to just modify the HTML and be done with it without
> > having to make code changes.  I really think there should be a way to do
> > this with some sort of comment tag or something.  Maybe there needs to be
> a
> > <wicket:comment> tag where the code inside is evaluated so there are no
> > errors but that the component is hidden.
> >
> > Thanks for your help,
> >
> > Andrew
> >
> > On Thu, Jun 25, 2009 at 8:47 PM, Igor Vaynberg <igor.vaynberg@...
> >wrote:
> >
> >> add(new textfield(..) { isvisible() { return
> >> getsession.getstyle().equals("foo"); }});
> >>
> >> -igor
> >>
> >> On Thu, Jun 25, 2009 at 8:41 PM, Andrew Berman<atberman@...>
> wrote:
> >> > I am using Wicket 1.3 and was wondering if there is a way to hide
> >> components
> >> > in the HTML itself.  Here's the issue, say I have two forms and two
> >> > different styles.  In one style I want to display all the form fields,
> >> > however in the other one I want to display only a couple of them.  I
> >> > currently have two HTML files, one for each style, but I can't seem to
> >> find
> >> > a way to hide the form fields aside from using CSS and adding
> >> display:none.
> >> > Is that the only way to do it?
> >> >
> >> > Thanks!
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@...
> >> For additional commands, e-mail: users-help@...
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>