Re: [Stripes-users] DisplayTag and Stripes formatPattern

2010-07-29 Thread Freddy Daoud
Hi Lev,

> along those lines, is there a way to add formatting to
> the 'title' within a  tag? for example:
> 
>   title="Matchups -- ${actionBean.date}">
> 
> is there a way for me add a formatPattern to
> ${actionBean.date} within the 'title'?
> 
> thank you for your time and help.

Yes,  is your friend here:


  Matchups -- 
  


 title="${title}">

Cheers,
Freddy

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users]

2010-07-29 Thread Aaron Stromas
Nikolaos,

Let me get back on topic by rephrasing my original question: why the value
of the "value" attribute disappears from the generated HTML? Documentation
states that, if present, the value attribute provides

  "A default value for the form field. Can be a literal value, or an EL
expression."

 It also reads:

"The hidden tag assigns the value attribute by scanning in the following
order:... by collapsing the body content to a String, if a body is present".

 None of these is happening in my case. The intent of my question was to
find out whether I am doing something wrong or the documentation is
incorrect. It feels that the latter is the case.

And I willingly concede the point that I am ill qualified to get into good
framework design principles debate. [?]

-a

On 29 July 2010 02:13, Nikolaos Giannopoulos wrote:

> Aaron,
>
> Unfortunately frameworks are ideally all about good design and best
> practices... and yes are dogmatic by their very existence... a little
> ironic isn't it... in fact I wouldn't be surprised if Stripes was
> implemented this way deliberately to force avoiding bad practices... but
> can't be sure without looking at the code.
>
> With that said - as M.C.S. pointed out this is getting off topic BUT
> moreover I provided you already with a trivial solution to your issue...
> which you tested and works... and isn't a kludge or anything despite
> your misgivings.  So be happy that it isn't a show stopper or something
> and life goes on... .
>
> Lastly, if you feel so strongly about it then go ahead and file a
> feature enhancement in Stripes and make your "good" design case.  If
> this is truly deliberate in Stripes then IMO they got it right but who
> knows maybe others will see your argument and it might resonate with the
> developer community.
>
> Regards,
>
> --Nikolaos
>
>
>
>
> Aaron Stromas wrote:
> > It is not my intent to start a flee war, but I remain convinced it is
> > better to change one file than two. I am sorry, but Nicolaos' argument
> > sounds dogmatic to me. I know apriori that I will be changing the
> > hidden element to text field in the next stage. When that time comes,
> > I will have to change only the JSP file. My action class does not to
> > be touched.
> >
> > -a
> >
> > On Wednesday, Jly 28, 2010, M.C.S.  wrote:
> >
> >> Hi Nikolaos,
> >>
> >> Am 28.07.2010 21:08, schrieb Nikolaos Giannopoulos:
> >>
> >>
> >>   Aaron Strmas wrote:
> >>   I think that in this case my initial design is
> >> better, because I have to change the JSP later anyway, and it
> >> would be only change to the JSP only. Now I have to make change
> >> in two places
> >>
> >>   But I'm curious why you would have to make changes in 2 places if
> >>   the variable value changes?  I only see a change in 1 place if a
> >>   variable is say called DEFAULT_COUNTRY and its value needs to
> >>   change.  No?
> >>
> >>
> >>
> >> I interpret Aaron's message this way: He will have to change the JSP
> >> for a reason independent of the "magic number". Now he thinks that
> >> by placing the country code there, he improves the design because he
> >> must change just one file instead of two. Following the "Separation
> >> of concerns" principle, this is not the case if the needed changes
> >> just affect the layout, while the change of the country code affect
> >> the business logic. If this was good design, we all should create
> >> god files :-)
> >>
> >> So in my opinion, it is definitely better to place the "US" string
> >> into the bean instead of hard coding it into the JSP. Maybe another
> >> option is using a resource bundle together with an type-safe enum.
> >> This makes globally changing and reusing it somewhere else a lot of
> >> easier.
> >>
> >> But that is not really related to Stripes, so sorry for being
> >> offtopic ;-)
> >>
> >> Regards
> >> Marcus
> >>
> >>
>
>
> --
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> ___
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>



-- 
Aaron Stromas
Mobile: +1 703 203 9169
<<35E.gif>>--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/

Re: [Stripes-users]

2010-07-29 Thread M.C.S.
  Hi Aaron,

Am 29.07.2010 12:50, schrieb Aaron Stromas:
> Let me get back on topic by rephrasing my original question: why the 
> value of the "value" attribute disappears from the generated HTML? 
> Documentation states that, if present, the value attribute provides
>
>   "A default value for the form field. Can be a literal value, or 
> an EL expression."
>
>  It also reads:
>
> "The hidden tag assigns the value attribute by scanning in the 
> following order:... by collapsing the body content to a String, if a 
> body is present".
>
>  None of these is happening in my case. The intent of my question was 
> to find out whether I am doing something wrong or the documentation is 
> incorrect. It feels that the latter is the case.

this usually happens if you are using BeanFirstPopulationStrategy. The 
JavaDoc describes the case that you use the default population strategy, 
which rates request parameters over values within the corresponding 
action bean. Could this be the solution in your case?

Regards
Marcus

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users]

2010-07-29 Thread Aaron Strmas
Yes, absolutely. Thank you, Marcus.

