You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Gregg Bolinger <gd...@gmail.com> on 2006/06/28 16:20:08 UTC

Design Type Question

This isn't about MyFaces specifically so I apologize but this list is the
best JSF resource I know of. ;)

I have a page that contains a list of Articles.  There are also filter
criteria to filter the list of Articles.  The article list is a dataTable
who's value is a method in the backing bean that returns a list of
articles.  Simple enough.  So when the page first loads, I get all the
articles.

The problem I am facing is part of the filter is 3 levels of categories.
Category, Sub Category, and a Sub Sub Category.  Each of these is a
selectOneMenu and the child catagories depends on the parent category.  So I
have valueChangeListeners registered so that when one drop down changes, the
child dropdown gets new values.

The problem with this is that when this happens, my method to get the list
of articles is called.  But I don't want this to happen until I click the
Search button.  So I am just looking for solutions to solve this.

Thanks.

Re: Design Type Question

Posted by Gregg Bolinger <gd...@gmail.com>.
Option #1 sounds good.  Thanks.

Gregg

On 6/28/06, Cosma Colanicchia <co...@gmail.com> wrote:
>
> Your backing-bean method is request or session scoped?
>
> 1) With request-scoped bean, I would set the value binding of your
> filter components to a different bean property than the one that is
> used by your "getArticles" method, and create a method "applyFilters"
> that simply copies the "temporary" filter properties in the actual
> ones.. this way your filters will not be applied until your "apply
> filters" button is pressed.
>
> 2) With session-scoped bean, I would simply not get all the articles
> on each "getArticles" call.. this method should simply return a member
> variable, and a different method "applyFilter" should load its value,
> looking at the current filter settings.
>
>
> Hope this helps
> Cosma
>
>
> 2006/6/28, Gregg Bolinger <gd...@gmail.com>:
> > This isn't about MyFaces specifically so I apologize but this list is
> the
> > best JSF resource I know of. ;)
> >
> > I have a page that contains a list of Articles.  There are also filter
> > criteria to filter the list of Articles.  The article list is a
> dataTable
> > who's value is a method in the backing bean that returns a list of
> articles.
> >  Simple enough.  So when the page first loads, I get all the articles.
> >
> > The problem I am facing is part of the filter is 3 levels of categories.
> > Category, Sub Category, and a Sub Sub Category.  Each of these is a
> > selectOneMenu and the child catagories depends on the parent
> category.  So I
> > have valueChangeListeners registered so that when one drop down changes,
> the
> > child dropdown gets new values.
> >
> > The problem with this is that when this happens, my method to get the
> list
> > of articles is called.  But I don't want this to happen until I click
> the
> > Search button.  So I am just looking for solutions to solve this.
> >
> > Thanks.
> >
>

Re: Design Type Question

Posted by Cosma Colanicchia <co...@gmail.com>.
Your backing-bean method is request or session scoped?

1) With request-scoped bean, I would set the value binding of your
filter components to a different bean property than the one that is
used by your "getArticles" method, and create a method "applyFilters"
that simply copies the "temporary" filter properties in the actual
ones.. this way your filters will not be applied until your "apply
filters" button is pressed.

2) With session-scoped bean, I would simply not get all the articles
on each "getArticles" call.. this method should simply return a member
variable, and a different method "applyFilter" should load its value,
looking at the current filter settings.


Hope this helps
Cosma


2006/6/28, Gregg Bolinger <gd...@gmail.com>:
> This isn't about MyFaces specifically so I apologize but this list is the
> best JSF resource I know of. ;)
>
> I have a page that contains a list of Articles.  There are also filter
> criteria to filter the list of Articles.  The article list is a dataTable
> who's value is a method in the backing bean that returns a list of articles.
>  Simple enough.  So when the page first loads, I get all the articles.
>
> The problem I am facing is part of the filter is 3 levels of categories.
> Category, Sub Category, and a Sub Sub Category.  Each of these is a
> selectOneMenu and the child catagories depends on the parent category.  So I
> have valueChangeListeners registered so that when one drop down changes, the
> child dropdown gets new values.
>
> The problem with this is that when this happens, my method to get the list
> of articles is called.  But I don't want this to happen until I click the
> Search button.  So I am just looking for solutions to solve this.
>
> Thanks.
>

RE: Design Type Question

Posted by Julian Ray <ju...@yahoo.com>.
You need to set escape="false" on the outputText so the text does not get
escaped.

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 2:58 PM
To: MyFaces Discussion
Subject: Re: Design Type Question


Scratch that.  I am getting the value. But all the code is escaped. &gt;,
&lt; etc.  So it doesn't register correclty.  Trying something else....


On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote: 

Alright, maybe a stupid question...

For testing I have a property in my backing bean called javascript with
getters and setters.  I have initialized javascript with the following:

private String javascript = "<script type=\"text/javascript\">function
testFunction(){ alert('this is a test'); }</script>"; 

And then did:

t:outputText value="#{ArticleListBean.javascript}"/>

But it's not spitting out the code.  Am I doing this wrong?


Thanks.



On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Make sure to use forceId on the select items so the JS can find them
otherwise you will have to prefix the component ids with "formname:" 
 

  _____  


From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 2:31 PM

To: MyFaces Discussion
Subject: Re: Design Type Question



Doh!  Didn't even think about that.  Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Couldn't you use a <h:outputText value="#{myBackingBean.....}}  /> and
either (a) write out the whole javascript or (b) just write out the array
part?
 
 

  _____  


From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 1:38 PM

To: MyFaces Discussion
Subject: Re: Design Type Question



Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I already
know how to do that.  What I don't know is how to populate Javascript arrays
with data from my backing bean.

Aside from a custom component, I'd assume I need to do something like that. 

Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Here is an example, I have not tested it but have used similar approaches
 
http://www.javascriptkit.com/script/script2/multiplecombo.shtml
 
 


  _____  



From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com
<ma...@gmail.com> ] 

Sent: Wednesday, June 28, 2006 11:45 AM
To: MyFaces Discussion
Subject: Re: Design Type Question



Julian,

Thanks for the suggestions.  How would I go about populating javascript
values with data from the backing bean if I were to go with [1]?  Any links
with this info?

Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Some suggestions
 
[1] Use client-side population of teh drop downs
[2] Use 2 backing beans, 1 for the drop down and 1 for the articles. Lazily
load all getters. Use t:saveState to store the filter bean.
[3] Use Ajax

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 10:20 AM
To: MyFaces Discussion
Subject: Design Type Question



This isn't about MyFaces specifically so I apologize but this list is the
best JSF resource I know of. ;)

I have a page that contains a list of Articles.  There are also filter
criteria to filter the list of Articles.  The article list is a dataTable
who's value is a method in the backing bean that returns a list of articles.
Simple enough.  So when the page first loads, I get all the articles. 

The problem I am facing is part of the filter is 3 levels of categories.
Category, Sub Category, and a Sub Sub Category.  Each of these is a
selectOneMenu and the child catagories depends on the parent category.  So I
have valueChangeListeners registered so that when one drop down changes, the
child dropdown gets new values. 

The problem with this is that when this happens, my method to get the list
of articles is called.  But I don't want this to happen until I click the
Search button.  So I am just looking for solutions to solve this. 

Thanks.








Re: Design Type Question

Posted by Gregg Bolinger <gd...@gmail.com>.
Thanks Julian.  I will add it to the wiki when I get it finalized.  I am
running into another issue of the selected value needing to be the
selectedIndex when an actionEvent occurs and the same page is displayed
again.

Thanks.

