incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Renzo Tomaselli <renzo.tomase...@tecnotp.it>
Subject Re: [Trinidad] about usage of SelectManyShuttle/SelectOrderShuttle
Date Mon, 16 Apr 2007 18:23:36 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks Mr. D. (whatever it means <span class="moz-smiley-s1"><span>
:-) </span></span>), great explanation, now it looks simple to use.<br>
It would have been hard to derive it from provided docs.<br>
Now the missing parts are the usage of filter and footer facets. The
former "places a filter above the list in the leading container",
whatever this means (sounds a bit recursive).<br>
The latter - well I don't understand why that component should provide
me with space for a button "below each of the lists". Doing what ? I
can place anything below those lists (as trailing component), and still
wire it to the ShuttleProxy js methods for cross-operations.<br>
<br>
-- Renzo<br>
<br>
<br>
D. Cardon wrote:
<blockquote cite="mid414331.16769.qm@web32002.mail.mud.yahoo.com"
 type="cite">
  <pre wrap="">Renzo,

Sorry about that last post--I accidentally sent it
before I was done...

Anyway, let me send the real message:

In order to populate the list of selectable items from
your backing bean, you can use:

&lt;f:selectItems value="#{backingBean.shuttleItems} /&gt;

The backingBean object should have a 'getShuttleItems'
accessor, which returns a: SelectItem[].  Each select
item may be an object-label pair, so there's where you
store your object reference.  The value of the shuttle
component is an array of the objects (those which
appear in the object label pairs) that are currently
selected (on the right side of the shuttle).

For example, suppose the component on the page looks
like this:

&lt;tr:selectManyShuttle 
    value="#{backingBean.selectedShuttleItems}"&gt;
	&lt;f:selectItems 
	value="#{backingBean.shuttleItems}" /&gt;
&lt;/tr:selectManyShuttle&gt;

...and our backing bean looks like this:

(BackingBean.java)
...
//
//  The list of selected items that should appear in
//  the shuttle component.
//
Gizmo [] itemList = null;

//
//  Returns the current selected objects.
//
Gizmo [] getSelectedShuttleItems()
{
}

//
//
//
...
public SelectItem[] getShuttleItems()
{
   SelectItem[] shuttleItems = new SelectItem[ 3 ];
   shuttleItems[ 0 ] = new SelectItem( 
}

If you bind the shuttle component to a variable in the
backing bean, that component's value will be an array
of objects.  For example, if getShuttleItems returns
an array of SelectItems, each 


Renzo,
It's possible to achieve all of the behavior that you
describe without resorting to JavaScript.
  </pre>
  <blockquote type="cite">
    <pre wrap="">In order to populate the list of selectable items
    </pre>
  </blockquote>
  <pre wrap=""><!---->from
  </pre>
  <blockquote type="cite">
    <pre wrap="">your backing bean, you can use:
    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
  <blockquote type="cite">
    <pre wrap="">&lt;f:selectItems value="#{backingBean.shuttleItems} /&gt;
    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
  <blockquote type="cite">
    <pre wrap="">The backingBean object should have a
    </pre>
  </blockquote>
  <pre wrap=""><!---->'getShuttleItems'
  </pre>
  <blockquote type="cite">
    <pre wrap="">accessor, which returns a: SelectItem[].  Each
    </pre>
  </blockquote>
  <pre wrap=""><!---->select
  </pre>
  <blockquote type="cite">
    <pre wrap="">item may be an object-label pair, so there's where
    </pre>
  </blockquote>
  <pre wrap=""><!---->you
  </pre>
  <blockquote type="cite">
    <pre wrap="">store your object reference.  For example:

(BackingBean.java)
...
//
//
//
Gizmo

...
public SelectItem[] getShuttleItems()
{
   SelectItem[] shuttleItems = new SelectItem[ 3 ];
   shuttleItems[ 0 ] = new SelectItem( 
}

If you bind the shuttle component to a variable in
    </pre>
  </blockquote>
  <pre wrap=""><!---->the
  </pre>
  <blockquote type="cite">
    <pre wrap="">backing bean, that component's value will be an
    </pre>
  </blockquote>
  <pre wrap=""><!---->array
  </pre>
  <blockquote type="cite">
    <pre wrap="">of objects.  For example, if getShuttleItems returns
an array of SelectItems, each 



    </pre>
    <blockquote type="cite">
      <pre wrap="">Hi, I'm about to use these components, and I'm a
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->bit
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">confused about 
their documentation.
Included demos provide list contents through
tr:selectItem children. At 
the same time, I noticed that contents can be
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->get/set
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">through the 
"value" attribute.
Can anybody enlight such usage ? Is there any
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->other
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">public demo/example 
around ?
I also noticed that provided documentation refers
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->to
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">the chance of using 
generic objects as list elements. This would be &gt;
      </pre>
    </blockquote>
    <pre wrap="">very
    </pre>
    <blockquote type="cite">
      <pre wrap="">useful to append 
further properties to list elements, to be managed
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->by
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">footer widgets 
using provided js hooks on current selection. But
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->the
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">overall subject is 
somewhat obscure.
Furthermore, I noticed that lists are always
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->provided
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">on the left 
container only, where used has to move elements
rightwards. But I think 
that common usage would start having some elements
already on the right 
list (update mode). Is there any way to achive
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->this
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">initial setup - or 
do I need to preprocess by means of js and a
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->hidden
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">"init" list?

Thanks -- Renzo
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
<a class="moz-txt-link-freetext" href="http://mail.yahoo.com">http://mail.yahoo.com</a>



  </pre>
</blockquote>
</body>
</html>

Mime
View raw message