You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by zqzuk <zi...@hotmail.com> on 2006/08/18 13:20:52 UTC
hi, is it possible to do this with tapestry...
Hi, the scenario is that i have a collection of Attendance objects- for
example, Attendance(Student s, String class, String attended) - to be
displayed on a page. and i would like a checkbox (or other components
whichever appropriate) for each row. so if the student attended the class,
user can tick the box. user then ticks those boxes if the student attended
the class, then finally click a button "save", and program will figure out
which Attendance objects are changed and commit database transactions.
so something like this:
-----------------------------------------------------------------------
Student class attended
-----------------------------------------------------------------------
Bob math ticked
Henry physics ticked
Anne english ticked
Nick history unticked
[Save Button]
----------------------------------------------------------------------
each row above represents an Attendance object. the problem is, because the
number of rows are variant, so i m using a For component to produce these
rows automatcally. but how can i know which checkboxex are ticked, and which
checkbox is for which row? as these boxex are produced at runtime and
assigned different names at runtime isnt it? unlike the DirectLink component
which can pass parameters such as the object's id, how does a checkbox (or
if other appropriate components) identify the row?
i could use directlink instead and open up another window where user tick
the box in a separate page for each Attendance row, but that would be bad
design...
any suggestions pleaes, thanks very much!
--
View this message in context: http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5867937
Sent from the Tapestry - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: hi, is it possible to do this with tapestry...
Posted by zqzuk <zi...@hotmail.com>.
thanks so much! i ll have a go with it!
karthik.nar wrote:
>
> based on
>
> <component id="tickbox" type="CheckBox">
> <binding name="value" value="currentAttendance.attended"/>
> </component>
>
> when you submit, then the value from the check box will be automatically
> inserted into currentAttendance.attended - you don't need to do anything.
>
> if you don't want to change the datatype of the Attendance domain objects,
> then you can just have the following methods on your attendance class:
>
> boolean isAttended()
> setIsAttended(boolean)
>
> which can behave as a bridge between the checkbox and the underlying
> Attendance domain methods.
>
> You can also use translators to bridge this, i don't have a ready example.
>
> Another alternative is to use InvokeListener on the Page to be able to
> reassemble your attendance object before the submit method on the page
> gets
> called.
>
> As you can see there are many ways to do it. I'm in the middle of
> something
> so can't explain more elaborately as this point, but if you get stuck
> further will be happy to help in the next day or two.
>
> On 8/18/06, zqzuk <zi...@hotmail.com> wrote:
>>
>>
>> hi, thanks for prompt reply,
>>
>> "then you just need to bind the checkbox value to a
>> currentAttendance.persentognl"
>>
>> sorry could you be more specific about this please? i still dont quite
>> understand. like this?
>>
>>
>> <property name="currentAttendance"/>
>> <component id="attendances" type="For">
>> <binding name="source" value="attendances"/>
>> <binding name="value" value="currentAttendance"/>
>> <binding name="element" value="literal:tr"/>
>> </component>
>> <component id="student" type="Insert">
>> <binding name="value" value="currentAttendance.student.name"/>
>> </component>
>> <component id="classname" type="Insert">
>> <binding name="value" value="currentAttendance.classname"/>
>> </component>
>> <component id="tickbox" type="CheckBox">
>> <binding name="value" value="currentAttendance.attended"/>
>> </component>
>>
>>
>> then i suppose i need to change Attendance.attended to boolean type?
>>
>> also, when SAVE is clicked, how can i update each object? would it be:
>>
>> for each(element in getAttendances()){
>> getCurrentAttendance().set...... // but how can i get the variable
>> values of each attendance
>> }
>>
>> thanks alot!
>>
>>
>>
>>
>>
>>
>>
>> karthik.nar wrote:
>> >
>> > you should ensure that the Attendance list provided to the For loop is
>> > exactly the same both during render and rewind.
>> >
>> > then, irrespective of the number of rows the render/rewind sequence
>> will
>> > be
>> > exactly the same.
>> >
>> > so the checkbox on render will correspond to the same Attendance
>> object
>> > when the rewind happens.
>> >
>> > then you just need to bind the checkbox value to a
>> > currentAttendance.persentognl
>> >
>> >
>> > On 8/18/06, zqzuk <zi...@hotmail.com> wrote:
>> >>
>> >>
>> >> Hi, the scenario is that i have a collection of Attendance objects-
>> for
>> >> example, Attendance(Student s, String class, String attended) - to be
>> >> displayed on a page. and i would like a checkbox (or other components
>> >> whichever appropriate) for each row. so if the student attended the
>> >> class,
>> >> user can tick the box. user then ticks those boxes if the student
>> >> attended
>> >> the class, then finally click a button "save", and program will figure
>> >> out
>> >> which Attendance objects are changed and commit database transactions.
>> >>
>> >> so something like this:
>> >>
>> >>
>> -----------------------------------------------------------------------
>> >> Student class attended
>> >>
>> -----------------------------------------------------------------------
>> >> Bob math ticked
>> >> Henry physics ticked
>> >> Anne english ticked
>> >> Nick history unticked
>> >>
>> >> [Save Button]
>> >> ----------------------------------------------------------------------
>> >>
>> >> each row above represents an Attendance object. the problem is,
>> because
>> >> the
>> >> number of rows are variant, so i m using a For component to produce
>> these
>> >> rows automatcally. but how can i know which checkboxex are ticked, and
>> >> which
>> >> checkbox is for which row? as these boxex are produced at runtime and
>> >> assigned different names at runtime isnt it? unlike the DirectLink
>> >> component
>> >> which can pass parameters such as the object's id, how does a checkbox
>> >> (or
>> >> if other appropriate components) identify the row?
>> >>
>> >> i could use directlink instead and open up another window where user
>> tick
>> >> the box in a separate page for each Attendance row, but that would be
>> bad
>> >> design...
>> >>
>> >> any suggestions pleaes, thanks very much!
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5867937
>> >> Sent from the Tapestry - User forum at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> >> For additional commands, e-mail: users-help@tapestry.apache.org
>> >>
>> >>
>> >
>> >
>> > --
>> > Thanks, Karthik
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5868510
>> Sent from the Tapestry - User forum at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> --
> Thanks, Karthik
>
>
--
View this message in context: http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5869233
Sent from the Tapestry - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: hi, is it possible to do this with tapestry...
Posted by Karthik N <ka...@gmail.com>.
based on
<component id="tickbox" type="CheckBox">
<binding name="value" value="currentAttendance.attended"/>
</component>
when you submit, then the value from the check box will be automatically
inserted into currentAttendance.attended - you don't need to do anything.
if you don't want to change the datatype of the Attendance domain objects,
then you can just have the following methods on your attendance class:
boolean isAttended()
setIsAttended(boolean)
which can behave as a bridge between the checkbox and the underlying
Attendance domain methods.
You can also use translators to bridge this, i don't have a ready example.
Another alternative is to use InvokeListener on the Page to be able to
reassemble your attendance object before the submit method on the page gets
called.
As you can see there are many ways to do it. I'm in the middle of something
so can't explain more elaborately as this point, but if you get stuck
further will be happy to help in the next day or two.
On 8/18/06, zqzuk <zi...@hotmail.com> wrote:
>
>
> hi, thanks for prompt reply,
>
> "then you just need to bind the checkbox value to a
> currentAttendance.persentognl"
>
> sorry could you be more specific about this please? i still dont quite
> understand. like this?
>
>
> <property name="currentAttendance"/>
> <component id="attendances" type="For">
> <binding name="source" value="attendances"/>
> <binding name="value" value="currentAttendance"/>
> <binding name="element" value="literal:tr"/>
> </component>
> <component id="student" type="Insert">
> <binding name="value" value="currentAttendance.student.name"/>
> </component>
> <component id="classname" type="Insert">
> <binding name="value" value="currentAttendance.classname"/>
> </component>
> <component id="tickbox" type="CheckBox">
> <binding name="value" value="currentAttendance.attended"/>
> </component>
>
>
> then i suppose i need to change Attendance.attended to boolean type?
>
> also, when SAVE is clicked, how can i update each object? would it be:
>
> for each(element in getAttendances()){
> getCurrentAttendance().set...... // but how can i get the variable
> values of each attendance
> }
>
> thanks alot!
>
>
>
>
>
>
>
> karthik.nar wrote:
> >
> > you should ensure that the Attendance list provided to the For loop is
> > exactly the same both during render and rewind.
> >
> > then, irrespective of the number of rows the render/rewind sequence will
> > be
> > exactly the same.
> >
> > so the checkbox on render will correspond to the same Attendance object
> > when the rewind happens.
> >
> > then you just need to bind the checkbox value to a
> > currentAttendance.persentognl
> >
> >
> > On 8/18/06, zqzuk <zi...@hotmail.com> wrote:
> >>
> >>
> >> Hi, the scenario is that i have a collection of Attendance objects- for
> >> example, Attendance(Student s, String class, String attended) - to be
> >> displayed on a page. and i would like a checkbox (or other components
> >> whichever appropriate) for each row. so if the student attended the
> >> class,
> >> user can tick the box. user then ticks those boxes if the student
> >> attended
> >> the class, then finally click a button "save", and program will figure
> >> out
> >> which Attendance objects are changed and commit database transactions.
> >>
> >> so something like this:
> >>
> >> -----------------------------------------------------------------------
> >> Student class attended
> >> -----------------------------------------------------------------------
> >> Bob math ticked
> >> Henry physics ticked
> >> Anne english ticked
> >> Nick history unticked
> >>
> >> [Save Button]
> >> ----------------------------------------------------------------------
> >>
> >> each row above represents an Attendance object. the problem is, because
> >> the
> >> number of rows are variant, so i m using a For component to produce
> these
> >> rows automatcally. but how can i know which checkboxex are ticked, and
> >> which
> >> checkbox is for which row? as these boxex are produced at runtime and
> >> assigned different names at runtime isnt it? unlike the DirectLink
> >> component
> >> which can pass parameters such as the object's id, how does a checkbox
> >> (or
> >> if other appropriate components) identify the row?
> >>
> >> i could use directlink instead and open up another window where user
> tick
> >> the box in a separate page for each Attendance row, but that would be
> bad
> >> design...
> >>
> >> any suggestions pleaes, thanks very much!
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5867937
> >> Sent from the Tapestry - User forum at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >
> >
> > --
> > Thanks, Karthik
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5868510
> Sent from the Tapestry - User forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Thanks, Karthik
Re: hi, is it possible to do this with tapestry...
Posted by zqzuk <zi...@hotmail.com>.
hi, thanks for prompt reply,
"then you just need to bind the checkbox value to a
currentAttendance.persentognl"
sorry could you be more specific about this please? i still dont quite
understand. like this?
<property name="currentAttendance"/>
<component id="attendances" type="For">
<binding name="source" value="attendances"/>
<binding name="value" value="currentAttendance"/>
<binding name="element" value="literal:tr"/>
</component>
<component id="student" type="Insert">
<binding name="value" value="currentAttendance.student.name"/>
</component>
<component id="classname" type="Insert">
<binding name="value" value="currentAttendance.classname"/>
</component>
<component id="tickbox" type="CheckBox">
<binding name="value" value="currentAttendance.attended"/>
</component>
then i suppose i need to change Attendance.attended to boolean type?
also, when SAVE is clicked, how can i update each object? would it be:
for each(element in getAttendances()){
getCurrentAttendance().set...... // but how can i get the variable
values of each attendance
}
thanks alot!
karthik.nar wrote:
>
> you should ensure that the Attendance list provided to the For loop is
> exactly the same both during render and rewind.
>
> then, irrespective of the number of rows the render/rewind sequence will
> be
> exactly the same.
>
> so the checkbox on render will correspond to the same Attendance object
> when the rewind happens.
>
> then you just need to bind the checkbox value to a
> currentAttendance.persentognl
>
>
> On 8/18/06, zqzuk <zi...@hotmail.com> wrote:
>>
>>
>> Hi, the scenario is that i have a collection of Attendance objects- for
>> example, Attendance(Student s, String class, String attended) - to be
>> displayed on a page. and i would like a checkbox (or other components
>> whichever appropriate) for each row. so if the student attended the
>> class,
>> user can tick the box. user then ticks those boxes if the student
>> attended
>> the class, then finally click a button "save", and program will figure
>> out
>> which Attendance objects are changed and commit database transactions.
>>
>> so something like this:
>>
>> -----------------------------------------------------------------------
>> Student class attended
>> -----------------------------------------------------------------------
>> Bob math ticked
>> Henry physics ticked
>> Anne english ticked
>> Nick history unticked
>>
>> [Save Button]
>> ----------------------------------------------------------------------
>>
>> each row above represents an Attendance object. the problem is, because
>> the
>> number of rows are variant, so i m using a For component to produce these
>> rows automatcally. but how can i know which checkboxex are ticked, and
>> which
>> checkbox is for which row? as these boxex are produced at runtime and
>> assigned different names at runtime isnt it? unlike the DirectLink
>> component
>> which can pass parameters such as the object's id, how does a checkbox
>> (or
>> if other appropriate components) identify the row?
>>
>> i could use directlink instead and open up another window where user tick
>> the box in a separate page for each Attendance row, but that would be bad
>> design...
>>
>> any suggestions pleaes, thanks very much!
>> --
>> View this message in context:
>> http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5867937
>> Sent from the Tapestry - User forum at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> --
> Thanks, Karthik
>
>
--
View this message in context: http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5868510
Sent from the Tapestry - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Can you always have valid html with tapestry templates?
Posted by Denis McCarthy <dm...@annadaletech.com>.
That works! Thanks
andyhot wrote:
> Use:
> <table>
> <tr><td>blah blah</td></tr>
>
> <tr jwcid="leftMenu@Foreach" elemente="tr"...>
> stuff iterated over by the foreach
> </tr>
>
> </table>
>
> Denis McCarthy wrote:
>> Hi,
>> I have tables that are populated by a @ForEach component in my html.
>> The html template is like this
>> <table>
>> <tr><td>blah blah</td></tr>
>>
>> <span jwcid="leftMenu@Foreach ...>
>> <tr> - stuff iterated over by the foreach </tr>
>> </span
>> </table>
>>
>> Now I recently upgraded to eclipse callisto using the Web tools
>> project, and the html validator is complaining that the above is not
>> valid html (which, in fairness it isn't, as the span occurs within a
>> table but not within a td). Is there some html-compliant way to
>> structure this, or will I have to live with my tapestry templates
>> being non-html compliant?
>> TIA
>> Denis
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Can you always have valid html with tapestry templates?
Posted by andyhot <an...@di.uoa.gr>.
There are issues with the namespace approach as well.
For instance, how about informal parameters?
If you want to go with the valid XHTML approach for templates,
you'd have to indeed use a namespace, allow tapestry:jwcid
for all elements and specify all additional parameters (required,
formal, informal)
in your jwc or with annotation.
But anyway, more important to me is having the generated code pass
validation.
I think there was a similar discussion a year ago in this list - if you
can search
for it, you might find more info :)
Xiaoshu Wang wrote:
> I don't see that as a valid HTML yet. The jwcid attribute is not specified
> in HTML. Maybe Tapestry should put up a namespace for its tag. So, we can
> use
>
> <span tapestry:jwcid="leftMenu@For" tapestry:element="tr" ...
>
> It will make it at least an XHTML document.
>
> Xiaoshu
>
>> Use:
>> <table>
>> <tr><td>blah blah</td></tr>
>>
>> <tr jwcid="leftMenu@Foreach" elemente="tr"...> stuff iterated
>> over by the foreach </tr>
>>
>> </table>
>>
>> Denis McCarthy wrote:
>>
>>> Hi,
>>> I have tables that are populated by a @ForEach component in my html.
>>> The html template is like this
>>> <table>
>>> <tr><td>blah blah</td></tr>
>>>
>>> <span jwcid="leftMenu@Foreach ...>
>>> <tr> - stuff iterated over by the foreach </tr> </span </table>
>>>
>>> Now I recently upgraded to eclipse callisto using the Web tools
>>> project, and the html validator is complaining that the
>>>
>> above is not
>>
>>> valid html (which, in fairness it isn't, as the span occurs
>>>
>> within a
>>
>>> table but not within a td). Is there some html-compliant way to
>>> structure this, or will I have to live with my tapestry templates
>>> being non-html compliant?
>>> TIA
>>> Denis
>>>
>>>
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>>
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>> --
>> Andreas Andreou - andyhot@apache.org -
>> http://andyhot.di.uoa.gr Tapestry / Tacos developer Open
>> Source / J2EE Consulting
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: Can you always have valid html with tapestry templates?
Posted by Xiaoshu Wang <wa...@musc.edu>.
I don't see that as a valid HTML yet. The jwcid attribute is not specified
in HTML. Maybe Tapestry should put up a namespace for its tag. So, we can
use
<span tapestry:jwcid="leftMenu@For" tapestry:element="tr" ...
It will make it at least an XHTML document.
Xiaoshu
> Use:
> <table>
> <tr><td>blah blah</td></tr>
>
> <tr jwcid="leftMenu@Foreach" elemente="tr"...> stuff iterated
> over by the foreach </tr>
>
> </table>
>
> Denis McCarthy wrote:
> > Hi,
> > I have tables that are populated by a @ForEach component in my html.
> > The html template is like this
> > <table>
> > <tr><td>blah blah</td></tr>
> >
> > <span jwcid="leftMenu@Foreach ...>
> > <tr> - stuff iterated over by the foreach </tr> </span </table>
> >
> > Now I recently upgraded to eclipse callisto using the Web tools
> > project, and the html validator is complaining that the
> above is not
> > valid html (which, in fairness it isn't, as the span occurs
> within a
> > table but not within a td). Is there some html-compliant way to
> > structure this, or will I have to live with my tapestry templates
> > being non-html compliant?
> > TIA
> > Denis
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> Andreas Andreou - andyhot@apache.org -
> http://andyhot.di.uoa.gr Tapestry / Tacos developer Open
> Source / J2EE Consulting
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Can you always have valid html with tapestry templates?
Posted by andyhot <an...@di.uoa.gr>.
Use:
<table>
<tr><td>blah blah</td></tr>
<tr jwcid="leftMenu@Foreach" elemente="tr"...>
stuff iterated over by the foreach
</tr>
</table>
Denis McCarthy wrote:
> Hi,
> I have tables that are populated by a @ForEach component in my html.
> The html template is like this
> <table>
> <tr><td>blah blah</td></tr>
>
> <span jwcid="leftMenu@Foreach ...>
> <tr> - stuff iterated over by the foreach </tr>
> </span
> </table>
>
> Now I recently upgraded to eclipse callisto using the Web tools
> project, and the html validator is complaining that the above is not
> valid html (which, in fairness it isn't, as the span occurs within a
> table but not within a td). Is there some html-compliant way to
> structure this, or will I have to live with my tapestry templates
> being non-html compliant?
> TIA
> Denis
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Can you always have valid html with tapestry templates?
Posted by Denis McCarthy <dm...@annadaletech.com>.
Hi,
I have tables that are populated by a @ForEach component in my html. The
html template is like this
<table>
<tr><td>blah blah</td></tr>
<span jwcid="leftMenu@Foreach ...>
<tr> - stuff iterated over by the foreach </tr>
</span
</table>
Now I recently upgraded to eclipse callisto using the Web tools project,
and the html validator is complaining that the above is not valid html
(which, in fairness it isn't, as the span occurs within a table but not
within a td). Is there some html-compliant way to structure this, or
will I have to live with my tapestry templates being non-html compliant?
TIA
Denis
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: it works!
Posted by Karthik N <ka...@gmail.com>.
i don't have an exact explanation till i view your source code.
i'm glad it works, so maybe you can do some more research to see why the
volatile makes the difference for the ticked/unticked issue of yours.
your understanding of volatile is incorrect.
in fact, with volatile="false" the For component serliazes your domain
objects and sends them to the client as hidden fields. with volatile="true"
the for component evaluates from your source list every time. you have to
thus ensure that your source list is consistent for the render and rewind.
you can see this difference by viewing the HTML source with and without the
volatile to see the difference in the source.
On 8/20/06, zqzuk <zi...@hotmail.com> wrote:
>
>
> hi, thanks so much! it works! could you please explain why is this? i read
> the link, it says
>
> "Determines whether to avoid creating hidden fields within a form. Using
> this parameter may make the form structure different during render and
> rewind, and cause exceptions as a result. Please use with caution. "
>
> by setting volatile=true i suppose it allows hidden fields in the form? i
> dont have a hidden component at all, so does FOR component creates such a
> component automatically? for what purpose?
>
> again thanks very much!
>
>
> --
> View this message in context:
> http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5894560
> Sent from the Tapestry - User forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Thanks, Karthik
it works!
Posted by zqzuk <zi...@hotmail.com>.
hi, thanks so much! it works! could you please explain why is this? i read
the link, it says
"Determines whether to avoid creating hidden fields within a form. Using
this parameter may make the form structure different during render and
rewind, and cause exceptions as a result. Please use with caution. "
by setting volatile=true i suppose it allows hidden fields in the form? i
dont have a hidden component at all, so does FOR component creates such a
component automatically? for what purpose?
again thanks very much!
--
View this message in context: http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5894560
Sent from the Tapestry - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Link to external application
Posted by Shing Hing Man <ma...@yahoo.com>.
Have you looked at the GenericLink or Any component ?
http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/GenericLink.html
http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/Any.html
Shing
--- Josh Joy <jo...@yahoo.com> wrote:
> Hi All,
>
> I have a newbie question...in my tapestry
> application based on user input I am generating
> links to external websites, for instance the user
> will input their address and I would to return back
> to them thru html <a href> tags a link to the
> mapquest page with the map information.
>
> The difficulty I'm having is how to generate links
> to external applications? The only tapestry
> components I'm familiar with is PageLink and
> DirectLink, though it seems that use is for linking
> within the same tapestry application. Any
> suggestions?
>
> Thanks,
> Josh
>
Home page :
http://uk.geocities.com/matmsh/index.html
___________________________________________________________
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine
http://uk.docs.yahoo.com/nowyoucan.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Link to external application
Posted by Josh Joy <jo...@yahoo.com>.
Hi All,
I have a newbie question...in my tapestry application based on user input I am generating links to external websites, for instance the user will input their address and I would to return back to them thru html <a href> tags a link to the mapquest page with the map information.
The difficulty I'm having is how to generate links to external applications? The only tapestry components I'm familiar with is PageLink and DirectLink, though it seems that use is for linking within the same tapestry application. Any suggestions?
Thanks,
Josh
Re: its working, but a problem
Posted by Karthik N <ka...@gmail.com>.
Hmm. rather bizzare. Can you try setting volatile="true" on the For
component and see how it goes?
http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/For.html
On 8/20/06, zqzuk <zi...@hotmail.com> wrote:
>
>
> Hi, thanks for your hints, and its working, generally, but i m stuck with
> a
> problem which i doubt if its a bug?
>
> suppose my form produces rows such like this, data are retrieved from
> databases
>
> -------------------------------------------------------
> name attended
> ------------------------------------------------------
> john ticked
> henry unticked
> -----------------------------------------------------
>
> and now i change change it by checking the boxes to
>
> -------------------------------------------------------
> name attended
> ------------------------------------------------------
> john unticked
> henry ticked
> -----------------------------------------------------
>
> and click Submit. supprisingly, i got such result:
> -------------------------------------------------------
> name attended
> ------------------------------------------------------
> john ticked
> henry ticked
> -----------------------------------------------------
>
>
> then again i unchecked the box for john on the last page produced by the
> first submit, and submitted
> the form again, and again surprisingly i got the correct result:
> -------------------------------------------------------
> name attended
> ------------------------------------------------------
> john unticked
> henry ticked
> -----------------------------------------------------
>
>
> i tried this many times, it keeps doin the same:
>
> when the page is loaded with some boxes ticked and some unticked, if i
> untick the ticked boxex, and tick some unticked boxes and then submit the
> form. on first submit, those originally unticked boxex are all ticked,
> producing the correct result; however, those origianlly ticked boxes are
> still ticked, although i did untick them before submitting; then if i do
> untick again for all ticked boxes and submit the form for the second time,
> i
> got correct result - i.e. originally ticked boxes are unticked this time.
> and if i do 3rd, 4th ... submit its all correct. its just the first submit
> that produce incorrect result for orginally ticked boxes!
>
> i m not sure if theres something wrong with my code but i dont think so
> cause the 2nd, 3rd, 4th ... submits work correctly.... wat have i done
> wrong? any hints please, thanks!
> --
> View this message in context:
> http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5894223
> Sent from the Tapestry - User forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Thanks, Karthik
RE: its working, but a problem
Posted by zqzuk <zi...@hotmail.com>.
sry! will do that. thnx anyway
Detlef Schulze wrote:
>
> <sigh> Like always: please post some code, it is quite hard to guess
> what you did wrong when it is not visible WHAT you did exactly
>
> cheers,
> detlef
>
>
> -----Original Message-----
> From: zqzuk [mailto:ziqi.zhang@hotmail.com]
> Sent: Sonntag, 20. August 2006 17:15
> To: users@tapestry.apache.org
> Subject: its working, but a problem
>
>
> Hi, thanks for your hints, and its working, generally, but i m stuck
> with a
> problem which i doubt if its a bug?
>
> suppose my form produces rows such like this, data are retrieved from
> databases
>
> -------------------------------------------------------
> name attended
> ------------------------------------------------------
> john ticked
> henry unticked
> -----------------------------------------------------
>
> and now i change change it by checking the boxes to
>
> -------------------------------------------------------
> name attended
> ------------------------------------------------------
> john unticked
> henry ticked
> -----------------------------------------------------
>
> and click Submit. supprisingly, i got such result:
> -------------------------------------------------------
> name attended
> ------------------------------------------------------
> john ticked
> henry ticked
> -----------------------------------------------------
>
>
> then again i unchecked the box for john on the last page produced by the
> first submit, and submitted
> the form again, and again surprisingly i got the correct result:
> -------------------------------------------------------
> name attended
> ------------------------------------------------------
> john unticked
> henry ticked
> -----------------------------------------------------
>
>
> i tried this many times, it keeps doin the same:
>
> when the page is loaded with some boxes ticked and some unticked, if i
> untick the ticked boxex, and tick some unticked boxes and then submit
> the
> form. on first submit, those originally unticked boxex are all ticked,
> producing the correct result; however, those origianlly ticked boxes are
> still ticked, although i did untick them before submitting; then if i do
> untick again for all ticked boxes and submit the form for the second
> time, i
> got correct result - i.e. originally ticked boxes are unticked this
> time.
> and if i do 3rd, 4th ... submit its all correct. its just the first
> submit
> that produce incorrect result for orginally ticked boxes!
>
> i m not sure if theres something wrong with my code but i dont think so
> cause the 2nd, 3rd, 4th ... submits work correctly.... wat have i done
> wrong? any hints please, thanks!
> --
> View this message in context:
> http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-t
> f2126696.html#a5894223
> Sent from the Tapestry - User forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5894621
Sent from the Tapestry - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
its working, but a problem
Posted by zqzuk <zi...@hotmail.com>.
Hi, thanks for your hints, and its working, generally, but i m stuck with a
problem which i doubt if its a bug?
suppose my form produces rows such like this, data are retrieved from
databases
-------------------------------------------------------
name attended
------------------------------------------------------
john ticked
henry unticked
-----------------------------------------------------
and now i change change it by checking the boxes to
-------------------------------------------------------
name attended
------------------------------------------------------
john unticked
henry ticked
-----------------------------------------------------
and click Submit. supprisingly, i got such result:
-------------------------------------------------------
name attended
------------------------------------------------------
john ticked
henry ticked
-----------------------------------------------------
then again i unchecked the box for john on the last page produced by the
first submit, and submitted
the form again, and again surprisingly i got the correct result:
-------------------------------------------------------
name attended
------------------------------------------------------
john unticked
henry ticked
-----------------------------------------------------
i tried this many times, it keeps doin the same:
when the page is loaded with some boxes ticked and some unticked, if i
untick the ticked boxex, and tick some unticked boxes and then submit the
form. on first submit, those originally unticked boxex are all ticked,
producing the correct result; however, those origianlly ticked boxes are
still ticked, although i did untick them before submitting; then if i do
untick again for all ticked boxes and submit the form for the second time, i
got correct result - i.e. originally ticked boxes are unticked this time.
and if i do 3rd, 4th ... submit its all correct. its just the first submit
that produce incorrect result for orginally ticked boxes!
i m not sure if theres something wrong with my code but i dont think so
cause the 2nd, 3rd, 4th ... submits work correctly.... wat have i done
wrong? any hints please, thanks!
--
View this message in context: http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5894223
Sent from the Tapestry - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: hi, is it possible to do this with tapestry...
Posted by Karthik N <ka...@gmail.com>.
you should ensure that the Attendance list provided to the For loop is
exactly the same both during render and rewind.
then, irrespective of the number of rows the render/rewind sequence will be
exactly the same.
so the checkbox on render will correspond to the same Attendance object
when the rewind happens.
then you just need to bind the checkbox value to a currentAttendance.persentognl
On 8/18/06, zqzuk <zi...@hotmail.com> wrote:
>
>
> Hi, the scenario is that i have a collection of Attendance objects- for
> example, Attendance(Student s, String class, String attended) - to be
> displayed on a page. and i would like a checkbox (or other components
> whichever appropriate) for each row. so if the student attended the class,
> user can tick the box. user then ticks those boxes if the student attended
> the class, then finally click a button "save", and program will figure out
> which Attendance objects are changed and commit database transactions.
>
> so something like this:
>
> -----------------------------------------------------------------------
> Student class attended
> -----------------------------------------------------------------------
> Bob math ticked
> Henry physics ticked
> Anne english ticked
> Nick history unticked
>
> [Save Button]
> ----------------------------------------------------------------------
>
> each row above represents an Attendance object. the problem is, because
> the
> number of rows are variant, so i m using a For component to produce these
> rows automatcally. but how can i know which checkboxex are ticked, and
> which
> checkbox is for which row? as these boxex are produced at runtime and
> assigned different names at runtime isnt it? unlike the DirectLink
> component
> which can pass parameters such as the object's id, how does a checkbox (or
> if other appropriate components) identify the row?
>
> i could use directlink instead and open up another window where user tick
> the box in a separate page for each Attendance row, but that would be bad
> design...
>
> any suggestions pleaes, thanks very much!
> --
> View this message in context:
> http://www.nabble.com/hi%2C-is-it-possible-to-do-this-with-tapestry...-tf2126696.html#a5867937
> Sent from the Tapestry - User forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Thanks, Karthik