On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
>
>  Great. How about adding how you did it to the wiki and pass on
> your know-how as I'm sure others will be facing the same problem :)
>
>  ------------------------------
> *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> *Sent:* Wednesday, June 28, 2006 3:33 PM
>
> *To:* MyFaces Discussion
> *Subject:* Re: Design Type Question
>
> New info.  If I place all this code in a function and call that function
> on document load, it works fine.  So I guess I'll just go that route.
>
> On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote:
> >
> > Alright.  Thanks for the info.  Getting closer.  I have the following
> > being spit out on my page after rendered.
> >
> > var options = document.getElementById('catSelect').options; var option =
> > new Option('4', 'Active');
> > options[options.length] = option;
> > var option = new Option('69', 'Appreciate');
> > options[ options.length] = option;
> > var option = new Option('3', 'Explore');
> > options[options.length] = option;
> > var option = new Option('71', 'Habitat');
> > options[options.length] = option;
> > var option = new Option('70', 'Indulge');
> > options[options.length] = option;
> > var option = new Option('1', 'Locate');
> > options[options.length] = option;
> > var option = new Option('2', 'People');
> > options[options.length] = option;
> >
> > And I am getting document.getElementById("catSelect") has no properties
> > error.  I also see this on the rendered HTML:
> >
> > <select id="catSelect" name="catSelect" size="1"> <option
> > value="0">ALL</option></select>
> >
> > Which is accurate as to:
> >
> > <t:selectOneMenu forceId="true" id="catSelect" value="#{
> > ArticleListBean.category}">
> >      <f:selectItem itemLabel="ALL" itemValue="0" />
> > </t:selectOneMenu>
> >
> > Anything jump out?
> >
> >
> >
> > On 6/28/06, Julian Ray < julianjray@yahoo.com > wrote:
> > >
> > >  No if you use selectOne components which update the backingbean. Your
> > > JS should reference the selectOne components via ids - you might have to
> > > pass dummy select items but these will get removed then replaced by the JS
> > > as it loads. Remember that the page is rendered before its loaded by the
> > > browser so the JS will execute after the rendering has been performed.
> > >
> > >  ------------------------------
> > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > *Sent: *Wednesday, June 28, 2006 3:05 PM
> > >
> > > *To:* MyFaces Discussion
> > > *Subject:* Re: Design Type Question
> > >
> > >  Ok, got it working now. One final question.  If I do this with
> > > Javascript, I am going to have to do all the work of updating the model with
> > > the new values since it's client side, correct?
> > >
> > > Maybe this should be my first custom component. Eh? lol.
> > > Thanks for the help.
> > >
> > > Gregg
> > >
> > > On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote:
> > > >
> > > > Scratch that.  I am getting the value. But all the code is escaped.
> > > > &gt;, &lt; etc.  So it doesn't register correclty.  Trying something
> > > > else....
> > > >
> > > >
> > > > On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote:
> > > > >
> > > > > Alright, maybe a stupid question...
> > > > >
> > > > > For testing I have a property in my backing bean called javascript
> > > > > with getters and setters.  I have initialized javascript with the following:
> > > > >
> > > > > private String javascript = "<script
> > > > > type=\"text/javascript\">function testFunction(){ alert('this is a test');
> > > > > }</script>";
> > > > >
> > > > > And then did:
> > > > >
> > > > > t:outputText value="#{ArticleListBean.javascript}"/>
> > > > >
> > > > > But it's not spitting out the code.  Am I doing this wrong?
> > > > >
> > > > >
> > > > > Thanks.
> > > > >
> > > > >
> > > > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > > > >
> > > > > >  Make sure to use forceId on the select items so the JS can find
> > > > > > them otherwise you will have to prefix the component ids with "formname:"
> > > > > >
> > > > > >
> > > > > >  ------------------------------
> > > > > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com ]
> > > > > > *Sent: *Wednesday, June 28, 2006 2:31 PM
> > > > > >
> > > > > > *To:* MyFaces Discussion
> > > > > > *Subject:* Re: Design Type Question
> > > > > >
> > > > > >  Doh!  Didn't even think about that.  Thanks.
> > > > > >
> > > > > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > > > > >
> > > > > > >  Couldn't you use a <h:outputText
> > > > > > > value="#{myBackingBean.....}}  /> and either (a) write out the whole
> > > > > > > javascript or (b) just write out the array part?
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >  ------------------------------
> > > > > > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > > > > > *Sent: *Wednesday, June 28, 2006 1:38 PM
> > > > > > >
> > > > > > > *To:* MyFaces Discussion
> > > > > > > *Subject:* Re: Design Type Question
> > > > > > >
> > > > > > >  Thanks Julian.  *Unfortunately* I'm well adapt at Javascript
> > > > > > > so I already know how to do that.  What I don't know is how to populate
> > > > > > > Javascript arrays with data from my backing bean.
> > > > > > >
> > > > > > > Aside from a custom component, I'd assume I need to do
> > > > > > > something like that.
> > > > > > >
> > > > > > > Thanks.
> > > > > > >
> > > > > > > On 6/28/06, Julian Ray <julianjray@yahoo.com > wrote:
> > > > > > > >
> > > > > > > >  Here is an example, I have not tested it but have used
> > > > > > > > similar approaches
> > > > > > > >
> > > > > > > >
> > > > > > > > http://www.javascriptkit.com/script/script2/multiplecombo.shtml
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >  ------------------------------
> > > > > > > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com ]
> > > > > > > >
> > > > > > > > *Sent: *Wednesday, June 28, 2006 11:45 AM
> > > > > > > > *To:* MyFaces Discussion
> > > > > > > > *Subject:* Re: Design Type Question
> > > > > > > >
> > > > > > > >  Julian,
> > > > > > > >
> > > > > > > > Thanks for the suggestions.  How would I go about populating
> > > > > > > > javascript values with data from the backing bean if I were to go with [1]?
> > > > > > > > Any links with this info?
> > > > > > > >
> > > > > > > > Thanks.
> > > > > > > >
> > > > > > > > On 6/28/06, Julian Ray <julianjray@yahoo.com > wrote:
> > > > > > > > >
> > > > > > > > >  Some suggestions
> > > > > > > > >
> > > > > > > > > [1] Use client-side population of teh drop downs
> > > > > > > > > [2] Use 2 backing beans, 1 for the drop down and 1 for the
> > > > > > > > > articles. Lazily load all getters. Use t:saveState to store the filter bean.
> > > > > > > > > [3] Use Ajax
> > > > > > > > >
> > > > > > > > >  ------------------------------
> > > > > > > > > *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > > > > > > > *Sent:* Wednesday, June 28, 2006 10:20 AM
> > > > > > > > > *To:* MyFaces Discussion
> > > > > > > > > *Subject:* Design Type Question
> > > > > > > > >
> > > > > > > > >  This isn't about MyFaces specifically so I apologize but
> > > > > > > > > this list is the best JSF resource I know of. ;)
> > > > > > > > >
> > > > > > > > > I have a page that contains a list of Articles.  There are
> > > > > > > > > also filter criteria to filter the list of Articles.  The article list is a
> > > > > > > > > dataTable who's value is a method in the backing bean that returns a list of
> > > > > > > > > articles.  Simple enough.  So when the page first loads, I get all the
> > > > > > > > > articles.
> > > > > > > > >
> > > > > > > > > The problem I am facing is part of the filter is 3 levels
> > > > > > > > > of categories.  Category, Sub Category, and a Sub Sub Category.  Each of
> > > > > > > > > these is a selectOneMenu and the child catagories depends on the parent
> > > > > > > > > category.  So I have valueChangeListeners registered so that when one drop
> > > > > > > > > down changes, the child dropdown gets new values.
> > > > > > > > >
> > > > > > > > > The problem with this is that when this happens, my method
> > > > > > > > > to get the list of articles is called.  But I don't want this to happen
> > > > > > > > > until I click the Search button.  So I am just looking for solutions to
> > > > > > > > > solve this.
> > > > > > > > >
> > > > > > > > > Thanks.
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

RE: Design Type Question

Posted by Julian Ray <ju...@yahoo.com>.
Great. How about adding how you did it to the wiki and pass on your know-how
as I'm sure others will be facing the same problem :)

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 3:33 PM
To: MyFaces Discussion
Subject: Re: Design Type Question


New info.  If I place all this code in a function and call that function on
document load, it works fine.  So I guess I'll just go that route.


On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote: 

Alright.  Thanks for the info.  Getting closer.  I have the following being
spit out on my page after rendered.

var options = document.getElementById('catSelect').options; 
var option = new Option('4', 'Active');
options[options.length] = option; 
var option = new Option('69', 'Appreciate');
options[ options.length] = option;
var option = new Option('3', 'Explore');
options[options.length] = option;
var option = new Option('71', 'Habitat');
options[options.length] = option;
var option = new Option('70', 'Indulge');
options[options.length] = option;
var option = new Option('1', 'Locate'); 
options[options.length] = option;
var option = new Option('2', 'People'); 
options[options.length] = option;

And I am getting document.getElementById("catSelect") has no properties
error.  I also see this on the rendered HTML: 

<select id="catSelect" name="catSelect" size="1"> <option
value="0">ALL</option></select>

Which is accurate as to: 

<t:selectOneMenu forceId="true" id="catSelect"
value="#{ArticleListBean.category}">
     <f:selectItem itemLabel="ALL" itemValue="0" />
</t:selectOneMenu> 

Anything jump out?
                    




On 6/28/06, Julian Ray < julianjray@yahoo.com  <ma...@yahoo.com>
> wrote: 

No if you use selectOne components which update the backingbean. Your JS
should reference the selectOne components via ids - you might have to pass
dummy select items but these will get removed then replaced by the JS as it
loads. Remember that the page is rendered before its loaded by the browser
so the JS will execute after the rendering has been performed.

  _____  


From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 3:05 PM

To: MyFaces Discussion
Subject: Re: Design Type Question



Ok, got it working now. One final question.  If I do this with Javascript, I
am going to have to do all the work of updating the model with the new
values since it's client side, correct?  

Maybe this should be my first custom component. Eh? lol. 
Thanks for the help.

Gregg


On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote: 

Scratch that.  I am getting the value. But all the code is escaped. &gt;,
&lt; etc.  So it doesn't register correclty.  Trying something else.... 



On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote: 

Alright, maybe a stupid question...

For testing I have a property in my backing bean called javascript with
getters and setters.  I have initialized javascript with the following:

