Thanks Nick and for the observations I will take notice.

I am pioneering a gallery and could not find one anywhere surprisingly.

Thanks for your response... I tried that specifying parameters in the Home.html 
template like you posted. Are you saying I need additional getter/setter with 
@Persist for such attribute in Home.JAVA ? I would hate to think that... but 
will do what I need to do in order to get it to work.

Best regards
Ken in nashua

From: [EMAIL PROTECTED]
To: users@tapestry.apache.org
Subject: RE: parameter binding broken in T-4.1.* - PROPERTYSELECTION
Date: Wed, 10 Oct 2007 16:18:00 -0400








Folks,

I have attached all my modules to this Gallery Widget.

Can someone comment on a solution?

Here are the issues...
1. OGNL cannot do arithmetic on tableSize due to divide by ZERO. My blocker to 
prevent exception is check for null but thats not a solution.
2. Parameters are not updatable with PropertySelection across SUBMIT
3. Persist fails to work either
4. Also unable to get both renderBlocks to act on same instance...

tableSize refuses to act persistent. I select from the select and it keeps 
getting reset back on submit.

The docs need to be updated too.

Thanks

Best regards
Ken in nashua

From: [EMAIL PROTECTED]
To: users@tapestry.apache.org
Subject: RE: parameter binding broken in T-4.1.* - PROPERTYSELECTION
Date: Wed, 10 Oct 2007 15:25:04 -0400

If tableSize is != 0 (according to OGNL condition check) then how is OGNL 
letting it get in?

An exception has occurred.You may continue by restarting the session.
        [ +/- ] Exception:         Unable to parse OGNL expression '(index % 
tableSize) == 0': / by zero                                                     
   org.apache.tapestry.BindingException                                         
                           Unable to parse OGNL expression '(index % tableSize) 
== 0': / by zero                                                                
   binding:                        ExpressionBinding[Home/galleryWidget (index 
% tableSize) == 0]                                  location:                   
    classpath:/org/trails/demo/components/Gallery.html, line 32
27      <span jwcid='[EMAIL PROTECTED]'>28              <table width='100%'>29  
                <tr>30                          <span jwcid='[EMAIL PROTECTED]' 
source='ognl:collection' value='ognl:currentObject' index='ognl:index'>31       
                                <span jwcid='@If' condition='ognl:tableSize != 
0'>32                                            <span jwcid='@If' 
condition='ognl:(index % tableSize) == 0'>33                                    
              <span jwcid='@Insert' value='</tr><tr>' raw='true'/>34            
                              </span>35                                       
</span>36                                       <td>37                          
        <a jwcid='[EMAIL PROTECTED]' listener='listener:edit' 
parameters='ognl:currentObject'>                                                
  [ +/- ] Exception:         Unable to parse OGNL expression '(index % 
tableSize) == 0': / by zero

Best regards
Ken in nashua

From: [EMAIL PROTECTED]
To: users@tapestry.apache.org
Subject: RE: parameter binding broken in T-4.1.* - PROPERTYSELECTION
Date: Wed, 10 Oct 2007 15:15:20 -0400

An exception has occurred.You may continue by restarting the session.
        [ +/- ] Exception:Unable to update OGNL expression '<parsed OGNL 
expression>' [EMAIL PROTECTED]/galleryWidget] to 2: Binding with value 
1(ExpressionBinding[Home/galleryWidget 1]) may not be updated.                  
                org.apache.tapestry.BindingException
                                                                        
Unableto update OGNL expression '<parsed OGNL expression>' [EMAIL 
PROTECTED]/galleryWidget] to 2: Binding with value 
1(ExpressionBinding[Home/galleryWidget 1]) may not be updated.
                                                                        binding:
                        ExpressionBinding[Home/galleryWidget tableSize]
                                        location:
                        classpath:/org/trails/demo/components/Gallery.jwc, line 
9, column 46
4
                                                 
allow-informal-parameters='yes'>
5
        <parameter name='autoPagingContent'/>
6
        <parameter name='collectionContent'/>
7

8
        <component id='tableSizeSelect' type='PropertySelection'>
9
                <binding name='value' value='tableSize'/>
10
                <binding name='model' value='tableSizeModel'/>
11
        </component>
12

13
        <component id='pagingSpanSelect' type='PropertySelection'>
14
                <binding name='value' value='pagingSpan'/>

                                    
                        [ +/- ] Exception:Unable to update OGNL expression 
'<parsed OGNL expression>' [EMAIL PROTECTED]/galleryWidget] to 2: Binding with 
value 1(ExpressionBinding[Home/galleryWidget 1]) may not be updated.            
                      org.apache.hivemind.ApplicationRuntimeException
                                                                        
Unableto update OGNL expression '<parsed OGNL expression>' [EMAIL 
PROTECTED]/galleryWidget] to 2: Binding with value 
1(ExpressionBinding[Home/galleryWidget 1]) may not be updated.
                                                                        