-a

On Jul 29, 2010, at 8:56, "M.C.S."  wrote:

>  Hi Aaron,
> 
> Am 29.07.2010 12:50, schrieb Aaron Stromas:
>> Let me get back on topic by rephrasing my original question: why the 
>> value of the "value" attribute disappears from the generated HTML? 
>> Documentation states that, if present, the value attribute provides
>> 
>>  "A default value for the form field. Can be a literal value, or 
>> an EL expression."
>> 
>> It also reads:
>> 
>> "The hidden tag assigns the value attribute by scanning in the 
>> following order:... by collapsing the body content to a String, if a 
>> body is present".
>> 
>> None of these is happening in my case. The intent of my question was 
>> to find out whether I am doing something wrong or the documentation is 
>> incorrect. It feels that the latter is the case.
> 
> this usually happens if you are using BeanFirstPopulationStrategy. The 
> JavaDoc describes the case that you use the default population strategy, 
> which rates request parameters over values within the corresponding 
> action bean. Could this be the solution in your case?
> 
> Regards
> Marcus
> 
> --
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> ___
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


[Stripes-users] stripes layout

2010-07-29 Thread spliffy

Hi,

I'm using the stripes layout manager. included in my 'header.jsp' is a nav
bar. I'm looking for an elegant way to highlight the currently selected page
in the nav bar. The best I 've come up with so far is to pass a
'pageSelected' parameter in my pages, like so: 



and then have lots of  to check the value in my header.jsp and
apply styles where appropriate. However, it seems so clunky and is not easy
to maintain - is there a more elegant solution that i've missed?

TIA.
-- 
View this message in context: 
http://old.nabble.com/stripes-layout-tp29296412p29296412.html
Sent from the stripes-users mailing list archive at Nabble.com.


--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] stripes layout

2010-07-29 Thread Oscar Westra van Holthe - Kind
On 29-07-2010 at 06:26, spliffy wrote:
> I'm using the stripes layout manager. included in my 'header.jsp' is a nav
> bar. I'm looking for an elegant way to highlight the currently selected page
> in the nav bar. The best I 've come up with so far is to pass a
> 'pageSelected' parameter in my pages, like so: 
> 
> 
> 
> and then have lots of  to check the value in my header.jsp and
> apply styles where appropriate. However, it seems so clunky and is not easy
> to maintain - is there a more elegant solution that i've missed?

You could use CSS, and name your tabs:

ol.menu { /* normal, unselected style */ }
ol.menu li { /* usual style */ }

ol.tab1selected li#tab1,
ol.tab2selected li#tab2,
ol.tab3selected li#tab3 { /* selected style */ }


With a JSP snippet like this:

Tab 1>
Tab 1>
Tab 1>





-- 
   ,-_
  /() ) Oscar Westra van Holthe - Kind  http://www.xs4all.nl/~kindop/
 (__ (
=/  ()  A half truth is a whole lie.  -- Yiddish Proverb


signature.asc
Description: Digital signature
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] stripes layout

2010-07-29 Thread spliffy

I've made it a bit more concise by using just EL instead of  tag in my
menu, for example :-

 about.jsp About Us 

It seems ok I suppose. anything better would be appreciated.

Ta.
-- 
View this message in context: 
http://old.nabble.com/stripes-layout-tp29296412p29296569.html
Sent from the stripes-users mailing list archive at Nabble.com.


--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] stripes layout

2010-07-29 Thread ChopperHarris
Hi,

The truth is that there isn't a 'for-free' solution, but you can come up with 
something moderately elegant if you think about it.

The first thing I did was to write a simple JSP function that replaces the 
ternary operator in JSP el - nothing wrong with that, it just takes a lot of 
typing each time:

public class DisplayFunctions {
  public static String printIfMatches(String s1, String s2, String value) {
if(s1 == null || s2 == null) return "";
if(s1.matches(s2)) return value;
return "";
  }
}

I then use this function to control the output of the 'active' class on my 
menus.

Assuming I have a 'top' menu, which when clicked brings up a contextual 
sub-menu, I group my ActionBeans by package so that I can do something like:



 ${admin}



 ${ordering}


Then in the sub-menus (use a separate JSP file - better still a tag file - to 
make it simple to include), something like:












  



Better still, each repeating block (so , , etc.) should also be 
defined in a separate JSP tag file (with the items that differ - package name, 
etc. - supplied via parameters) so that you can reduce the amount of typing 
further still.

Hope that this helps in some way, or at least gives you something useful to 
think on.

Cheers
Stu




--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] DisplayTag and Stripes formatPattern

2010-07-29 Thread Lev
thank you!

On Thu, Jul 29, 2010 at 5:14 AM, Freddy Daoud  wrote:
> Hi Lev,
>
>> along those lines, is there a way to add formatting to
>> the 'title' within a  tag? for example:
>>
>> >                  title="Matchups -- ${actionBean.date}">
>>
>> is there a way for me add a formatPattern to
>> ${actionBean.date} within the 'title'?
>>
>> thank you for your time and help.
>
> Yes,  is your friend here:
>
> 
>  Matchups --
>  
> 
> 
>                 title="${title}">
>
> Cheers,
> Freddy
>
> --
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> ___
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users