private String javascript = "<script type=\"text/javascript\">function
testFunction(){ alert('this is a test'); }</script>"; 

And then did:

t:outputText value="#{ArticleListBean.javascript}"/>

But it's not spitting out the code.  Am I doing this wrong?


Thanks.



On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Make sure to use forceId on the select items so the JS can find them
otherwise you will have to prefix the component ids with "formname:" 
 

  _____  


From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com
<ma...@gmail.com> ] 

Sent: Wednesday, June 28, 2006 2:31 PM

To: MyFaces Discussion
Subject: Re: Design Type Question



Doh!  Didn't even think about that.  Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Couldn't you use a <h:outputText value="#{myBackingBean.....}}  /> and
either (a) write out the whole javascript or (b) just write out the array
part?
 
 

  _____  


From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 1:38 PM

To: MyFaces Discussion
Subject: Re: Design Type Question



Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I already
know how to do that.  What I don't know is how to populate Javascript arrays
with data from my backing bean.

Aside from a custom component, I'd assume I need to do something like that. 

Thanks.


On 6/28/06, Julian Ray <julianjray@yahoo.com  <ma...@yahoo.com>
> wrote: 

Here is an example, I have not tested it but have used similar approaches
 
http://www.javascriptkit.com/script/script2/multiplecombo.shtml
 
 


  _____  



From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com
<ma...@gmail.com> ] 

Sent: Wednesday, June 28, 2006 11:45 AM
To: MyFaces Discussion
Subject: Re: Design Type Question



Julian,

Thanks for the suggestions.  How would I go about populating javascript
values with data from the backing bean if I were to go with [1]?  Any links
with this info?

Thanks.


On 6/28/06, Julian Ray <julianjray@yahoo.com  <ma...@yahoo.com>
> wrote: 

Some suggestions
 
[1] Use client-side population of teh drop downs
[2] Use 2 backing beans, 1 for the drop down and 1 for the articles. Lazily
load all getters. Use t:saveState to store the filter bean.
[3] Use Ajax

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com ] 
Sent: Wednesday, June 28, 2006 10:20 AM
To: MyFaces Discussion
Subject: Design Type Question



This isn't about MyFaces specifically so I apologize but this list is the
best JSF resource I know of. ;)

I have a page that contains a list of Articles.  There are also filter
criteria to filter the list of Articles.  The article list is a dataTable
who's value is a method in the backing bean that returns a list of articles.
Simple enough.  So when the page first loads, I get all the articles. 

The problem I am facing is part of the filter is 3 levels of categories.
Category, Sub Category, and a Sub Sub Category.  Each of these is a
selectOneMenu and the child catagories depends on the parent category.  So I
have valueChangeListeners registered so that when one drop down changes, the
child dropdown gets new values. 

The problem with this is that when this happens, my method to get the list
of articles is called.  But I don't want this to happen until I click the
Search button.  So I am just looking for solutions to solve this. 

Thanks.











Re: Design Type Question

Posted by Gregg Bolinger <gd...@gmail.com>.
New info.  If I place all this code in a function and call that function on
document load, it works fine.  So I guess I'll just go that route.

On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote:
>
> Alright.  Thanks for the info.  Getting closer.  I have the following
> being spit out on my page after rendered.
>
> var options = document.getElementById('catSelect').options; var option =
> new Option('4', 'Active');
> options[options.length] = option;
> var option = new Option('69', 'Appreciate');
> options[ options.length] = option;
> var option = new Option('3', 'Explore');
>  options[options.length] = option;
> var option = new Option('71', 'Habitat');
> options[options.length] = option;
> var option = new Option('70', 'Indulge');
>  options[options.length] = option;
> var option = new Option('1', 'Locate');
> options[options.length] = option;
> var option = new Option('2', 'People');
> options[options.length] = option;
>
> And I am getting document.getElementById("catSelect") has no properties
> error.  I also see this on the rendered HTML:
>
> <select id="catSelect" name="catSelect" size="1"> <option
> value="0">ALL</option></select>
>
> Which is accurate as to:
>
> <t:selectOneMenu forceId="true" id="catSelect" value="#{
> ArticleListBean.category}">
>      <f:selectItem itemLabel="ALL" itemValue="0" />
> </t:selectOneMenu>
>
> Anything jump out?
>
>
>
> On 6/28/06, Julian Ray <julianjray@yahoo.com > wrote:
> >
> >  No if you use selectOne components which update the backingbean. Your
> > JS should reference the selectOne components via ids - you might have to
> > pass dummy select items but these will get removed then replaced by the JS
> > as it loads. Remember that the page is rendered before its loaded by the
> > browser so the JS will execute after the rendering has been performed.
> >
> >  ------------------------------
> > *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > *Sent: * Wednesday, June 28, 2006 3:05 PM
> >
> > *To:* MyFaces Discussion
> > *Subject:* Re: Design Type Question
> >
> > Ok, got it working now. One final question.  If I do this with
> > Javascript, I am going to have to do all the work of updating the model with
> > the new values since it's client side, correct?
> >
> > Maybe this should be my first custom component. Eh? lol.
> > Thanks for the help.
> >
> > Gregg
> >
> > On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote:
> > >
> > > Scratch that.  I am getting the value. But all the code is escaped.
> > > &gt;, &lt; etc.  So it doesn't register correclty.  Trying something
> > > else....
> > >
> > >
> > > On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote:
> > > >
> > > > Alright, maybe a stupid question...
> > > >
> > > > For testing I have a property in my backing bean called javascript
> > > > with getters and setters.  I have initialized javascript with the following:
> > > >
> > > > private String javascript = "<script
> > > > type=\"text/javascript\">function testFunction(){ alert('this is a test');
> > > > }</script>";
> > > >
> > > > And then did:
> > > >
> > > > t:outputText value="#{ArticleListBean.javascript}"/>
> > > >
> > > > But it's not spitting out the code.  Am I doing this wrong?
> > > >
> > > >
> > > > Thanks.
> > > >
> > > >
> > > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > > >
> > > > >  Make sure to use forceId on the select items so the JS can find
> > > > > them otherwise you will have to prefix the component ids with "formname:"
> > > > >
> > > > >
> > > > >  ------------------------------
> > > > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com ]
> > > > > *Sent: *Wednesday, June 28, 2006 2:31 PM
> > > > >
> > > > > *To:* MyFaces Discussion
> > > > > *Subject:* Re: Design Type Question
> > > > >
> > > > >  Doh!  Didn't even think about that.  Thanks.
> > > > >
> > > > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > > > >
> > > > > >  Couldn't you use a <h:outputText value="#{myBackingBean.....}}
> > > > > > /> and either (a) write out the whole javascript or (b) just write out the
> > > > > > array part?
> > > > > >
> > > > > >
> > > > > >
> > > > > >  ------------------------------
> > > > > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > > > > *Sent: *Wednesday, June 28, 2006 1:38 PM
> > > > > >
> > > > > > *To:* MyFaces Discussion
> > > > > > *Subject:* Re: Design Type Question
> > > > > >
> > > > > >  Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so
> > > > > > I already know how to do that.  What I don't know is how to populate
> > > > > > Javascript arrays with data from my backing bean.
> > > > > >
> > > > > > Aside from a custom component, I'd assume I need to do something
> > > > > > like that.
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > > On 6/28/06, Julian Ray <julianjray@yahoo.com > wrote:
> > > > > > >
> > > > > > >  Here is an example, I have not tested it but have used
> > > > > > > similar approaches
> > > > > > >
> > > > > > > http://www.javascriptkit.com/script/script2/multiplecombo.shtml
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >  ------------------------------
> > > > > > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com ]
> > > > > > > *Sent: *Wednesday, June 28, 2006 11:45 AM
> > > > > > > *To:* MyFaces Discussion
> > > > > > > *Subject:* Re: Design Type Question
> > > > > > >
> > > > > > >  Julian,
> > > > > > >
> > > > > > > Thanks for the suggestions.  How would I go about populating
> > > > > > > javascript values with data from the backing bean if I were to go with [1]?
> > > > > > > Any links with this info?
> > > > > > >
> > > > > > > Thanks.
> > > > > > >
> > > > > > > On 6/28/06, Julian Ray <julianjray@yahoo.com > wrote:
> > > > > > > >
> > > > > > > >  Some suggestions
> > > > > > > >
> > > > > > > > [1] Use client-side population of teh drop downs
> > > > > > > > [2] Use 2 backing beans, 1 for the drop down and 1 for the
> > > > > > > > articles. Lazily load all getters. Use t:saveState to store the filter bean.
> > > > > > > > [3] Use Ajax
> > > > > > > >
> > > > > > > >  ------------------------------
> > > > > > > > *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com ]
> > > > > > > > *Sent:* Wednesday, June 28, 2006 10:20 AM
> > > > > > > > *To:* MyFaces Discussion
> > > > > > > > *Subject:* Design Type Question
> > > > > > > >
> > > > > > > >  This isn't about MyFaces specifically so I apologize but
> > > > > > > > this list is the best JSF resource I know of. ;)
> > > > > > > >
> > > > > > > > I have a page that contains a list of Articles.  There are
> > > > > > > > also filter criteria to filter the list of Articles.  The article list is a
> > > > > > > > dataTable who's value is a method in the backing bean that returns a list of
> > > > > > > > articles.  Simple enough.  So when the page first loads, I get all the
> > > > > > > > articles.
> > > > > > > >
> > > > > > > > The problem I am facing is part of the filter is 3 levels of
> > > > > > > > categories.  Category, Sub Category, and a Sub Sub Category.  Each of these
> > > > > > > > is a selectOneMenu and the child catagories depends on the parent category.
> > > > > > > > So I have valueChangeListeners registered so that when one drop down
> > > > > > > > changes, the child dropdown gets new values.
> > > > > > > >
> > > > > > > > The problem with this is that when this happens, my method
> > > > > > > > to get the list of articles is called.  But I don't want this to happen
> > > > > > > > until I click the Search button.  So I am just looking for solutions to
> > > > > > > > solve this.
> > > > > > > >
> > > > > > > > Thanks.
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

