You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jason Andrews (JIRA)" <ta...@jakarta.apache.org> on 2006/06/01 09:02:29 UTC

[jira] Created: (TAPESTRY-973) Having two @Select components on a page causes the selections to play up

Having two @Select components on a page causes the selections to play up
------------------------------------------------------------------------

         Key: TAPESTRY-973
         URL: http://issues.apache.org/jira/browse/TAPESTRY-973
     Project: Tapestry
        Type: Bug

  Components: Framework  
    Versions: 4.0.1    
 Environment: Mac OS X / Eclipse 3.2 RC6 (3.1 / 3.2 RC4) / Jetty / Tapestry 4.0.1
    Reporter: Jason Andrews
    Priority: Minor


Having two @Select components on a page causes the selections to screw up - appears related to rewind not fully executing, or skipping.

TAPESTRY-437 is closed, but I think this is a different issue, as it relates to the selections.

I have two lists, a list of available options, and a list of selected options.
in between, I have two arrow buttons (@ImageSubmit), one pointing left, the other pointing right - i.e. add/remove

Initially, I had this in a custom component called @ListBox, but I removed that layer to simplify things and the end result is identical.
Here it is, without the extra layer - i.e. just Tapestry Components

          <TR><TD>
          <select jwcid="LeftSelect@Select" multiple="ognl:true" disabled="ognl:!editMode" id="literal:leftList">
		<span jwcid="LeftFor@For" source="ognl:leftEntries" value="ognl:objectIterator" index="ognl:leftObjectIndex">
			<option jwcid="@Option" selected="ognl:leftObjectSelected" label="ognl:objectIteratorLabel"/>
		</span>
	</select>
         </TD>
         <TD>
         <SPAN jwcid="@ImageSubmit" listener="listener:clickMoveRight" image="asset:moveRightImage" />
         <BR><BR>
         <SPAN jwcid="@ImageSubmit" listener="listener:clickMoveLeft" image="asset:moveLeftImage" />
         </TD>
         <TD>
         <select jwcid="RightList@Select" multiple="ognl:true" disabled="ognl:!editMode" id="literal:rightList">
		<span jwcid="RightFor@For" source="ognl:rightEntries" value="ognl:objectIterator" index="ognl:rightObjectIndex">
			<option jwcid="@Option" selected="ognl:rightObjectSelected" label="ognl:objectIteratorLabel"/>
		</span>
	</select>
         </TD></TR>

Rendering is fine - the lists appear with the correct entries. 

@Option selected="lefttObjectSelected"
@Option selected="rightObjectSelected"

These call a fairly simple method(s), which works every time for LeftList, but only every second time for RightList. For reference, here it is:

         	/** Selected objects from the right list */
	@Persist
	public abstract List<Object> getRightSelections();
	public abstract void setRightSelections(List<Object> selections);

	public boolean getRightObjectSelected() {
		return getRightSelections().contains(getObjectIterator());
	}
	
	public void setRightObjectSelected(boolean isSelected) {
		if(isSelected) {
			if(!getRightSelections().contains(getObjectIterator()))
				getRightSelections().add(getObjectIterator());
		}
		else {
			getRightSelections().remove(getObjectIterator());
		}
	}

Now the first time I click the moveLeft button - the selections are empty.
The second time I click it - the selections hold the values as selected from the first button press - i.e. if I change the selections - that won't get picked up until the next button press.

If it were the same for both, I would assume this was my fault, but as it only happens with the second list - I assume this is a bug.
Oh - and I changed the order of the lists for interest, and once I got my head around which button to click for which action - I can confirm it is only a problem for the second listbox.

So it appears that this is a problem with the rewind action not processing something correctly - as I am currently evaluating Tapestry as a replacement framework I don't have time to try and fix this myself.

I also find some of the PageLoader functionality a little strange, but I may raise that separately.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Resolved: (TAPESTRY-973) Having two @Select components on a page causes the selections to play up

Posted by "Andreas Andreou (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-973?page=all ]

Andreas Andreou resolved TAPESTRY-973.
--------------------------------------

    Fix Version/s: unspecified
       Resolution: Invalid

So, that's the way reqind works - bind to the action parameter...

