How to write screens?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to write screens?

Roberto Cosenza-5
Hi.
Please help me out to get started. I'm having hard times to find stuff  
in the documentation

I'm building a new application. I correctly mapped the "ViewItem"  
screen. Once I go on the ViewItem url I want to

1) Take the "artnr" request parameter
2) Execute the service "findItem" with the "artnr" as argument
3) Show a form filled with the data of the found item

I run 1 and 2 in the "actions" section of the "ViewItem" screen. I can  
see that "item" is now put into the context.
Then I include the following form:

<form name="ViewItem" type="single"
                title="Item information"
                header-row-style="header-row" default-table-style="basic-table">
                <field  name="artnr">
                        <display-entity entity-name="Item" />
                </field>
                <field  name="text">
                        <display-entity entity-name="Item" />
                </field>
</form>

Which causes an exception "Passed primary key is not a valid primary  
key: [GenericEntity:Item][text,(java.lang.String)])" as display-entity  
tries to load an other instance of Item.
Ok, then maybe I should use

<field  name="artnr"><display/></field>
<field  name="text"><display/></field>

but this does not show any value for "text", altough it is not null,

neither does

<field name="Artnr"><display description="${item.artnr}"/></field>

work since item is of type generic value (?).
Could you please tell me if i'm using the wrong approach??
/Roberto



Reply | Threaded
Open this post in threaded view
|

Re: How to write screens?

BJ Freeman
look in
/framework/examples
also you can search through the /applications
in the widgets folder to see how different screens are done
you should also look through /framework/widgets/dtd for the xml that
define what can be put in a widget.
it helps if you have a xml editor that can read the dtd when
constructing widgets


Roberto Cosenza sent the following on 3/31/2008 5:57 AM:

> Hi.
> Please help me out to get started. I'm having hard times to find stuff
> in the documentation
>
> I'm building a new application. I correctly mapped the "ViewItem"
> screen. Once I go on the ViewItem url I want to
>
> 1) Take the "artnr" request parameter
> 2) Execute the service "findItem" with the "artnr" as argument
> 3) Show a form filled with the data of the found item
>
> I run 1 and 2 in the "actions" section of the "ViewItem" screen. I can
> see that "item" is now put into the context.
> Then I include the following form:
>
> <form name="ViewItem" type="single"
>         title="Item information"
>         header-row-style="header-row" default-table-style="basic-table">
>         <field  name="artnr">
>             <display-entity entity-name="Item" />
>         </field>
>         <field  name="text">
>             <display-entity entity-name="Item" />
>         </field>
> </form>
>
> Which causes an exception "Passed primary key is not a valid primary
> key: [GenericEntity:Item][text,(java.lang.String)])" as display-entity
> tries to load an other instance of Item.
> Ok, then maybe I should use
>
> <field  name="artnr"><display/></field>
> <field  name="text"><display/></field>
>
> but this does not show any value for "text", altough it is not null,
>
> neither does
>
> <field name="Artnr"><display description="${item.artnr}"/></field>
>
> work since item is of type generic value (?).
> Could you please tell me if i'm using the wrong approach??
> /Roberto
>
>
>
>
>
>