You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Kamal Bhatt <kb...@tt.com.au> on 2006/03/02 07:52:34 UTC

Trouble with repeater

Hi
I am trying to make a search screen.

The idea is that the user can search based on two database fields or 
simply search all. I thought I would use cforms to do this. The fields 
to search by would be a union and when the user submits it will pass the 
data along to an xsp and xslt (via the sitemap). However, there are a 
number of problems with this, the first being I cannot even get the 
template to work. I get null pointer exceptions. The problem seems to be 
when I show the form.

Here is my definition:

<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition" 
xmlns:i18n="http://apache.org/cocoon/i18n/2.1" id="promotion_select">
    <fd:widgets>
   
    <fd:field id="filter" required="false" nullable="false">
        <fd:label>Filter</fd:label>
        <fd:datatype base="string"/>
        <fd:selection-list>
            <fd:item value="None"/>
        <fd:item value="Id"/>
        <fd:item value="Title"/>
        </fd:selection-list>   
    </fd:field>

       <fd:union id="data" case="filter">
        <fd:widgets>
            <fd:field id="None" state="output">
          <fd:initial-value>Hello</fd:initial-value>
          <fd:datatype base="string"/>
        </fd:field>
   
        <fd:field id="Id">
          <fd:datatype base="integer"/>
        </fd:field>
       
        <fd:field id="Title">
           <fd:datatype base="string"/>
            </fd:field>        
         </fd:widgets>   
    </fd:union>   

    <!-- ACTIONS -->

    <!-- Submit -->   
    <fd:submit id="submit" command="submit">
      <fd:label>Show</fd:label>
    </fd:submit>
    </fd:widgets>
</fd:form>

Here is my template:

<div id="body">

    <jx:import xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
           
uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml"/>
    <ft:form-template
      xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
      xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
      xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
      method="POST"
      action="#{$continuation/id}.continue?lenya.usecase=promotion"
      id="promotionSelect" name="promotionSelect">
          <ft:continuation-id/>
    <ft:widget id="filter"><fi:styling list-type="dropdown" 
submit-on-change="true"/></ft:widget>

    <ft:union id="data">
      <ft:case id="None">
        <ft:widget id="None"/>
      </ft:case> 

      <ft:case id="Id">
        <ft:widget id="Id"/>
      </ft:case> 

      <ft:case id="Title">
        <ft:widget id="Title"/>
      </ft:case>
    </ft:union>  

    <ft:widget id="submit"><fi:styling type="link"/></ft:widget>
    </ft:form-template>
</div>

Here is my javascript:

function select_promotion()
{
    var form = new Form("cforms/promotion_select.xml");
    form.showForm("call-promotion-select.jx");
    return;
}

I want the fields and the data (generated by an XSLT) to be shown on the 
same screen. I was wondering if it were possible to call the template 
again after we call the xsp/xslt so we can see the fields again. I don't 
know if this will work and the more I think about the more unlikely it 
looks. Is there a nice way of doing this without bindings to the database?

Thanks.

-- 
Kamal Bhatt



--
Disclaimer: This email is confidential and may contain privileged information for the sole use of the person or business to which it is addressed. If you are not the intended recipient, please notify the sender by return e-mail or phone as you must not view, disseminate, distribute or copy this email without our consent. We do not accept any liability in connection with any computer virus, data corruption, incompleteness, or unauthorised amendment of this email. It is the sole responsibility of the receiver to scan for viruses before opening.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Trouble with union

Posted by Simone Gianni <s....@thebug.it>.
Hi Kamal,
could you please send us the exception stacktrace? NPE can be virtually 
anything :)

Simone

Kamal Bhatt wrote:

>
> Long day, I meant union
>
> -- 
> Disclaimer: This email is confidential and may contain privileged 
> information for the sole use of the person or business to which it is 
> addressed. If you are not the intended recipient, please notify the 
> sender by return e-mail or phone as you must not view, disseminate, 
> distribute or copy this email without our consent. We do not accept 
> any liability in connection with any computer virus, data corruption, 
> incompleteness, or unauthorised amendment of this email. It is the 
> sole responsibility of the receiver to scan for viruses before opening.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
-- 
Simone Gianni

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Trouble with union

Posted by Kamal Bhatt <kb...@tt.com.au>.
Long day, I meant union

--
Disclaimer: This email is confidential and may contain privileged information for the sole use of the person or business to which it is addressed. If you are not the intended recipient, please notify the sender by return e-mail or phone as you must not view, disseminate, distribute or copy this email without our consent. We do not accept any liability in connection with any computer virus, data corruption, incompleteness, or unauthorised amendment of this email. It is the sole responsibility of the receiver to scan for viruses before opening.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org