component:
                        [EMAIL PROTECTED]/galleryWidget]
                                        location:
                        [EMAIL PROTECTED](cache=true, 
defaultValue=1,required=false, name=, aliases=) of public abstract 
java.lang.Stringorg.trails.demo.components.Gallery.getTableSize()
                                    
                        [ +/- ] Exception:         Binding with value 1 
(ExpressionBinding[Home/galleryWidget 1]) may not be updated.                   
                                org.apache.tapestry.BindingException            
                                                        Binding with value 1 
(ExpressionBinding[Home/galleryWidget 1]) may not be updated.                   
                                                   binding:                     
   ExpressionBinding[Home/galleryWidget 1]                                 
location:                       [EMAIL PROTECTED](cache=true, 
defaultValue=1,required=false, name=, aliases=) of public abstract 
java.lang.Stringorg.trails.demo.components.Gallery.getTableSize()               
                                                       Stack Trace:             
                                                                                
                               
org.apache.tapestry.binding.AbstractBinding.createReadOnlyBindingException(AbstractBinding.java:115)
                                    
org.apache.tapestry.binding.ExpressionBinding.setObject(ExpressionBinding.java:196)
                                     $Gallery_17.setTableSize($Gallery_17.java) 
                                     
$ASTProperty_1158b56b4e5.set($ASTProperty_1158b56b4e5.java)                     
                
org.apache.tapestry.services.impl.ExpressionEvaluatorImpl.write(ExpressionEvaluatorImpl.java:175)
                                       
$ExpressionEvaluator_1158b56b497.write($ExpressionEvaluator_1158b56b497.java)   
                                
org.apache.tapestry.binding.ExpressionBinding.setObject(ExpressionBinding.java:223)
                                     
$PropertySelection_18.setValue($PropertySelection_18.java)                      
                
org.apache.tapestry.form.PropertySelection.rewindFormComponent(PropertySelection.java:95)
                                       
org.apache.tapestry.form.AbstractFormComponent.renderComponent(AbstractFormComponent.java:90)
                                   
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:725)        
                                
org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:179)
                                        
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:539)    
                                
org.apache.tapestry.components.Block.renderForComponent(Block.java:65)          
                        
org.apache.tapestry.components.RenderBlock.renderComponent(RenderBlock.java:65)

Best regards
Ken in nashua

From: [EMAIL PROTECTED]
To: users@tapestry.apache.org
Subject: RE: parameter binding broken in T-4.1.* - PROPERTYSELECTION
Date: Wed, 10 Oct 2007 15:10:00 -0400

An exception has occurred.You may continue by restarting the session.
        [ +/- ] Exception:         Unable to parse OGNL expression '(index % 
tableSize) == 0': / by zero                                                     
   org.apache.tapestry.BindingException
                                                                        Unable 
to parse OGNL expression '(index % tableSize) == 0': / by zero
                                                                        binding:
                        ExpressionBinding[Home/galleryWidget (index % 
tableSize) == 0]
                                        location:
                        classpath:/org/trails/demo/components/Gallery.html, 
line 32
27
        <span jwcid='[EMAIL PROTECTED]'>
28
                <table width='100%'>
29
                        <tr>
30
                                <span jwcid='[EMAIL PROTECTED]' 
source='ognl:collection' value='ognl:currentObject' index='ognl:index'>
31
                                        <span jwcid='@If' 
condition='ognl:tableSize != 0'>
32
                                                <span jwcid='@If' 
condition='ognl:(index % tableSize) == 0'>
33
                                                        <span jwcid='@Insert' 
value='</tr><tr>' raw='true'/>
34
                                                </span>
35
                                        </span>
36
                                        <td>
37
                                        <a jwcid='[EMAIL PROTECTED]' 
listener='listener:edit' parameters='ognl:currentObject'>

                                    
                        [ +/- ] Exception:         Unable to parse OGNL 
expression '(index % tableSize) == 0': / by zero                                
                        org.apache.hivemind.ApplicationRuntimeException
                                                                        Unable 
to parse OGNL expression '(index % tableSize) == 0': / by zero
                                                                    
                        [ +/- ] Exception:         / by zero                    
                                java.lang.ArithmeticException                   
                                                / by zero                       
                                                                                
Stack Trace:                                                                    
                                                        
ognl.OgnlOps.remainder(OgnlOps.java:932)                                        
ognl.ASTRemainder.getValueBody(ASTRemainder.java:51)                            
        ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:202)               
                        ognl.SimpleNode.getValue(SimpleNode.java:246)           
                        ognl.ASTEq.getValueBody(ASTEq.java:50)                  
                ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:202)       
                                ognl.SimpleNode.getValue(SimpleNode.java:246)   
                                ognl.Ognl.getValue(Ognl.java:494)               
                        ognl.Ognl.getValue(Ognl.java:458)                       
                
org.apache.tapestry.services.impl.HiveMindExpressionCompiler.compileExpression(HiveMindExpressionCompiler.java:153)
                                     
