Thanks Dan, not so obvious!

The reason for my hidden everywhere is to turn an object into a string in
terms of display, but keep it as an object, which then relates to a
separate table, which users can add records/objects to.

There is a ticket ISIS-1180
<https://issues.apache.org/jira/browse/ISIS-1180> that relates to this,
reading it now its not that clear my meaning, but (maybe to make it even
less clear) I had the idea of 'property view models'. These could be
assigned to a property via another naming convention, maybe facadeXxx()?

e.g.

public ObjectThatOnlyHasAName getNameObject(){
return this.o;
}

public void setNameObject(ObjectThatOnlyHasAName o){
this.o = o;
}

public String facadeNameObject(
return this.o.getName();
)

another example could be to represent a String property as a hyperlink.

public String getMyUrlString()

public void setMyUrlString(String url)

public URL facadeMyUrlString()

Steve

<https://issues.apache.org/jira/browse/ISIS-1180>

On Thu, Aug 25, 2016 at 5:52 PM, Dan Haywood <[email protected]>
wrote:

> Hi Steve,
>
> The issue is that the arrivingTransportType property below is marked as
> being hidden="EVERYWHERE".
>
> How this works internally is that the <action>s at the top of a fieldset
> end up being associated with the first <property> in that fieldset; in
> other words its as if there was an @MemberOrder(named=... ) annotation on
> the action.  It also adds a facet equivalent to @ActionLayout(position):
>
>
>     @MemberOrder(named="arrivingTransportType")
>     @Action()
>     @ActionLayout(position = ActionLayout.Position.PANEL)
>     public Attend changeTransportTypes( ... )
>
>
> Because the arrivingTransportTypes is hidden, this ends up hiding the
> action.
>
>
> The solution in your case would be to reorder the properties:
>
>
>                             <ns2:fieldSet name="Transport" id="transport">
>                                 <ns2:action id="changeTransportTypes">
>                                 <ns2:property
> id="arrivingTransportTypeName"
>                                     hidden="ALL_TABLES">
>                                     <ns2:named>Arriving</ns2:named>
>                                 </ns2:property>
>                                 <ns2:property
> id="departingTransportTypeName"
>                                     hidden="ALL_TABLES">
>                                     <ns2:named>Departing</ns2:named>
>                                 </ns2:property>
>                                 <ns2:property id="arrivingTransportType"
> hidden="EVERYWHERE" />
>                                 <ns2:property id="departingTransportType"
> hidden="EVERYWHERE" />
>                             </ns2:fieldSet>
>
>
>
> Hope that helps,
> Dan
>
>
>
> On 25 August 2016 at 06:47, Stephen Cameron <[email protected]>
> wrote:
>
> > Hi,
> >
> > I have a problem with an xml layout, there is an action that I cannot get
> > to appear in the panel of a fieldset. Its probably something that I have
> > done, but I cannot see what after a lot of searching. Hopefully someone
> > else's eyes may be better.
> >
> > The relevant section is as follows:
> >
> >                         <col span="6">
> >                             <ns2:fieldSet name="Attended" id="attend">
> >                                 <ns2:action id="wasAttended" />
> >                                 <ns2:action id="wasNotAttended" />
> >                                 <ns2:property id="wasAttended" />
> >                             </ns2:fieldSet>
> >                             <ns2:fieldSet name="Times" id="times">
> >                                 <ns2:action id="updateDatesAndTimes" />
> >                                 <ns2:property id="startDateTime" />
> >                                 <ns2:property id="endDateTime" />
> >                                 <ns2:property id="attendanceInterval" />
> >                             </ns2:fieldSet>
> >                             <ns2:fieldSet name="Transport"
> id="transport">
> >                                 <!-- ns2:action id="changeTransportTypes"
> > /-->
> >                                 <ns2:property id="arrivingTransportType"
> > hidden="EVERYWHERE" />
> >                                 <ns2:property id="departingTransportType"
> > hidden="EVERYWHERE" />
> >                                 <ns2:property
> > id="arrivingTransportTypeName"
> >                                     hidden="ALL_TABLES">
> >                                     <ns2:named>Arriving</ns2:named>
> >                                 </ns2:property>
> >                                 <ns2:property
> > id="departingTransportTypeName"
> >                                     hidden="ALL_TABLES">
> >                                     <ns2:named>Departing</ns2:named>
> >                                 </ns2:property>
> >                             </ns2:fieldSet>
> >                         </col>
> >
> > The commented out action is the problematic one, when not commented out
> it
> > just fails to appear, when commented out I do see the action button at
> the
> > top row (due to the unreferencedActions attribute).
> >
> > If I download and check the normalised layout file I see the following in
> > the top row, which proves I've got the action @id correct.
> >
> > <bs3:row>
> > <bs3:col unreferencedActions="true" span="12">
> > <cpt:domainObject/>
> > <cpt:action id="changeTransportTypes"/>
> > </bs3:col>
> > </bs3:row>
> >
> > In contrast the 'updateDatesAndTimes' action in the previous fieldset
> does
> > appear.
> >
> > The actual method in the class is as follows.
> >
> >     @Action()
> >     public Attend changeTransportTypes(
> >             @Parameter(optionality = Optionality.MANDATORY)
> > @ParameterLayout(named = "Arriving Transport Type") String arriving,
> >             @Parameter(optionality = Optionality.MANDATORY)
> > @ParameterLayout(named = "Departing Transport Type") String departing) {
> >         setArrivingTransportTypeName(arriving);
> >         setDepartingTransportTypeName(departing);
> >         return this;
> >     }
> >
> > Thanks
> >
>

Reply via email to