RE: Design Type Question

Posted by Julian Ray <ju...@yahoo.com>.
How are you loading the JS and performing the initialization? onload event
or appending to the window.onload?

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 3:26 PM
To: MyFaces Discussion
Subject: Re: Design Type Question


Alright.  Thanks for the info.  Getting closer.  I have the following being
spit out on my page after rendered.

var options = document.getElementById('catSelect').options; 
var option = new Option('4', 'Active');
options[options.length] = option; 
var option = new Option('69', 'Appreciate');
options[ options.length] = option;
var option = new Option('3', 'Explore');
options[options.length] = option;
var option = new Option('71', 'Habitat');
options[options.length] = option;
var option = new Option('70', 'Indulge');
options[options.length] = option;
var option = new Option('1', 'Locate'); 
options[options.length] = option;
var option = new Option('2', 'People'); 
options[options.length] = option;

And I am getting document.getElementById("catSelect") has no properties
error.  I also see this on the rendered HTML: 

<select id="catSelect" name="catSelect" size="1"> <option
value="0">ALL</option></select>

Which is accurate as to: 

<t:selectOneMenu forceId="true" id="catSelect"
value="#{ArticleListBean.category}">
     <f:selectItem itemLabel="ALL" itemValue="0" />
</t:selectOneMenu> 

Anything jump out?
                    



On 6/28/06, Julian Ray <julianjray@yahoo.com  <ma...@yahoo.com>
> wrote: 

No if you use selectOne components which update the backingbean. Your JS
should reference the selectOne components via ids - you might have to pass
dummy select items but these will get removed then replaced by the JS as it
loads. Remember that the page is rendered before its loaded by the browser
so the JS will execute after the rendering has been performed.

  _____  


From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 3:05 PM

To: MyFaces Discussion
Subject: Re: Design Type Question



Ok, got it working now. One final question.  If I do this with Javascript, I
am going to have to do all the work of updating the model with the new
values since it's client side, correct?  

Maybe this should be my first custom component. Eh? lol. 
Thanks for the help.

Gregg


On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote: 

Scratch that.  I am getting the value. But all the code is escaped. &gt;,
&lt; etc.  So it doesn't register correclty.  Trying something else.... 



On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote: 

Alright, maybe a stupid question...

For testing I have a property in my backing bean called javascript with
getters and setters.  I have initialized javascript with the following:

private String javascript = "<script type=\"text/javascript\">function
testFunction(){ alert('this is a test'); }</script>"; 

And then did:

t:outputText value="#{ArticleListBean.javascript}"/>

But it's not spitting out the code.  Am I doing this wrong?


Thanks.



On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Make sure to use forceId on the select items so the JS can find them
otherwise you will have to prefix the component ids with "formname:" 
 

  _____  


From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com
<ma...@gmail.com> ] 

Sent: Wednesday, June 28, 2006 2:31 PM

To: MyFaces Discussion
Subject: Re: Design Type Question



Doh!  Didn't even think about that.  Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Couldn't you use a <h:outputText value="#{myBackingBean.....}}  /> and
either (a) write out the whole javascript or (b) just write out the array
part?
 
 

  _____  


From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 1:38 PM

To: MyFaces Discussion
Subject: Re: Design Type Question



Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I already
know how to do that.  What I don't know is how to populate Javascript arrays
with data from my backing bean.

Aside from a custom component, I'd assume I need to do something like that. 

Thanks.


On 6/28/06, Julian Ray <julianjray@yahoo.com  <ma...@yahoo.com>
> wrote: 

Here is an example, I have not tested it but have used similar approaches
 
http://www.javascriptkit.com/script/script2/multiplecombo.shtml
 
 


  _____  



From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com
<ma...@gmail.com> ] 

Sent: Wednesday, June 28, 2006 11:45 AM
To: MyFaces Discussion
Subject: Re: Design Type Question



Julian,

Thanks for the suggestions.  How would I go about populating javascript
values with data from the backing bean if I were to go with [1]?  Any links
with this info?

Thanks.


On 6/28/06, Julian Ray <julianjray@yahoo.com  <ma...@yahoo.com>
> wrote: 

Some suggestions
 
[1] Use client-side population of teh drop downs
[2] Use 2 backing beans, 1 for the drop down and 1 for the articles. Lazily
load all getters. Use t:saveState to store the filter bean.
[3] Use Ajax

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com ] 
Sent: Wednesday, June 28, 2006 10:20 AM
To: MyFaces Discussion
Subject: Design Type Question



This isn't about MyFaces specifically so I apologize but this list is the
best JSF resource I know of. ;)

I have a page that contains a list of Articles.  There are also filter
criteria to filter the list of Articles.  The article list is a dataTable
who's value is a method in the backing bean that returns a list of articles.
Simple enough.  So when the page first loads, I get all the articles. 

The problem I am facing is part of the filter is 3 levels of categories.
Category, Sub Category, and a Sub Sub Category.  Each of these is a
selectOneMenu and the child catagories depends on the parent category.  So I
have valueChangeListeners registered so that when one drop down changes, the
child dropdown gets new values. 

The problem with this is that when this happens, my method to get the list
of articles is called.  But I don't want this to happen until I click the
Search button.  So I am just looking for solutions to solve this. 

Thanks.










Re: Design Type Question

Posted by Gregg Bolinger <gd...@gmail.com>.
Alright.  Thanks for the info.  Getting closer.  I have the following being
spit out on my page after rendered.

var options = document.getElementById('catSelect').options; var option = new
Option('4', 'Active');
options[options.length] = option;
var option = new Option('69', 'Appreciate');
options[options.length] = option;
var option = new Option('3', 'Explore');
options[options.length] = option;
var option = new Option('71', 'Habitat');
options[options.length] = option;
var option = new Option('70', 'Indulge');
options[options.length] = option;
var option = new Option('1', 'Locate');
options[options.length] = option;
var option = new Option('2', 'People');
options[options.length] = option;

And I am getting document.getElementById("catSelect") has no properties
error.  I also see this on the rendered HTML:

<select id="catSelect" name="catSelect" size="1"> <option
value="0">ALL</option></select>

Which is accurate as to:

<t:selectOneMenu forceId="true" id="catSelect" value="#{
ArticleListBean.category}">
     <f:selectItem itemLabel="ALL" itemValue="0" />
</t:selectOneMenu>

Anything jump out?