ognl.OgnlRuntime.compileExpression(OgnlRuntime.java:523)                        
                ognl.Ognl.compileExpression(Ognl.java:141)                      
                
org.apache.tapestry.services.impl.ExpressionCacheImpl.parse(ExpressionCacheImpl.java:152)
                                       
org.apache.tapestry.services.impl.ExpressionCacheImpl.getCompiledExpression(ExpressionCacheImpl.java:115)
                                       
$ExpressionCache_1158b51ac28.getCompiledExpression($ExpressionCache_1158b51ac28.java)

Best regards
Ken in nashua

From: [EMAIL PROTECTED]
To: users@tapestry.apache.org
Subject: RE: parameter binding broken in T-4.1.* - PROPERTYSELECTION
Date: Wed, 10 Oct 2007 14:43:49 -0400

I tried...

    @Override
    protected void prepareForRender(IRequestCycle cycle)
    {
        super.prepareForRender(cycle);

        setCollection(loadCollection(getCollectionType()));

        if (getTableSize() == null)
            setTableSize(tableSizeOptions[0]);
        if (getPagingSpan() == null)
            setPagingSpan(pagingSpanOptions[0]);

    }

BUT I am unable to initialize the persistent property due to this exception...

An exception has occurred.You may continue by restarting the session.
        [ +/- ] Exception:Error: Change to persistent property tableSize of 
Home/galleryWidgethas been ignored. Persistent properties may only be changed 
prior tothe rendering of the response page.

Now arithmetic on this property is impossible in the template and there is no 
way for me to even set the parameter/property up at all.

Is there a way out of this?

Best regards
Ken in nashua

From: [EMAIL PROTECTED]
To: users@tapestry.apache.org
Subject: RE: parameter binding broken in T-4.1.* - PROPERTYSELECTION
Date: Wed, 10 Oct 2007 14:32:08 -0400

 I decided to model T-4 examples and it still produces exception

    private static final String[] tableSizeOptions = new String[] { '1', '2', 
'3', '4', '5', '10', '25', '50', '100',
            '500', '1000', '2500', '5000', '10000', '25000', '50000' };

    private static final String[] pagingSpanOptions = new String[] { '5', '10', 
'15', '20', '25' };

    public IPropertySelectionModel getTableSizeModel()
    {
        if (tableSizeModel == null)
            tableSizeModel = new StringPropertySelectionModel(tableSizeOptions);

        return tableSizeModel;
    }

    public IPropertySelectionModel getPagingSpanModel()
    {
        if (pagingSpanModel == null)
            pagingSpanModel = new 
StringPropertySelectionModel(pagingSpanOptions);

        return pagingSpanModel;
    }

    <component id='tableSizeSelect' type='PropertySelection'>
          <binding name='value' value='tableSize'/>
          <binding name='model' value='tableSizeModel'/>
    </component>

    <component id='pagingSpanSelect' type='PropertySelection'>
          <binding name='value' value='pagingSpan'/>
          <binding name='model' value='pagingSpanModel'/>
    </component>

    @Persist
    public abstract String getTableSize();

    @Persist
    public abstract String getPagingSpan();


<select jwcid='tableSizeSelect' onchange='tapestry.form.refresh(this.form)'/>

<select jwcid='pagingSpanSelect' onchange='tapestry.form.refresh(this.form)'/>

I cannot do arithmetic on this property due to divide by zero.

So how do you set the DEFAULT VALUE of a property ? I see no support for doing 
this.

I cannot use parameters because it states the parameter cannot be updated.

Please advise... thank You


An exception has occurred.You may continue by restarting the session.
        [ +/- ] Exception:         Unable to parse OGNL expression '(index % 
tableSize) == 0': / by zero                                                     
   org.apache.tapestry.BindingException
                                                                        Unable 
to parse OGNL expression '(index % tableSize) == 0': / by zero
                                                                        binding:
                        ExpressionBinding[Home/galleryWidget (index % 
tableSize) == 0]
                                        location:
                        classpath:/org/trails/demo/components/Gallery.html, 
line 31
26

27
        <span jwcid='[EMAIL PROTECTED]'>
28
                <table width='100%'>
29
                        <tr>
30
                                <span jwcid='[EMAIL PROTECTED]' 
source='ognl:collection' value='ognl:currentObject' index='ognl:index'>
31
                                        <span jwcid='@If' 
condition='ognl:(index % tableSize) == 0'>
32
                                                <span jwcid='@Insert' 
value='</tr><tr>' raw='true'/>
33
                                        </span>
34
                                        <td>
35
                                        <a jwcid='[EMAIL PROTECTED]' 
listener='listener:edit' parameters='ognl:currentObject'>
36
                                                <img jwcid='@Image'

                                    
                        [ +/- ] Exception:         Unable to parse OGNL 
expression '(index % tableSize) == 0': / by zero

Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power. Play Now!
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power. Play Now!
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power. Play Now!
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today!
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power. Play Now!
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today!

_________________________________________________________________
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

Reply via email to