You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vincent <vi...@gmail.com> on 2005/12/20 10:46:41 UTC
Tapestry 3.0.3 TextField
Hi all,
Is it possible to get the value from textfield which parameter is set
to disabled?
<code>
<input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
</code>
regards,
Vincent
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry 3.0.3 TextField
Posted by Fabio Bondioli <fb...@autentiweb.com>.
Pheraps you can use a readonly="true" attribute and specify a CSS
stylesheet that make it appear as a disabled one (gray background color
or similar)
This way you have not to deal with extra hidden components or extra
javascript.
regards
Fabio
Vincent ha scritto:
>Hi Matthew,
>
>The reason why I want to use disabled is the field is readonly , which
>means once the field value is set , it will not change any more.
>Of course ,there are several way to approah this , one way is to use
>readonly="true" but in the UI , disabled="true" and readonly does not
>look like the same , readonly just look like the nornal field which
>disabled seems more look like readonly , that's my intention.
>
>regards,
>Vincent
>
>On 12/20/05, Matthew Lyons <ml...@internode.com.au> wrote:
>
>
>>Couple of questions:
>>
>>Why is it disable? To show a value? If so can you query the same
>>function that set that value? (If its disabled the user can't change it).
>>
>>Or if its set by something else, can you have that same setter update an
>>invisible field? (as someone else suggested)
>>
>>Vincent wrote:
>>
>>
>>
>>>Hi Andrel,
>>>
>>>My intension is use html disabled="true" tag not tapestry tag.
>>>Is there any solution for this?
>>>
>>>regards,
>>>Vincent
>>>On 12/20/05, Andrei Chiritescu <an...@netrom.ro> wrote:
>>>
>>>
>>>
>>>
>>>>Is not possible(as far as I know). I also run into this kind of problem
>>>>and I would like to know is there is way of doing this.
>>>>For myself, I used a workaround ... so for each disabled input I added
>>>>an invisible field that is not disabled ... in this way the binding is
>>>>done through the invisible one.
>>>>For you it would look like :
>>>>
>>>><code>
>>>><input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
>>>><input type="text" style="display: none" jwcid="invisible@TextField" value="ognl:sample"/>
>>>></code>
>>>>
>>>>Regards, Andrei
>>>>
>>>>Vincent wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Hi all,
>>>>>
>>>>>Is it possible to get the value from textfield which parameter is set
>>>>>to disabled?
>>>>>
>>>>><code>
>>>>><input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
>>>>></code>
>>>>>
>>>>>regards,
>>>>>Vincent
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>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
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>---------------------------------------------------------------------
>>>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
>>
>>
>>
>>
>
>---------------------------------------------------------------------
>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
Re: Tapestry 3.0.3 TextField
Posted by Vincent <vi...@gmail.com>.
Hi Matthew,
The reason why I want to use disabled is the field is readonly , which
means once the field value is set , it will not change any more.
Of course ,there are several way to approah this , one way is to use
readonly="true" but in the UI , disabled="true" and readonly does not
look like the same , readonly just look like the nornal field which
disabled seems more look like readonly , that's my intention.
regards,
Vincent
On 12/20/05, Matthew Lyons <ml...@internode.com.au> wrote:
> Couple of questions:
>
> Why is it disable? To show a value? If so can you query the same
> function that set that value? (If its disabled the user can't change it).
>
> Or if its set by something else, can you have that same setter update an
> invisible field? (as someone else suggested)
>
> Vincent wrote:
>
> >Hi Andrel,
> >
> >My intension is use html disabled="true" tag not tapestry tag.
> >Is there any solution for this?
> >
> >regards,
> >Vincent
> >On 12/20/05, Andrei Chiritescu <an...@netrom.ro> wrote:
> >
> >
> >>Is not possible(as far as I know). I also run into this kind of problem
> >>and I would like to know is there is way of doing this.
> >>For myself, I used a workaround ... so for each disabled input I added
> >>an invisible field that is not disabled ... in this way the binding is
> >>done through the invisible one.
> >>For you it would look like :
> >>
> >><code>
> >><input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
> >><input type="text" style="display: none" jwcid="invisible@TextField" value="ognl:sample"/>
> >></code>
> >>
> >>Regards, Andrei
> >>
> >>Vincent wrote:
> >>
> >>
> >>
> >>>Hi all,
> >>>
> >>>Is it possible to get the value from textfield which parameter is set
> >>>to disabled?
> >>>
> >>><code>
> >>><input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
> >>></code>
> >>>
> >>>regards,
> >>>Vincent
> >>>
> >>>---------------------------------------------------------------------
> >>>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
> >>
> >>
> >>
> >>
> >
> >---------------------------------------------------------------------
> >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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry 3.0.3 TextField
Posted by Matthew Lyons <ml...@internode.com.au>.
Couple of questions:
Why is it disable? To show a value? If so can you query the same
function that set that value? (If its disabled the user can't change it).
Or if its set by something else, can you have that same setter update an
invisible field? (as someone else suggested)
Vincent wrote:
>Hi Andrel,
>
>My intension is use html disabled="true" tag not tapestry tag.
>Is there any solution for this?
>
>regards,
>Vincent
>On 12/20/05, Andrei Chiritescu <an...@netrom.ro> wrote:
>
>
>>Is not possible(as far as I know). I also run into this kind of problem
>>and I would like to know is there is way of doing this.
>>For myself, I used a workaround ... so for each disabled input I added
>>an invisible field that is not disabled ... in this way the binding is
>>done through the invisible one.
>>For you it would look like :
>>
>><code>
>><input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
>><input type="text" style="display: none" jwcid="invisible@TextField" value="ognl:sample"/>
>></code>
>>
>>Regards, Andrei
>>
>>Vincent wrote:
>>
>>
>>
>>>Hi all,
>>>
>>>Is it possible to get the value from textfield which parameter is set
>>>to disabled?
>>>
>>><code>
>>><input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
>>></code>
>>>
>>>regards,
>>>Vincent
>>>
>>>---------------------------------------------------------------------
>>>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
>>
>>
>>
>>
>
>---------------------------------------------------------------------
>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
Re: Table Component
Posted by Shing Hing Man <ma...@yahoo.com>.
You might like to check out the one in the Workbench
example that comes with the Tapestry 4 source code.
Shing
--- Badri Narayan <ba...@yepmail.net> wrote:
> Hi,
> I need an example of a Table component in Tapestry
> 4.0. Can anyone
> provide me the same.
>
> Thanks,
> -Badri
>
> --
> http://www.fastmail.fm - And now for something
> completely differentÂ…
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
>
>
Home page :
http://uk.geocities.com/matmsh/index.html
___________________________________________________________
NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online! http://uk.cars.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Table Component
Posted by Subramanian Thangamuthu <su...@yahoo.com>.
I am also need that example...
Can any one provide the same..
Thanx...
Subramanian
----- Original Message ----
From: Badri Narayan <ba...@yepmail.net>
To: Tapestry users <ta...@jakarta.apache.org>
Sent: Tuesday, December 20, 2005 18:29:58
Subject: Table Component
Hi,
I need an example of a Table component in Tapestry 4.0. Can anyone
provide me the same.
Thanks,
-Badri
--
http://www.fastmail.fm - And now for something completely differentÂ…
---------------------------------------------------------------------
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
Table Component
Posted by Badri Narayan <ba...@yepmail.net>.
Hi,
I need an example of a Table component in Tapestry 4.0. Can anyone
provide me the same.
Thanks,
-Badri
--
http://www.fastmail.fm - And now for something completely differentÂ…
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry 3.0.3 TextField
Posted by Gunna Satria <gu...@yahoo.com>.
Hi Vincent,
You can use what Andrei suggest or you can use @Hidden component.
What Andrei said is right, it will cause the same effect whether you use tapestry parameter or html attribute.
ps:
why don't you use @Insert instead of disabled TextField, it looks nicer to me :D
Andrei Chiritescu <an...@netrom.ro> wrote:
Hi Vincent,
>From what I understand you want to send the disabled parameter as an
informal parameter not as a parameter to the TextField component, right?
If so, I dont think you can do that.
However, even if the you send the parameter to the component the
html outcome will be the same.The only difference will be the the
reverse binding(to set back the value) will not be done. Is there any
other reason for you to set the disabled tag in the html directly?
If you dont like the solution with the invisible field you could use
javascript. For this you will need to overwrite the onSubmit() function
and iterate all the input fields and set the disable=false(all of this
is done in js of course).
Regards, Andrei
Vincent wrote:
>Hi Andrel,
>
>My intension is use html disabled="true" tag not tapestry tag.
>Is there any solution for this?
>
>regards,
>Vincent
>On 12/20/05, Andrei Chiritescu wrote:
>
>
>>Is not possible(as far as I know). I also run into this kind of problem
>>and I would like to know is there is way of doing this.
>>For myself, I used a workaround ... so for each disabled input I added
>>an invisible field that is not disabled ... in this way the binding is
>>done through the invisible one.
>>For you it would look like :
>>
>>
>> [input]
>> [input]
>>
>>
>>Regards, Andrei
>>
>>Vincent wrote:
>>
>>
>>
>>>Hi all,
>>>
>>>Is it possible to get the value from textfield which parameter is set
>>>to disabled?
>>>
>>>
>>> [input]
>>>
>>>
>>>regards,
>>>Vincent
>>>
>>>---------------------------------------------------------------------
>>>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
>>
>>
>>
>>
>
>---------------------------------------------------------------------
>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
regards,
Gunna SHK
Java Consultant
mail:gunna_satria@yahoo.com
YM:gunna_satria
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: Tapestry 3.0.3 TextField
Posted by Andrei Chiritescu <an...@netrom.ro>.
Hi Vincent,
From what I understand you want to send the disabled parameter as an
informal parameter not as a parameter to the TextField component, right?
If so, I dont think you can do that.
However, even if the you send the parameter to the component the
html outcome will be the same.The only difference will be the the
reverse binding(to set back the value) will not be done. Is there any
other reason for you to set the disabled tag in the html directly?
If you dont like the solution with the invisible field you could use
javascript. For this you will need to overwrite the onSubmit() function
and iterate all the input fields and set the disable=false(all of this
is done in js of course).
Regards, Andrei
Vincent wrote:
>Hi Andrel,
>
>My intension is use html disabled="true" tag not tapestry tag.
>Is there any solution for this?
>
>regards,
>Vincent
>On 12/20/05, Andrei Chiritescu <an...@netrom.ro> wrote:
>
>
>>Is not possible(as far as I know). I also run into this kind of problem
>>and I would like to know is there is way of doing this.
>>For myself, I used a workaround ... so for each disabled input I added
>>an invisible field that is not disabled ... in this way the binding is
>>done through the invisible one.
>>For you it would look like :
>>
>><code>
>><input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
>><input type="text" style="display: none" jwcid="invisible@TextField" value="ognl:sample"/>
>></code>
>>
>>Regards, Andrei
>>
>>Vincent wrote:
>>
>>
>>
>>>Hi all,
>>>
>>>Is it possible to get the value from textfield which parameter is set
>>>to disabled?
>>>
>>><code>
>>><input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
>>></code>
>>>
>>>regards,
>>>Vincent
>>>
>>>---------------------------------------------------------------------
>>>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
>>
>>
>>
>>
>
>---------------------------------------------------------------------
>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
Re: Tapestry 3.0.3 TextField
Posted by Vincent <vi...@gmail.com>.
Hi Andrel,
My intension is use html disabled="true" tag not tapestry tag.
Is there any solution for this?
regards,
Vincent
On 12/20/05, Andrei Chiritescu <an...@netrom.ro> wrote:
> Is not possible(as far as I know). I also run into this kind of problem
> and I would like to know is there is way of doing this.
> For myself, I used a workaround ... so for each disabled input I added
> an invisible field that is not disabled ... in this way the binding is
> done through the invisible one.
> For you it would look like :
>
> <code>
> <input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
> <input type="text" style="display: none" jwcid="invisible@TextField" value="ognl:sample"/>
> </code>
>
> Regards, Andrei
>
> Vincent wrote:
>
> >Hi all,
> >
> >Is it possible to get the value from textfield which parameter is set
> >to disabled?
> >
> ><code>
> ><input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
> ></code>
> >
> >regards,
> >Vincent
> >
> >---------------------------------------------------------------------
> >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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: Rendering block from other page
Posted by Jimmi Dyson <ji...@lawton.co.uk>.
I didn't get an answer to this so I'll try rewording it and see if that
helps! Thanks in advance!
The order of Blocks on my pages is to be configurable. So as to have
clean HTML mock-ups for clients to see, the Blocks are moved into
another page. For ease of maintenance, I would like to create a new
component for each Block. If I do not create a component for each Block,
it renders fine, but this means that my page referencing the individual
Blocks is a whole load of mark-up which I feel should be put into
separate components.
The .html template that actually renders the Blocks:
...
<span jwcid="forEachBlock">
<span jwcid="renderBlock"/>
</span>
...
Corresponding .page:
...
<component id="forEachBlock" type="For">
<binding name="source" value="ognl:pageLayout"/>
<binding name="value" value="ognl:currentPageComponent"/>
<binding name="index" value="ognl:componentIndex"/>
</component>
<component id="renderBlock" type="RenderBlock">
<binding name="block" value="ognl:currentBlock"/>
</component>
...
And the .java:
...
public Block getCurrentBlock() {
Block block = null;
IRequestCycle cycle = getRequestCycle();
switch (getComponentIndex()) {
case 0:
block = (Block)
cycle.getPage("BlocksTemplate").getComponent("firstBlock");
break;
default:
block = (Block)
cycle.getPage("BlocksTemplate").getComponent("secondBlock");
break;
}
return block;
}
...
Now BlocksTemplate.html:
<span jwcid="firstBlock"/>
<span jwcid="secondBlock"/>
And BlocksTemplate.page:
...
<component id="firstBlock" type="Block1"/>
<component id="secondBlock" type="Block2"/>
...
Block1.html (and Block2.html identical at the moment):
<div style="border:1px solid #000000;">
<img jwcid="genImage"/><br/>
<span jwcid="insertString"/>
</div>
Block1.jwc:
<component-specification class=" TestBlock">
<component id="genImage" type="jim:GeneratedImage">
<binding name="backgroundImagePath"
value="literal:/images/background.png"/>
<binding name="stringToWrite"
value="ognl:currentPageComponent.title"/>
<binding name="fontFilePath"
value="literal:/images/HATTEN.TTF"/>
<binding name="fontSize" value="literal:80"/>
<binding name="fontColour" value="literal:#ffffff"/>
<binding name="outputDir" value="literal:/images/"/>
<binding name="imageFormat" value="literal:png"/>
</component>
<component id="insertString" type="Insert">
<binding name="value"
value="ognl:currentPageComponent.stringFromBlock1"/>
</component>
</component-specification>
TestBlock.java:
public class TestBlock extends Block {
public PageComponent getCurrentPageComponent() {
return new PageComponent("Hello", "Goodbye",
"Something");
}
}
As I said above if this is contained in the BlocksTemplate page then all
works fine - just when it is being pulled out into separate components.
-----Original Message-----
From: Jimmi Dyson [mailto:jimmi.dyson@lawton.co.uk]
Sent: 20 December 2005 11:12
To: 'Tapestry users'
Subject: Rendering block from other page
I have to select which block to render depending upon database
configuration. To keep clean HTML mock-ups, I have moved the blocks into
a separate page. The blocks are specified as separate components,
subclassing Block.
My problem is that they don't get rendered at all and I'm not sure why.
Home.html:
...
<span jwcid="forEachModule">
<div style="border: 1px" jwcid="blockDiv">
<span jwcid="renderBlock"/>
</div>
</span>
...
Home.page:
...
<component id="renderBlock" type="RenderBlock">
<binding name="block" value="ognl: currentBlock"/>
<binding name="featureModule" value="ognl: currentModule"/>
</component>
...
Using featureModule as an informal parameter to pass to the rendering
block, retrieved through getParameter("featureModule") in block class.
HomePage.java:
...
public Block getCurrentBlock() {
IPage blocksPage = getCycle().getPage("Blocks");
Block block = (Block) blocksPage.getComponent("fullWidthBlock");
return block;
}
...
Blocks.page:
...
<component id="fullWidthBlock" type="FullWidthBlock"/>
...
FullWidthBlock never gets rendered. If fullWidthBlock is just static
HTML contained in Blocks.html rather than FullWidthBlock.html, it gets
rendered fine, but I would rather not have to have all HTML for each
block I have to render in Blocks.html. In fact that wouldn't be
possible as I have to pass a parameter to the Block to render
(featureModule informal parameter above).
Have I missed something or is this just not possible at the moment?
Thanks for your help,
Jim Dyson
---------------------------------------------------------------------
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
Rendering block from other page
Posted by Jimmi Dyson <ji...@lawton.co.uk>.
I have to select which block to render depending upon database
configuration. To keep clean HTML mock-ups, I have moved the blocks into
a separate page. The blocks are specified as separate components,
subclassing Block.
My problem is that they don't get rendered at all and I'm not sure why.
Home.html:
...
<span jwcid="forEachModule">
<div style="border: 1px" jwcid="blockDiv">
<span jwcid="renderBlock"/>
</div>
</span>
...
Home.page:
...
<component id="renderBlock" type="RenderBlock">
<binding name="block" value="ognl: currentBlock"/>
<binding name="featureModule" value="ognl: currentModule"/>
</component>
...
Using featureModule as an informal parameter to pass to the rendering
block, retrieved through getParameter("featureModule") in block class.
HomePage.java:
...
public Block getCurrentBlock() {
IPage blocksPage = getCycle().getPage("Blocks");
Block block = (Block) blocksPage.getComponent("fullWidthBlock");
return block;
}
...
Blocks.page:
...
<component id="fullWidthBlock" type="FullWidthBlock"/>
...
FullWidthBlock never gets rendered. If fullWidthBlock is just static
HTML contained in Blocks.html rather than FullWidthBlock.html, it gets
rendered fine, but I would rather not have to have all HTML for each
block I have to render in Blocks.html. In fact that wouldn't be
possible as I have to pass a parameter to the Block to render
(featureModule informal parameter above).
Have I missed something or is this just not possible at the moment?
Thanks for your help,
Jim Dyson
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry 3.0.3 TextField
Posted by Andrei Chiritescu <an...@netrom.ro>.
Is not possible(as far as I know). I also run into this kind of problem
and I would like to know is there is way of doing this.
For myself, I used a workaround ... so for each disabled input I added
an invisible field that is not disabled ... in this way the binding is
done through the invisible one.
For you it would look like :
<code>
<input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
<input type="text" style="display: none" jwcid="invisible@TextField" value="ognl:sample"/>
</code>
Regards, Andrei
Vincent wrote:
>Hi all,
>
>Is it possible to get the value from textfield which parameter is set
>to disabled?
>
><code>
><input type="text" disabled="true" jwcid="@TextField" value="ognl:sample"/>
></code>
>
>regards,
>Vincent
>
>---------------------------------------------------------------------
>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