On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
>
>  No if you use selectOne components which update the backingbean. Your JS
> should reference the selectOne components via ids - you might have to pass
> dummy select items but these will get removed then replaced by the JS as it
> loads. Remember that the page is rendered before its loaded by the browser
> so the JS will execute after the rendering has been performed.
>
>  ------------------------------
> *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> *Sent:* Wednesday, June 28, 2006 3:05 PM
>
> *To:* MyFaces Discussion
> *Subject:* Re: Design Type Question
>
> Ok, got it working now. One final question.  If I do this with Javascript,
> I am going to have to do all the work of updating the model with the new
> values since it's client side, correct?
>
> Maybe this should be my first custom component. Eh? lol.
> Thanks for the help.
>
> Gregg
>
> On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote:
> >
> > Scratch that.  I am getting the value. But all the code is escaped.
> > &gt;, &lt; etc.  So it doesn't register correclty.  Trying something
> > else....
> >
> >
> > On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote:
> > >
> > > Alright, maybe a stupid question...
> > >
> > > For testing I have a property in my backing bean called javascript
> > > with getters and setters.  I have initialized javascript with the following:
> > >
> > > private String javascript = "<script type=\"text/javascript\">function
> > > testFunction(){ alert('this is a test'); }</script>";
> > >
> > > And then did:
> > >
> > > t:outputText value="#{ArticleListBean.javascript}"/>
> > >
> > > But it's not spitting out the code.  Am I doing this wrong?
> > >
> > >
> > > Thanks.
> > >
> > >
> > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > >
> > > >  Make sure to use forceId on the select items so the JS can find
> > > > them otherwise you will have to prefix the component ids with "formname:"
> > > >
> > > >
> > > >  ------------------------------
> > > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > > *Sent: *Wednesday, June 28, 2006 2:31 PM
> > > >
> > > > *To:* MyFaces Discussion
> > > > *Subject:* Re: Design Type Question
> > > >
> > > >  Doh!  Didn't even think about that.  Thanks.
> > > >
> > > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > > >
> > > > >  Couldn't you use a <h:outputText value="#{myBackingBean.....}}
> > > > > /> and either (a) write out the whole javascript or (b) just write out the
> > > > > array part?
> > > > >
> > > > >
> > > > >
> > > > >  ------------------------------
> > > > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > > > *Sent: *Wednesday, June 28, 2006 1:38 PM
> > > > >
> > > > > *To:* MyFaces Discussion
> > > > > *Subject:* Re: Design Type Question
> > > > >
> > > > >  Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I
> > > > > already know how to do that.  What I don't know is how to populate
> > > > > Javascript arrays with data from my backing bean.
> > > > >
> > > > > Aside from a custom component, I'd assume I need to do something
> > > > > like that.
> > > > >
> > > > > Thanks.
> > > > >
> > > > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > > > >
> > > > > >  Here is an example, I have not tested it but have used similar
> > > > > > approaches
> > > > > >
> > > > > > http://www.javascriptkit.com/script/script2/multiplecombo.shtml
> > > > > >
> > > > > >
> > > > > >
> > > > > >  ------------------------------
> > > > > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com ]
> > > > > > *Sent: *Wednesday, June 28, 2006 11:45 AM
> > > > > > *To:* MyFaces Discussion
> > > > > > *Subject:* Re: Design Type Question
> > > > > >
> > > > > >  Julian,
> > > > > >
> > > > > > Thanks for the suggestions.  How would I go about populating
> > > > > > javascript values with data from the backing bean if I were to go with [1]?
> > > > > > Any links with this info?
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > > > > >
> > > > > > >  Some suggestions
> > > > > > >
> > > > > > > [1] Use client-side population of teh drop downs
> > > > > > > [2] Use 2 backing beans, 1 for the drop down and 1 for the
> > > > > > > articles. Lazily load all getters. Use t:saveState to store the filter bean.
> > > > > > > [3] Use Ajax
> > > > > > >
> > > > > > >  ------------------------------
> > > > > > > *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > > > > > *Sent:* Wednesday, June 28, 2006 10:20 AM
> > > > > > > *To:* MyFaces Discussion
> > > > > > > *Subject:* Design Type Question
> > > > > > >
> > > > > > >  This isn't about MyFaces specifically so I apologize but this
> > > > > > > list is the best JSF resource I know of. ;)
> > > > > > >
> > > > > > > I have a page that contains a list of Articles.  There are
> > > > > > > also filter criteria to filter the list of Articles.  The article list is a
> > > > > > > dataTable who's value is a method in the backing bean that returns a list of
> > > > > > > articles.  Simple enough.  So when the page first loads, I get all the
> > > > > > > articles.
> > > > > > >
> > > > > > > The problem I am facing is part of the filter is 3 levels of
> > > > > > > categories.  Category, Sub Category, and a Sub Sub Category.  Each of these
> > > > > > > is a selectOneMenu and the child catagories depends on the parent category.
> > > > > > > So I have valueChangeListeners registered so that when one drop down
> > > > > > > changes, the child dropdown gets new values.
> > > > > > >
> > > > > > > The problem with this is that when this happens, my method to
> > > > > > > get the list of articles is called.  But I don't want this to happen until I
> > > > > > > click the Search button.  So I am just looking for solutions to solve this.
> > > > > > >
> > > > > > > Thanks.
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

RE: Design Type Question

Posted by Julian Ray <ju...@yahoo.com>.
No if you use selectOne components which update the backingbean. Your JS
should reference the selectOne components via ids - you might have to pass
dummy select items but these will get removed then replaced by the JS as it
loads. Remember that the page is rendered before its loaded by the browser
so the JS will execute after the rendering has been performed.

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 3:05 PM
To: MyFaces Discussion
Subject: Re: Design Type Question


Ok, got it working now. One final question.  If I do this with Javascript, I
am going to have to do all the work of updating the model with the new
values since it's client side, correct?  

Maybe this should be my first custom component. Eh? lol. 
Thanks for the help.

Gregg


On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote: 

Scratch that.  I am getting the value. But all the code is escaped. &gt;,
&lt; etc.  So it doesn't register correclty.  Trying something else.... 



On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote: 

Alright, maybe a stupid question...

For testing I have a property in my backing bean called javascript with
getters and setters.  I have initialized javascript with the following:

private String javascript = "<script type=\"text/javascript\">function
testFunction(){ alert('this is a test'); }</script>"; 

And then did:

t:outputText value="#{ArticleListBean.javascript}"/>

But it's not spitting out the code.  Am I doing this wrong?


Thanks.



On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Make sure to use forceId on the select items so the JS can find them
otherwise you will have to prefix the component ids with "formname:" 
 

  _____  


From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 2:31 PM

To: MyFaces Discussion
Subject: Re: Design Type Question



Doh!  Didn't even think about that.  Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Couldn't you use a <h:outputText value="#{myBackingBean.....}}  /> and
either (a) write out the whole javascript or (b) just write out the array
part?
 
 

  _____  


From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 1:38 PM

To: MyFaces Discussion
Subject: Re: Design Type Question



Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I already
know how to do that.  What I don't know is how to populate Javascript arrays
with data from my backing bean.

Aside from a custom component, I'd assume I need to do something like that. 

Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Here is an example, I have not tested it but have used similar approaches
 
http://www.javascriptkit.com/script/script2/multiplecombo.shtml
 
 


  _____  



From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com
<ma...@gmail.com> ] 

Sent: Wednesday, June 28, 2006 11:45 AM
To: MyFaces Discussion
Subject: Re: Design Type Question



Julian,

Thanks for the suggestions.  How would I go about populating javascript
values with data from the backing bean if I were to go with [1]?  Any links
with this info?

Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Some suggestions
 
[1] Use client-side population of teh drop downs
[2] Use 2 backing beans, 1 for the drop down and 1 for the articles. Lazily
load all getters. Use t:saveState to store the filter bean.
[3] Use Ajax

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 10:20 AM
To: MyFaces Discussion
Subject: Design Type Question



This isn't about MyFaces specifically so I apologize but this list is the
best JSF resource I know of. ;)

I have a page that contains a list of Articles.  There are also filter
criteria to filter the list of Articles.  The article list is a dataTable
who's value is a method in the backing bean that returns a list of articles.
Simple enough.  So when the page first loads, I get all the articles. 

The problem I am facing is part of the filter is 3 levels of categories.
Category, Sub Category, and a Sub Sub Category.  Each of these is a
selectOneMenu and the child catagories depends on the parent category.  So I
have valueChangeListeners registered so that when one drop down changes, the
child dropdown gets new values. 

The problem with this is that when this happens, my method to get the list
of articles is called.  But I don't want this to happen until I click the
Search button.  So I am just looking for solutions to solve this. 

Thanks.









Re: Design Type Question

Posted by Gregg Bolinger <gd...@gmail.com>.
Ok, got it working now. One final question.  If I do this with Javascript, I
am going to have to do all the work of updating the model with the new
values since it's client side, correct?

Maybe this should be my first custom component. Eh? lol.
Thanks for the help.

Gregg

