You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Max Grigoriev <da...@mail.ru> on 2003/10/08 10:41:20 UTC
Don't let me die :(
Hello Tapestry-User,
I've asked these question already but nobody said something.
Please don't ignore, answer it or just say it's impossible to
implement in Tapestry.
First:
When i restart the engine, i clean visit object, but all
properties of pages with persistent="yes" save their state.
How can i clean these properties ?
Second question:
I've got such foreach:
<span jwcid="@Foreach" source="ognl:bean.currentCategory.children" value="ognl:bean.currentSubCategory">
<tr jwcid="subCategory">
<td><input jwcid="@Radio" type="radio" value="ognl:bean.currentSubCategory" /></td>
<td><span jwcid="@Insert"
value="ognl:bean.currentSubCategory.code"/></td>
<td><span jwcid="@Insert"
value="ognl:bean.currentSubCategory.description"/></td>
<tr>
</span>
I need that user clicks on text and radio button is checked or
unchecked.
In statis html i can do it such way :
<script>
function setCheck(id) {
var myRadio = document.getElementById(id);
myRadio.checked = !myRadio.checked;
}
<script>
<tr>
<td><input id="radio0" type="radio"/></td>
<td onlick="setCheck('radio0')">Code text</td>
<td onlick="setCheck('radio0')">Description text</td>
<tr>
<tr>
<td><input id="radio1" type="radio"/></td>
<td onlick="setCheck('radio1')">Code text 1</td>
<td onlick="setCheck('radio1')">Description text 1</td>
<tr>
How can i do it in Tapestry ?
Thank's
--
Best regards,
Max mailto:darkit@mail.ru
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re[2]: Don't let me die :(
Posted by Max Grigoriev <da...@mail.ru>.
Hello Mind,
Wednesday, October 8, 2003, 1:18:52 PM, you wrote:
MB> Hi,
>> When i restart the engine, i clean visit object, but all
>> properties of pages with persistent="yes" save their state.
>> How can i clean these properties ?
MB> Please see IEngine.forgetPage()
I looked at it, and try to use:
My page spec:
<property-specification name="bean" persistent="yes"
type="com.feedback.web.page.CompanySelectionBean"/>
in my engine:
public void restart(IRequestCycle cycle) throws IOException {
super.restart(cycle);
setVisit(null);
HttpSession session = cycle.getRequestContext().getSession();
if (session != null) {
forgetPage(MyPage.PAGE_NAME);
session.invalidate();
}
}
And nothing has happen.
Because _records is null.
public void forgetPage(String name)
{
if (_recorders == null)
return;
....
}
And in User guide i read in "Persistent Page Properties" :
"Each persistent page property is stored individually as an
HttpSession attribute."
But when i iterate through session.getAttributeNames() there's only
engine attribute and no attribute for persistent page properties.
I haven't understood still how i can clean persistent page properties.
>> I need that user clicks on text and radio button is checked or
>> unchecked.
MB> There was a suggestion earlier to make a component that uses label. You
MB> would need to use the Script component to define your scripts, etc. This is
MB> how you can make your code really reusable.
if i use script component in foreach,
<span jwcid="@Foreach" source="ognl:bean.currentCategory.children"
value="ognl:bean.currentSubCategory" element="tr">
<td><input jwcid="rad" type="radio" /></td>
<span jwcid="@Script"
script="/com/clearview/feedback/web/page/Test.script"
component="ognl:components.rad"/>
</span>
i've got
function setCheck() {
var myRadio = document.getElementByName(name);
myRadio.checked = !myRadio.checked;
}
function setCheck(name) {
var myRadio = document.getElementByName(name0);
myRadio.checked = !myRadio.checked;
}
MB> If that is too complex, here is a simpler alternative that is based on the
MB> static html you sent:
MB> <script>
MB> function setCheck(name) {
MB> var myRadio = document.getElementByName(name);
MB> myRadio.checked = !myRadio.checked;
MB> }
MB> <script>
MB> ....
MB> <td><input jwcid="rad@Radio" type="radio"
MB> value="ognl:bean.currentSubCategory" /></td>
MB> <td><span jwcid="@Insert"
MB> onclick="setCheck(components.rad.name)"
MB> value="ognl:bean.currentSubCategory.code"/></td>
MB> <td><span jwcid="@Insert"
MB> onclick="setCheck(components.rad.name)"
MB> value="ognl:bean.currentSubCategory.description"/></td>
MB> ....
I didn't understand this part :
<span jwcid="@Insert"
onclick="setCheck(components.rad.name)"
value="ognl:bean.currentSubCategory.description"/>
In result html it looks onclick="setCheck(components.rad.name)" but i
hope to see onclick="setCheck(myRadioName)"
--
Best regards,
Max mailto:darkit@mail.ru
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: Don't let me die :(
Posted by Mind Bridge <mi...@yahoo.com>.
Hi,
> When i restart the engine, i clean visit object, but all
> properties of pages with persistent="yes" save their state.
> How can i clean these properties ?
Please see IEngine.forgetPage()
> I need that user clicks on text and radio button is checked or
> unchecked.
There was a suggestion earlier to make a component that uses label. You
would need to use the Script component to define your scripts, etc. This is
how you can make your code really reusable.
If that is too complex, here is a simpler alternative that is based on the
static html you sent:
<script>
function setCheck(name) {
var myRadio = document.getElementByName(name);
myRadio.checked = !myRadio.checked;
}
<script>
....
<td><input jwcid="rad@Radio" type="radio"
value="ognl:bean.currentSubCategory" /></td>
<td><span jwcid="@Insert" onclick="setCheck(components.rad.name)"
value="ognl:bean.currentSubCategory.code"/></td>
<td><span jwcid="@Insert" onclick="setCheck(components.rad.name)"
value="ognl:bean.currentSubCategory.description"/></td>
....
-mb
-----Original Message-----
From: Max Grigoriev [mailto:darkit@mail.ru]
Sent: Wednesday, October 08, 2003 11:41 AM
To: Tapestry users
Subject: Don't let me die :(
Hello Tapestry-User,
I've asked these question already but nobody said something.
Please don't ignore, answer it or just say it's impossible to
implement in Tapestry.
First:
When i restart the engine, i clean visit object, but all
properties of pages with persistent="yes" save their state.
How can i clean these properties ?
Second question:
I've got such foreach:
<span jwcid="@Foreach" source="ognl:bean.currentCategory.children"
value="ognl:bean.currentSubCategory">
<tr jwcid="subCategory">
<td><input jwcid="@Radio" type="radio"
value="ognl:bean.currentSubCategory" /></td>
<td><span jwcid="@Insert"
value="ognl:bean.currentSubCategory.code"/></td>
<td><span jwcid="@Insert"
value="ognl:bean.currentSubCategory.description"/></td>
<tr>
</span>
I need that user clicks on text and radio button is checked or
unchecked.
In statis html i can do it such way :
<script>
function setCheck(id) {
var myRadio = document.getElementById(id);
myRadio.checked = !myRadio.checked;
}
<script>
<tr>
<td><input id="radio0" type="radio"/></td>
<td onlick="setCheck('radio0')">Code text</td>
<td onlick="setCheck('radio0')">Description text</td>
<tr>
<tr>
<td><input id="radio1" type="radio"/></td>
<td onlick="setCheck('radio1')">Code text 1</td>
<td onlick="setCheck('radio1')">Description text 1</td>
<tr>
How can i do it in Tapestry ?
Thank's
--
Best regards,
Max mailto:darkit@mail.ru
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org