> Having two @Select components on a page causes the selections to play up
> ------------------------------------------------------------------------
>
>                 Key: TAPESTRY-973
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-973
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.0.1
>         Environment: Mac OS X / Eclipse 3.2 RC6 (3.1 / 3.2 RC4) / Jetty / Tapestry 4.0.1
>            Reporter: Jason Andrews
>            Priority: Minor
>             Fix For: unspecified
>
>
> Having two @Select components on a page causes the selections to screw up - appears related to rewind not fully executing, or skipping.
> TAPESTRY-437 is closed, but I think this is a different issue, as it relates to the selections.
> I have two lists, a list of available options, and a list of selected options.
> in between, I have two arrow buttons (@ImageSubmit), one pointing left, the other pointing right - i.e. add/remove
> Initially, I had this in a custom component called @ListBox, but I removed that layer to simplify things and the end result is identical.
> Here it is, without the extra layer - i.e. just Tapestry Components
>           <TR><TD>
>           <select jwcid="LeftSelect@Select" multiple="ognl:true" disabled="ognl:!editMode" id="literal:leftList">
> 		<span jwcid="LeftFor@For" source="ognl:leftEntries" value="ognl:objectIterator" index="ognl:leftObjectIndex">
> 			<option jwcid="@Option" selected="ognl:leftObjectSelected" label="ognl:objectIteratorLabel"/>
> 		</span>
> 	</select>
>          </TD>
>          <TD>
>          <SPAN jwcid="@ImageSubmit" listener="listener:clickMoveRight" image="asset:moveRightImage" />
>          <BR><BR>
>          <SPAN jwcid="@ImageSubmit" listener="listener:clickMoveLeft" image="asset:moveLeftImage" />
>          </TD>
>          <TD>
>          <select jwcid="RightList@Select" multiple="ognl:true" disabled="ognl:!editMode" id="literal:rightList">
> 		<span jwcid="RightFor@For" source="ognl:rightEntries" value="ognl:objectIterator" index="ognl:rightObjectIndex">
> 			<option jwcid="@Option" selected="ognl:rightObjectSelected" label="ognl:objectIteratorLabel"/>
> 		</span>
> 	</select>
>          </TD></TR>
> Rendering is fine - the lists appear with the correct entries. 
> @Option selected="lefttObjectSelected"
> @Option selected="rightObjectSelected"
> These call a fairly simple method(s), which works every time for LeftList, but only every second time for RightList. For reference, here it is:
>          	/** Selected objects from the right list */
> 	@Persist
> 	public abstract List<Object> getRightSelections();
> 	public abstract void setRightSelections(List<Object> selections);
> 	public boolean getRightObjectSelected() {
> 		return getRightSelections().contains(getObjectIterator());
> 	}
> 	
> 	public void setRightObjectSelected(boolean isSelected) {
> 		if(isSelected) {
> 			if(!getRightSelections().contains(getObjectIterator()))
> 				getRightSelections().add(getObjectIterator());
> 		}
> 		else {
> 			getRightSelections().remove(getObjectIterator());
> 		}
> 	}
> Now the first time I click the moveLeft button - the selections are empty.
> The second time I click it - the selections hold the values as selected from the first button press - i.e. if I change the selections - that won't get picked up until the next button press.
> If it were the same for both, I would assume this was my fault, but as it only happens with the second list - I assume this is a bug.
> Oh - and I changed the order of the lists for interest, and once I got my head around which button to click for which action - I can confirm it is only a problem for the second listbox.
> So it appears that this is a problem with the rewind action not processing something correctly - as I am currently evaluating Tapestry as a replacement framework I don't have time to try and fix this myself.
> I also find some of the PageLoader functionality a little strange, but I may raise that separately.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-973) Having two @Select components on a page causes the selections to play up

Posted by "Andreas Andreou (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-973?page=comments#action_12427730 ] 
            
Andreas Andreou commented on TAPESTRY-973:
------------------------------------------

Well, here's what happens on rewind...
- First @Select is rendered, getLeftSelections is filled in correctly
- First @ImageSubmit renders, it wasn't clicked, nothing happens
- Second @ImageSubmit renders, it was clicked AND its listener
parameter was specified, so clickMoveLeft() is called. HOWEVER,
getRightSelections haven't had a change to load their values 'cause
the second @Select hasn't yet rendered.