On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote:
>
> Scratch that.  I am getting the value. But all the code is escaped. &gt;,
> &lt; etc.  So it doesn't register correclty.  Trying something else....
>
>
> On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote:
> >
> > Alright, maybe a stupid question...
> >
> > For testing I have a property in my backing bean called javascript with
> > getters and setters.  I have initialized javascript with the following:
> >
> > private String javascript = "<script type=\"text/javascript\">function
> > testFunction(){ alert('this is a test'); }</script>";
> >
> > And then did:
> >
> > t:outputText value="#{ArticleListBean.javascript}"/>
> >
> > But it's not spitting out the code.  Am I doing this wrong?
> >
> >
> > Thanks.
> >
> >
> > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > >
> > >  Make sure to use forceId on the select items so the JS can find them
> > > otherwise you will have to prefix the component ids with "formname:"
> > >
> > >
> > >  ------------------------------
> > > *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > *Sent: * Wednesday, June 28, 2006 2:31 PM
> > >
> > > *To:* MyFaces Discussion
> > > *Subject:* Re: Design Type Question
> > >
> > > Doh!  Didn't even think about that.  Thanks.
> > >
> > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > >
> > > >  Couldn't you use a <h:outputText value="#{myBackingBean.....}}  />
> > > > and either (a) write out the whole javascript or (b) just write out the
> > > > array part?
> > > >
> > > >
> > > >
> > > >  ------------------------------
> > > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > > *Sent: *Wednesday, June 28, 2006 1:38 PM
> > > >
> > > > *To:* MyFaces Discussion
> > > > *Subject:* Re: Design Type Question
> > > >
> > > >  Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I
> > > > already know how to do that.  What I don't know is how to populate
> > > > Javascript arrays with data from my backing bean.
> > > >
> > > > Aside from a custom component, I'd assume I need to do something
> > > > like that.
> > > >
> > > > Thanks.
> > > >
> > > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > > >
> > > > >  Here is an example, I have not tested it but have used similar
> > > > > approaches
> > > > >
> > > > >  http://www.javascriptkit.com/script/script2/multiplecombo.shtml
> > > > >
> > > > >
> > > > >
> > > > >  ------------------------------
> > > > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com ]
> > > > > *Sent: *Wednesday, June 28, 2006 11:45 AM
> > > > > *To:* MyFaces Discussion
> > > > > *Subject:* Re: Design Type Question
> > > > >
> > > > >  Julian,
> > > > >
> > > > > Thanks for the suggestions.  How would I go about populating
> > > > > javascript values with data from the backing bean if I were to go with [1]?
> > > > > Any links with this info?
> > > > >
> > > > > Thanks.
> > > > >
> > > > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > > > >
> > > > > >  Some suggestions
> > > > > >
> > > > > > [1] Use client-side population of teh drop downs
> > > > > > [2] Use 2 backing beans, 1 for the drop down and 1 for the
> > > > > > articles. Lazily load all getters. Use t:saveState to store the filter bean.
> > > > > > [3] Use Ajax
> > > > > >
> > > > > >  ------------------------------
> > > > > > *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > > > > *Sent:* Wednesday, June 28, 2006 10:20 AM
> > > > > > *To:* MyFaces Discussion
> > > > > > *Subject:* Design Type Question
> > > > > >
> > > > > >  This isn't about MyFaces specifically so I apologize but this
> > > > > > list is the best JSF resource I know of. ;)
> > > > > >
> > > > > > I have a page that contains a list of Articles.  There are also
> > > > > > filter criteria to filter the list of Articles.  The article list is a
> > > > > > dataTable who's value is a method in the backing bean that returns a list of
> > > > > > articles.  Simple enough.  So when the page first loads, I get all the
> > > > > > articles.
> > > > > >
> > > > > > The problem I am facing is part of the filter is 3 levels of
> > > > > > categories.  Category, Sub Category, and a Sub Sub Category.  Each of these
> > > > > > is a selectOneMenu and the child catagories depends on the parent category.
> > > > > > So I have valueChangeListeners registered so that when one drop down
> > > > > > changes, the child dropdown gets new values.
> > > > > >
> > > > > > The problem with this is that when this happens, my method to
> > > > > > get the list of articles is called.  But I don't want this to happen until I
> > > > > > click the Search button.  So I am just looking for solutions to solve this.
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: Design Type Question

Posted by Gregg Bolinger <gd...@gmail.com>.
Scratch that.  I am getting the value. But all the code is escaped. &gt;,
&lt; etc.  So it doesn't register correclty.  Trying something else....

On 6/28/06, Gregg Bolinger <gd...@gmail.com> wrote:
>
> Alright, maybe a stupid question...
>
> For testing I have a property in my backing bean called javascript with
> getters and setters.  I have initialized javascript with the following:
>
> private String javascript = "<script type=\"text/javascript\">function
> testFunction(){ alert('this is a test'); }</script>";
>
> And then did:
>
> t:outputText value="#{ArticleListBean.javascript}"/>
>
> But it's not spitting out the code.  Am I doing this wrong?
>
>
> Thanks.
>
>
> On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> >
> >  Make sure to use forceId on the select items so the JS can find them
> > otherwise you will have to prefix the component ids with "formname:"
> >
> >
> >  ------------------------------
> > *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > *Sent: * Wednesday, June 28, 2006 2:31 PM
> >
> > *To:* MyFaces Discussion
> > *Subject:* Re: Design Type Question
> >
> > Doh!  Didn't even think about that.  Thanks.
> >
> > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > >
> > >  Couldn't you use a <h:outputText value="#{myBackingBean.....}}  />
> > > and either (a) write out the whole javascript or (b) just write out the
> > > array part?
> > >
> > >
> > >
> > >  ------------------------------
> > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > *Sent: *Wednesday, June 28, 2006 1:38 PM
> > >
> > > *To:* MyFaces Discussion
> > > *Subject:* Re: Design Type Question
> > >
> > >  Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I
> > > already know how to do that.  What I don't know is how to populate
> > > Javascript arrays with data from my backing bean.
> > >
> > > Aside from a custom component, I'd assume I need to do something like
> > > that.
> > >
> > > Thanks.
> > >
> > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > >
> > > >  Here is an example, I have not tested it but have used similar
> > > > approaches
> > > >
> > > >  http://www.javascriptkit.com/script/script2/multiplecombo.shtml
> > > >
> > > >
> > > >
> > > >  ------------------------------
> > > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com ]
> > > > *Sent: *Wednesday, June 28, 2006 11:45 AM
> > > > *To:* MyFaces Discussion
> > > > *Subject:* Re: Design Type Question
> > > >
> > > >  Julian,
> > > >
> > > > Thanks for the suggestions.  How would I go about populating
> > > > javascript values with data from the backing bean if I were to go with [1]?
> > > > Any links with this info?
> > > >
> > > > Thanks.
> > > >
> > > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > > >
> > > > >  Some suggestions
> > > > >
> > > > > [1] Use client-side population of teh drop downs
> > > > > [2] Use 2 backing beans, 1 for the drop down and 1 for the
> > > > > articles. Lazily load all getters. Use t:saveState to store the filter bean.
> > > > > [3] Use Ajax
> > > > >
> > > > >  ------------------------------
> > > > > *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > > > *Sent:* Wednesday, June 28, 2006 10:20 AM
> > > > > *To:* MyFaces Discussion
> > > > > *Subject:* Design Type Question
> > > > >
> > > > >  This isn't about MyFaces specifically so I apologize but this
> > > > > list is the best JSF resource I know of. ;)
> > > > >
> > > > > I have a page that contains a list of Articles.  There are also
> > > > > filter criteria to filter the list of Articles.  The article list is a
> > > > > dataTable who's value is a method in the backing bean that returns a list of
> > > > > articles.  Simple enough.  So when the page first loads, I get all the
> > > > > articles.
> > > > >
> > > > > The problem I am facing is part of the filter is 3 levels of
> > > > > categories.  Category, Sub Category, and a Sub Sub Category.  Each of these
> > > > > is a selectOneMenu and the child catagories depends on the parent category.
> > > > > So I have valueChangeListeners registered so that when one drop down
> > > > > changes, the child dropdown gets new values.
> > > > >
> > > > > The problem with this is that when this happens, my method to get
> > > > > the list of articles is called.  But I don't want this to happen until I
> > > > > click the Search button.  So I am just looking for solutions to solve this.
> > > > >
> > > > > Thanks.
> > > > >
> > > >
> > > >
> > >
> >
>

Re: Design Type Question

Posted by Gregg Bolinger <gd...@gmail.com>.
Alright, maybe a stupid question...

For testing I have a property in my backing bean called javascript with
getters and setters.  I have initialized javascript with the following:

private String javascript = "<script type=\"text/javascript\">function
testFunction(){ alert('this is a test'); }</script>";

And then did:

t:outputText value="#{ArticleListBean.javascript}"/>

