As to your question if you prevent something being contributed on only one
of the parameter classes: In the metamodel there's no way to specify that
but you could try to hide the contribution in the layout.json file.
something like
"actions":{
"yourAction": {
"hidden":{}
}
}
or
"actions":{
"yourAction": {
"hidden":{"where":"ALWAYS" }
}
}
Can you check if this works?
On Wed, Nov 19, 2014 at 4:15 PM, Jeroen van der Wal <[email protected]>
wrote:
> Hi Erik,
>
> You have to repeat the same parameters on the hideXxx method as the method
> that you're trying to hide.
>
> HTH
>
> On Wed, Nov 19, 2014 at 4:09 PM, Erik de Hair <[email protected]> wrote:
>
>> Hi,
>>
>> The method in my entity class is as follows:
>>
>> public boolean hideAddPhoneNumbers(PortalCompany owningCompany,
>> AbstractArticle phoneNumberArticle,
>> PhoneNumberGrid gridNumber, AbstractSelectableNumberElement
>> numberElement)
>> {
>> return true;
>> }
>>
>> I also tried
>>
>> public boolean hideAddPhoneNumbers()
>> {
>> return true;
>> }
>>
>> The signature of the method in the service is
>>
>> public FixedPhoneNumberSubscription addPhoneNumbers(PortalCompany
>> owningCompany,
>> AbstractArticle phoneNumberArticle,
>> PhoneNumberGrid gridNumber,
>> AbstractSelectableNumberElement numberElement)
>>
>>
>> Erik
>>
>> <mailto:[email protected]>
>>
>> On 11/19/2014 03:37 PM, Martin Grigorov wrote:
>>
>>> Hi,
>>>
>>> On Wed, Nov 19, 2014 at 4:20 PM, Erik de Hair <[email protected]> wrote:
>>>
>>> Hi Martin,
>>>>
>>>> I think you need to add method hideXyz() as explained at
>>>>
>>>>> http://isis.apache.org/how-tos/how-to-02-030-How-to-hide-
>>>>> an-action.html
>>>>>
>>>>> By adding a hide to the repository I can only hide it everywhere or
>>>> nowhere but I can't choose to pop up at certain entities only. At
>>>> least, I
>>>> don't know how to do that.
>>>>
>>>> When I add a hideXXX() to the entity where I want to hide the action,
>>>> Isis
>>>> complains about an orphaned method because the method doesn't exist at
>>>> the
>>>> entity itself.
>>>>
>>>
>>> Please share the method's code. The log is misleading. Most probably the
>>> method signature is not correct.
>>>
>>> it should be :
>>> - public
>>> - returning boolean
>>> - the name should be hide[TheCamelCasedActionName](the, same,
>>> parameters,
>>> as, the, action, method)
>>> - the impl should use all available information to decide whether to
>>> return
>>> true or false
>>>
>>>
>>>
>>>> Erik
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>