So, you can:
- use action instead of listener in your @ImageSubmit. This delays the
call to clickMoveLeft() until all components enclosed by the Form have 
had a chance to update their properties - see
http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/ImageSubmit.html

- check out contrib:Palette, it might better suit your needs - see
http://tapestry.apache.org/tapestry4/tapestry-contrib/ComponentReference/Palette.html



> Having two @Select components on a page causes the selections to play up
> ------------------------------------------------------------------------
>
>                 Key: TAPESTRY-973
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-973
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.0.1
>         Environment: Mac OS X / Eclipse 3.2 RC6 (3.1 / 3.2 RC4) / Jetty / Tapestry 4.0.1
>            Reporter: Jason Andrews
>            Priority: Minor
>
> Having two @Select components on a page causes the selections to screw up - appears related to rewind not fully executing, or skipping.
> TAPESTRY-437 is closed, but I think this is a different issue, as it relates to the selections.
> I have two lists, a list of available options, and a list of selected options.
> in between, I have two arrow buttons (@ImageSubmit), one pointing left, the other pointing right - i.e. add/remove
> Initially, I had this in a custom component called @ListBox, but I removed that layer to simplify things and the end result is identical.
> Here it is, without the extra layer - i.e. just Tapestry Components
>           <TR><TD>
>           <select jwcid="LeftSelect@Select" multiple="ognl:true" disabled="ognl:!editMode" id="literal:leftList">
> 		<span jwcid="LeftFor@For" source="ognl:leftEntries" value="ognl:objectIterator" index="ognl:leftObjectIndex">
> 			<option jwcid="@Option" selected="ognl:leftObjectSelected" label="ognl:objectIteratorLabel"/>
> 		</span>
> 	</select>
>          </TD>
>          <TD>
>          <SPAN jwcid="@ImageSubmit" listener="listener:clickMoveRight" image="asset:moveRightImage" />
>          <BR><BR>
>          <SPAN jwcid="@ImageSubmit" listener="listener:clickMoveLeft" image="asset:moveLeftImage" />
>          </TD>
>          <TD>
>          <select jwcid="RightList@Select" multiple="ognl:true" disabled="ognl:!editMode" id="literal:rightList">
> 		<span jwcid="RightFor@For" source="ognl:rightEntries" value="ognl:objectIterator" index="ognl:rightObjectIndex">
> 			<option jwcid="@Option" selected="ognl:rightObjectSelected" label="ognl:objectIteratorLabel"/>
> 		</span>
> 	</select>
>          </TD></TR>
> Rendering is fine - the lists appear with the correct entries. 
> @Option selected="lefttObjectSelected"
> @Option selected="rightObjectSelected"
> These call a fairly simple method(s), which works every time for LeftList, but only every second time for RightList. For reference, here it is:
>          	/** Selected objects from the right list */
> 	@Persist
> 	public abstract List<Object> getRightSelections();
> 	public abstract void setRightSelections(List<Object> selections);
> 	public boolean getRightObjectSelected() {
> 		return getRightSelections().contains(getObjectIterator());
> 	}
> 	
> 	public void setRightObjectSelected(boolean isSelected) {
> 		if(isSelected) {
> 			if(!getRightSelections().contains(getObjectIterator()))
> 				getRightSelections().add(getObjectIterator());
> 		}
> 		else {
> 			getRightSelections().remove(getObjectIterator());
> 		}
> 	}
> Now the first time I click the moveLeft button - the selections are empty.
> The second time I click it - the selections hold the values as selected from the first button press - i.e. if I change the selections - that won't get picked up until the next button press.
> If it were the same for both, I would assume this was my fault, but as it only happens with the second list - I assume this is a bug.
> Oh - and I changed the order of the lists for interest, and once I got my head around which button to click for which action - I can confirm it is only a problem for the second listbox.
> So it appears that this is a problem with the rewind action not processing something correctly - as I am currently evaluating Tapestry as a replacement framework I don't have time to try and fix this myself.
> I also find some of the PageLoader functionality a little strange, but I may raise that separately.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org