But it's not spitting out the code.  Am I doing this wrong?

Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
>
>  Make sure to use forceId on the select items so the JS can find them
> otherwise you will have to prefix the component ids with "formname:"
>
>
>  ------------------------------
> *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> *Sent:* Wednesday, June 28, 2006 2:31 PM
>
> *To:* MyFaces Discussion
> *Subject:* Re: Design Type Question
>
> Doh!  Didn't even think about that.  Thanks.
>
> On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> >
> >  Couldn't you use a <h:outputText value="#{myBackingBean.....}}  /> and
> > either (a) write out the whole javascript or (b) just write out the array
> > part?
> >
> >
> >
> >  ------------------------------
> >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > *Sent: *Wednesday, June 28, 2006 1:38 PM
> >
> > *To:* MyFaces Discussion
> > *Subject:* Re: Design Type Question
> >
> >  Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I
> > already know how to do that.  What I don't know is how to populate
> > Javascript arrays with data from my backing bean.
> >
> > Aside from a custom component, I'd assume I need to do something like
> > that.
> >
> > Thanks.
> >
> > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > >
> > >  Here is an example, I have not tested it but have used similar
> > > approaches
> > >
> > > http://www.javascriptkit.com/script/script2/multiplecombo.shtml
> > >
> > >
> > >
> > >  ------------------------------
> > >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > *Sent: *Wednesday, June 28, 2006 11:45 AM
> > > *To:* MyFaces Discussion
> > > *Subject:* Re: Design Type Question
> > >
> > >  Julian,
> > >
> > > Thanks for the suggestions.  How would I go about populating
> > > javascript values with data from the backing bean if I were to go with [1]?
> > > Any links with this info?
> > >
> > > Thanks.
> > >
> > > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > > >
> > > >  Some suggestions
> > > >
> > > > [1] Use client-side population of teh drop downs
> > > > [2] Use 2 backing beans, 1 for the drop down and 1 for the articles.
> > > > Lazily load all getters. Use t:saveState to store the filter bean.
> > > > [3] Use Ajax
> > > >
> > > >  ------------------------------
> > > > *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > > *Sent:* Wednesday, June 28, 2006 10:20 AM
> > > > *To:* MyFaces Discussion
> > > > *Subject:* Design Type Question
> > > >
> > > >  This isn't about MyFaces specifically so I apologize but this list
> > > > is the best JSF resource I know of. ;)
> > > >
> > > > I have a page that contains a list of Articles.  There are also
> > > > filter criteria to filter the list of Articles.  The article list is a
> > > > dataTable who's value is a method in the backing bean that returns a list of
> > > > articles.  Simple enough.  So when the page first loads, I get all the
> > > > articles.
> > > >
> > > > The problem I am facing is part of the filter is 3 levels of
> > > > categories.  Category, Sub Category, and a Sub Sub Category.  Each of these
> > > > is a selectOneMenu and the child catagories depends on the parent category.
> > > > So I have valueChangeListeners registered so that when one drop down
> > > > changes, the child dropdown gets new values.
> > > >
> > > > The problem with this is that when this happens, my method to get
> > > > the list of articles is called.  But I don't want this to happen until I
> > > > click the Search button.  So I am just looking for solutions to solve this.
> > > >
> > > > Thanks.
> > > >
> > >
> > >
> >
>

RE: Design Type Question

Posted by L Frohman <lf...@gmail.com>.
Another way to populate Javascript arrays with data from a jsf backing bean.
 
<script language="JavaScript">
var myJavaScriptArray = ${sessionScope.myBackingBean.myValue};
</script>
 
where myBackingBean is the name of the backing bean, change sessionScope to
requestScope if myBackingBean is request scope. The call to
sessionScope.myBackingBean does not initialize the myBackingBean, so
myBackingBean must already "be there".



  _____  

De : Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Envoyé : mercredi 28 juin 2006 20:31
À : MyFaces Discussion
Objet : Re: Design Type Question


Doh!  Didn't even think about that.  Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Couldn't you use a <h:outputText value="#{myBackingBean.....}}  /> and
either (a) write out the whole javascript or (b) just write out the array
part?
 
 

  _____  


From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 1:38 PM

To: MyFaces Discussion
Subject: Re: Design Type Question



Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I already
know how to do that.  What I don't know is how to populate Javascript arrays
with data from my backing bean.

Aside from a custom component, I'd assume I need to do something like that. 

Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Here is an example, I have not tested it but have used similar approaches
 
http://www.javascriptkit.com/script/script2/multiplecombo.shtml
 
 


  _____  



From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 11:45 AM
To: MyFaces Discussion
Subject: Re: Design Type Question



Julian,

Thanks for the suggestions.  How would I go about populating javascript
values with data from the backing bean if I were to go with [1]?  Any links
with this info?

Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Some suggestions
 
[1] Use client-side population of teh drop downs
[2] Use 2 backing beans, 1 for the drop down and 1 for the articles. Lazily
load all getters. Use t:saveState to store the filter bean.
[3] Use Ajax

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 10:20 AM
To: MyFaces Discussion
Subject: Design Type Question



This isn't about MyFaces specifically so I apologize but this list is the
best JSF resource I know of. ;)

I have a page that contains a list of Articles.  There are also filter
criteria to filter the list of Articles.  The article list is a dataTable
who's value is a method in the backing bean that returns a list of articles.
Simple enough.  So when the page first loads, I get all the articles. 

The problem I am facing is part of the filter is 3 levels of categories.
Category, Sub Category, and a Sub Sub Category.  Each of these is a
selectOneMenu and the child catagories depends on the parent category.  So I
have valueChangeListeners registered so that when one drop down changes, the
child dropdown gets new values. 

The problem with this is that when this happens, my method to get the list
of articles is called.  But I don't want this to happen until I click the
Search button.  So I am just looking for solutions to solve this. 

Thanks.






RE: Design Type Question

Posted by Julian Ray <ju...@yahoo.com>.
Make sure to use forceId on the select items so the JS can find them
otherwise you will have to prefix the component ids with "formname:" 
 

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 2:31 PM
To: MyFaces Discussion
Subject: Re: Design Type Question


Doh!  Didn't even think about that.  Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Couldn't you use a <h:outputText value="#{myBackingBean.....}}  /> and
either (a) write out the whole javascript or (b) just write out the array
part?
 
 

  _____  


From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 1:38 PM

To: MyFaces Discussion
Subject: Re: Design Type Question



Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I already
know how to do that.  What I don't know is how to populate Javascript arrays
with data from my backing bean.

Aside from a custom component, I'd assume I need to do something like that. 

Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Here is an example, I have not tested it but have used similar approaches
 
http://www.javascriptkit.com/script/script2/multiplecombo.shtml
 
 


  _____  



From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 11:45 AM
To: MyFaces Discussion
Subject: Re: Design Type Question



Julian,

Thanks for the suggestions.  How would I go about populating javascript
values with data from the backing bean if I were to go with [1]?  Any links
with this info?

Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Some suggestions
 
[1] Use client-side population of teh drop downs
[2] Use 2 backing beans, 1 for the drop down and 1 for the articles. Lazily
load all getters. Use t:saveState to store the filter bean.
[3] Use Ajax

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 10:20 AM
To: MyFaces Discussion
Subject: Design Type Question



This isn't about MyFaces specifically so I apologize but this list is the
best JSF resource I know of. ;)

I have a page that contains a list of Articles.  There are also filter
criteria to filter the list of Articles.  The article list is a dataTable
who's value is a method in the backing bean that returns a list of articles.
Simple enough.  So when the page first loads, I get all the articles. 

The problem I am facing is part of the filter is 3 levels of categories.
Category, Sub Category, and a Sub Sub Category.  Each of these is a
selectOneMenu and the child catagories depends on the parent category.  So I
have valueChangeListeners registered so that when one drop down changes, the
child dropdown gets new values. 

The problem with this is that when this happens, my method to get the list
of articles is called.  But I don't want this to happen until I click the
Search button.  So I am just looking for solutions to solve this. 

Thanks.






Re: Design Type Question

Posted by Gregg Bolinger <gd...@gmail.com>.
Doh!  Didn't even think about that.  Thanks.

On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
>
>  Couldn't you use a <h:outputText value="#{myBackingBean.....}}  /> and
> either (a) write out the whole javascript or (b) just write out the array
> part?
>
>
>
>  ------------------------------
> *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> *Sent:* Wednesday, June 28, 2006 1:38 PM
>
> *To:* MyFaces Discussion
> *Subject:* Re: Design Type Question
>
> Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I already
> know how to do that.  What I don't know is how to populate Javascript arrays
> with data from my backing bean.
>
> Aside from a custom component, I'd assume I need to do something like
> that.
>
> Thanks.
>
> On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> >
> >  Here is an example, I have not tested it but have used similar
> > approaches
> >
> > http://www.javascriptkit.com/script/script2/multiplecombo.shtml
> >
> >
> >
> >  ------------------------------
> >  *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > *Sent: *Wednesday, June 28, 2006 11:45 AM
> > *To:* MyFaces Discussion
> > *Subject:* Re: Design Type Question
> >
> >  Julian,
> >
> > Thanks for the suggestions.  How would I go about populating javascript
> > values with data from the backing bean if I were to go with [1]?  Any links
> > with this info?
> >
> > Thanks.
> >
> > On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> > >
> > >  Some suggestions
> > >
> > > [1] Use client-side population of teh drop downs
> > > [2] Use 2 backing beans, 1 for the drop down and 1 for the articles.
> > > Lazily load all getters. Use t:saveState to store the filter bean.
> > > [3] Use Ajax
> > >
> > >  ------------------------------
> > > *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > > *Sent:* Wednesday, June 28, 2006 10:20 AM
> > > *To:* MyFaces Discussion
> > > *Subject:* Design Type Question
> > >
> > >  This isn't about MyFaces specifically so I apologize but this list is
> > > the best JSF resource I know of. ;)
> > >
> > > I have a page that contains a list of Articles.  There are also filter
> > > criteria to filter the list of Articles.  The article list is a dataTable
> > > who's value is a method in the backing bean that returns a list of
> > > articles.  Simple enough.  So when the page first loads, I get all the
> > > articles.
> > >
> > > The problem I am facing is part of the filter is 3 levels of
> > > categories.  Category, Sub Category, and a Sub Sub Category.  Each of these
> > > is a selectOneMenu and the child catagories depends on the parent category.
> > > So I have valueChangeListeners registered so that when one drop down
> > > changes, the child dropdown gets new values.
> > >
> > > The problem with this is that when this happens, my method to get the
> > > list of articles is called.  But I don't want this to happen until I click
> > > the Search button.  So I am just looking for solutions to solve this.
> > >
> > > Thanks.
> > >
> >
> >
>

