Hi Joris,
this article: http://www.ibm.com/developerworks/java/library/j-facelets/
was of great value to me some time ago. I suggest you take a looks.
Cheers,
On Wed, Jun 18, 2008 at 12:31 PM, Joris Kimpe <[EMAIL PROTECTED]> wrote:
>
> To be honest, I want to stick to JSF (especially Trinidad, so no Tomahawk)
> if
> this is possible. So, could you give me a small example of how I can use a
> var from fist.jsp in second.jsp?
>
> So something like this:
>
> first.jsp
> <tr:table id="tableId" value="#{backingBean.dataModel}" var="row">
> ... call second.jsp or something like that (like it was a
> component)
> </tr:table>
>
>
> second.jsp
> <tr:inputText id="textId" value="#{var.text}"/>
>
>
>
>
>
> Andrew Robinson-5 wrote:
> >
> > 1) use facelets
> > 2) honestly, use facelets, JSPs stink
> > 3) well if you must...
> > 4) are you really sure you want to stick with JSP, a failed technology?
> > 5) okay, don't use params. JSP includes do not change the JSF scopes.
> > Therefore, as long as you are not using JSTL tags in your include, you
> > don't need to use JSP tags at all except for the include. If you need
> > to change the name of a EL so that there is one standard for your
> > include to use, have a look at the tomahawk alias bean:
> > http://myfaces.apache.org/tomahawk/tlddoc/t/aliasBean.html
> >
> > Basically, if you are using JSF, try to stay 100% in JSF and not use
> > JSP as much as possible as it only creates confusion. Even if you
> > understand it, someone maintaining the code may not. As a result it is
> > always best to stick with 100% JSF tags and components.
> >
> > As for #2-4 I couldn't resist sharing my opinion ;)
> >
> > -Andrew
> >
> > On Wed, Jun 18, 2008 at 1:44 AM, Joris Kimpe <[EMAIL PROTECTED]> wrote:
> >>
> >> Great article!
> >>
> >> How do you suggest how I should do this? I have 3 pages using the same
> >> panelPopup (which is in second.jsp). For maintenance and redundancy
> >> reasons
> >> I want to write this panelPopup only once (and include it somehow in my
> 3
> >> pages). I thought jsp:include should do the trick, but this didn't
> >> work...
> >>
> >> Joris
> >>
> >>
> >>
> >> Andrew Robinson-5 wrote:
> >>>
> >>> Read this:
> >>>
> >>>
> http://andrewfacelets.blogspot.com/2008/03/build-time-vs-render-time.html
> >>>
> >>> On Tue, Jun 17, 2008 at 8:54 AM, Joris Kimpe <[EMAIL PROTECTED]>
> wrote:
> >>>>
> >>>> Hello group,
> >>>>
> >>>> I have a jsp (containing Trinidad components), and I want to include a
> >>>> second jsp page (using jsp:include). I'd like to pass a backing bean
> >>>> parameter to the included page (so I can use this value in a
> javascript
> >>>> function), but how can I do this?
> >>>>
> >>>> It appears to be impossible to use "#{row.shiftId}" inside the onclick
> >>>> attribute (which is in the included jsp). Or am I wrong? Also using
> >>>> ${param.shiftId} results in an error:
> >>>> According to TLD or attribute directive in tag file, attribute onclick
> >>>> does
> >>>> not accept any expressions
> >>>>
> >>>>
> >>>>
> >>>> These are my jsp files:
> >>>>
> >>>> first.jsp
> >>>>
> -------------------------------------------------------------------------------
> >>>> ...
> >>>> <f:subview id="overviewPage">
> >>>> <tr:table id="overviewTable" value="#{backingBean.dataModel}"
> >>>> var="row">
> >>>> ...
> >>>> <tr:panelFormLayout>
> >>>> <tr:table id="results" value="#{row.results}"
> >>>> var="result">
> >>>> <tr:column>
> >>>> <tr:outputLabel
> >>>> value="#{result.shift}"/>
> >>>> </tr:column>
> >>>> </tr:table>
> >>>>
> >>>>
> >>>> <jsp:include page="second.jsp">
> >>>> <jsp:param name="shiftId"
> >>>> value="#{row.shiftId}"/>
> >>>> </jsp:include>
> >>>> </tr:panelFormLayout>
> >>>> ...
> >>>> </tr:table>
> >>>> </f:subview>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> second.jsp
> >>>>
> -------------------------------------------------------------------------------
> >>>> <f:subview id="createAbsence">
> >>>> <tr:panelPopup onclick="jsFunction('${param.shiftId}');"
> >>>> text="create"
> >>>> modal="true" position="relative">
> >>>> <tr:selectOneChoice label="type"
> >>>> value="#{backingBean.type}"
> >>>> required="yes" immediate="true">
> >>>> <f:selectItems
> >>>> value="#{personalShiftPlanOverviewActions.absenceTypes}"
> >>>> />
> >>>> </tr:selectOneChoice>
> >>>> ...
> >>>> </tr:panelPopup>
> >>>> </f:subview>
> >>>>
> >>>>
> >>>> Thanks for your help!
> >>>>
> >>>> Joris
> >>>> --
> >>>> View this message in context:
> >>>>
> http://www.nabble.com/-TRINIDAD--include-jsp-using-param-tp17912565p17912565.html
> >>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>>>
> >>>>
> >>>
> >>>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/-TRINIDAD--include-jsp-using-param-tp17912565p17961427.html
> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/-TRINIDAD--include-jsp-using-param-tp17912565p17985352.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>
--
Walter Mourão
http://waltermourao.com.br
http://waltermourao.blogspot.com
http://arcadian.com.br