RE: Design Type Question

Posted by Julian Ray <ju...@yahoo.com>.
Couldn't you use a <h:outputText value="#{myBackingBean.....}}  /> and
either (a) write out the whole javascript or (b) just write out the array
part?
 
 

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 1:38 PM
To: MyFaces Discussion
Subject: Re: Design Type Question


Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I already
know how to do that.  What I don't know is how to populate Javascript arrays
with data from my backing bean.

Aside from a custom component, I'd assume I need to do something like that. 

Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Here is an example, I have not tested it but have used similar approaches
 
http://www.javascriptkit.com/script/script2/multiplecombo.shtml
 
 


  _____  



From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 

Sent: Wednesday, June 28, 2006 11:45 AM
To: MyFaces Discussion
Subject: Re: Design Type Question



Julian,

Thanks for the suggestions.  How would I go about populating javascript
values with data from the backing bean if I were to go with [1]?  Any links
with this info?

Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Some suggestions
 
[1] Use client-side population of teh drop downs
[2] Use 2 backing beans, 1 for the drop down and 1 for the articles. Lazily
load all getters. Use t:saveState to store the filter bean.
[3] Use Ajax

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 10:20 AM
To: MyFaces Discussion
Subject: Design Type Question



This isn't about MyFaces specifically so I apologize but this list is the
best JSF resource I know of. ;)

I have a page that contains a list of Articles.  There are also filter
criteria to filter the list of Articles.  The article list is a dataTable
who's value is a method in the backing bean that returns a list of articles.
Simple enough.  So when the page first loads, I get all the articles. 

The problem I am facing is part of the filter is 3 levels of categories.
Category, Sub Category, and a Sub Sub Category.  Each of these is a
selectOneMenu and the child catagories depends on the parent category.  So I
have valueChangeListeners registered so that when one drop down changes, the
child dropdown gets new values. 

The problem with this is that when this happens, my method to get the list
of articles is called.  But I don't want this to happen until I click the
Search button.  So I am just looking for solutions to solve this. 

Thanks.





Re: Design Type Question

Posted by Gregg Bolinger <gd...@gmail.com>.
Thanks Julian.  *Unfortunately* I'm well adapt at Javascript so I already
know how to do that.  What I don't know is how to populate Javascript arrays
with data from my backing bean.

Aside from a custom component, I'd assume I need to do something like that.

Thanks.

On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
>
>  Here is an example, I have not tested it but have used similar approaches
>
> http://www.javascriptkit.com/script/script2/multiplecombo.shtml
>
>
>
>  ------------------------------
> *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> *Sent:* Wednesday, June 28, 2006 11:45 AM
> *To:* MyFaces Discussion
> *Subject:* Re: Design Type Question
>
> Julian,
>
> Thanks for the suggestions.  How would I go about populating javascript
> values with data from the backing bean if I were to go with [1]?  Any links
> with this info?
>
> Thanks.
>
> On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
> >
> >  Some suggestions
> >
> > [1] Use client-side population of teh drop downs
> > [2] Use 2 backing beans, 1 for the drop down and 1 for the articles.
> > Lazily load all getters. Use t:saveState to store the filter bean.
> > [3] Use Ajax
> >
> >  ------------------------------
> > *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> > *Sent:* Wednesday, June 28, 2006 10:20 AM
> > *To:* MyFaces Discussion
> > *Subject:* Design Type Question
> >
> >  This isn't about MyFaces specifically so I apologize but this list is
> > the best JSF resource I know of. ;)
> >
> > I have a page that contains a list of Articles.  There are also filter
> > criteria to filter the list of Articles.  The article list is a dataTable
> > who's value is a method in the backing bean that returns a list of
> > articles.  Simple enough.  So when the page first loads, I get all the
> > articles.
> >
> > The problem I am facing is part of the filter is 3 levels of
> > categories.  Category, Sub Category, and a Sub Sub Category.  Each of these
> > is a selectOneMenu and the child catagories depends on the parent category.
> > So I have valueChangeListeners registered so that when one drop down
> > changes, the child dropdown gets new values.
> >
> > The problem with this is that when this happens, my method to get the
> > list of articles is called.  But I don't want this to happen until I click
> > the Search button.  So I am just looking for solutions to solve this.
> >
> > Thanks.
> >
>
>

RE: Design Type Question

Posted by Julian Ray <ju...@yahoo.com>.
Here is an example, I have not tested it but have used similar approaches
 
http://www.javascriptkit.com/script/script2/multiplecombo.shtml
 
 


  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 11:45 AM
To: MyFaces Discussion
Subject: Re: Design Type Question


Julian,

Thanks for the suggestions.  How would I go about populating javascript
values with data from the backing bean if I were to go with [1]?  Any links
with this info?

Thanks.


On 6/28/06, Julian Ray <ju...@yahoo.com> wrote: 

Some suggestions
 
[1] Use client-side population of teh drop downs
[2] Use 2 backing beans, 1 for the drop down and 1 for the articles. Lazily
load all getters. Use t:saveState to store the filter bean.
[3] Use Ajax

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 10:20 AM
To: MyFaces Discussion
Subject: Design Type Question



This isn't about MyFaces specifically so I apologize but this list is the
best JSF resource I know of. ;)

I have a page that contains a list of Articles.  There are also filter
criteria to filter the list of Articles.  The article list is a dataTable
who's value is a method in the backing bean that returns a list of articles.
Simple enough.  So when the page first loads, I get all the articles. 

The problem I am facing is part of the filter is 3 levels of categories.
Category, Sub Category, and a Sub Sub Category.  Each of these is a
selectOneMenu and the child catagories depends on the parent category.  So I
have valueChangeListeners registered so that when one drop down changes, the
child dropdown gets new values. 

The problem with this is that when this happens, my method to get the list
of articles is called.  But I don't want this to happen until I click the
Search button.  So I am just looking for solutions to solve this. 

Thanks.




Re: Design Type Question

Posted by Gregg Bolinger <gd...@gmail.com>.
Julian,

Thanks for the suggestions.  How would I go about populating javascript
values with data from the backing bean if I were to go with [1]?  Any links
with this info?

Thanks.

On 6/28/06, Julian Ray <ju...@yahoo.com> wrote:
>
>  Some suggestions
>
> [1] Use client-side population of teh drop downs
> [2] Use 2 backing beans, 1 for the drop down and 1 for the articles.
> Lazily load all getters. Use t:saveState to store the filter bean.
> [3] Use Ajax
>
>  ------------------------------
> *From:* Gregg Bolinger [mailto:gdboling.myfaces@gmail.com]
> *Sent:* Wednesday, June 28, 2006 10:20 AM
> *To:* MyFaces Discussion
> *Subject:* Design Type Question
>
> This isn't about MyFaces specifically so I apologize but this list is the
> best JSF resource I know of. ;)
>
> I have a page that contains a list of Articles.  There are also filter
> criteria to filter the list of Articles.  The article list is a dataTable
> who's value is a method in the backing bean that returns a list of
> articles.  Simple enough.  So when the page first loads, I get all the
> articles.
>
> The problem I am facing is part of the filter is 3 levels of categories.
> Category, Sub Category, and a Sub Sub Category.  Each of these is a
> selectOneMenu and the child catagories depends on the parent category.  So I
> have valueChangeListeners registered so that when one drop down changes, the
> child dropdown gets new values.
>
> The problem with this is that when this happens, my method to get the list
> of articles is called.  But I don't want this to happen until I click the
> Search button.  So I am just looking for solutions to solve this.
>
> Thanks.
>

RE: Design Type Question

Posted by Julian Ray <ju...@yahoo.com>.
Some suggestions
 
[1] Use client-side population of teh drop downs
[2] Use 2 backing beans, 1 for the drop down and 1 for the articles. Lazily
load all getters. Use t:saveState to store the filter bean.
[3] Use Ajax

  _____  

From: Gregg Bolinger [mailto:gdboling.myfaces@gmail.com] 
Sent: Wednesday, June 28, 2006 10:20 AM
To: MyFaces Discussion
Subject: Design Type Question


This isn't about MyFaces specifically so I apologize but this list is the
best JSF resource I know of. ;)

I have a page that contains a list of Articles.  There are also filter
criteria to filter the list of Articles.  The article list is a dataTable
who's value is a method in the backing bean that returns a list of articles.
Simple enough.  So when the page first loads, I get all the articles. 

The problem I am facing is part of the filter is 3 levels of categories.
Category, Sub Category, and a Sub Sub Category.  Each of these is a
selectOneMenu and the child catagories depends on the parent category.  So I
have valueChangeListeners registered so that when one drop down changes, the
child dropdown gets new values. 

The problem with this is that when this happens, my method to get the list
of articles is called.  But I don't want this to happen until I click the
Search button.  So I am just looking for solutions to solve this. 

Thanks.